Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to start the HTTP Server #1943

Open
hgshoggins opened this issue Mar 13, 2024 · 3 comments
Open

Failed to start the HTTP Server #1943

hgshoggins opened this issue Mar 13, 2024 · 3 comments

Comments

@hgshoggins
Copy link

A rather self-explanatory issue, when running olad with few arguments like

olad -l4

I get an exit signal of 69 and I'm unable to start olad.
When starting it with --no-http it works.

[...]
common/rdm/PidStoreLoader.cpp:282: Loading MODEL_ID_LIST
common/rdm/PidStoreLoader.cpp:282: Loading PIXEL_TYPE
common/rdm/PidStoreLoader.cpp:282: Loading PIXEL_COUNT
common/rdm/PidStoreLoader.cpp:221: Load Complete
common/network/PosixInterfacePicker.cpp:168: Skipping lo because it's a loopback
common/network/PosixInterfacePicker.cpp:256: Found: enp1s0, 10.200.100.196, 52:54:00:63:79:fd
common/network/InterfacePicker.cpp:94: Using interface enp1s0 (10.200.100.196)
olad/OlaServer.cpp:194: Server UID is 7a70:c464c80a
olad/OlaServer.cpp:206: Server instance name is OLA Server
olad/plugin_api/Preferences.cpp:465: Missing /home/olad/.ola/ola-universe.conf: No such file or directory - this isn't an error, we'll just use the defaults
common/io/EPoller.cpp:82: EPOLL_CTL_ADD 9, events 2001, descriptor: 0x1d319b0
olad/OlaServer.cpp:280: Failed to start the HTTP server.
common/io/EPoller.cpp:116: EPOLL_CTL_DEL 9
common/thread/Thread.cpp:200: Thread signal-thread, policy SCHED_OTHER, priority 0

I would like to debug more but I'm not sure where to start.
This is the latest version from master branch ff8bf86.

@peternewman
Copy link
Member

Curious @hgshoggins I don't think we've seen this one before.

As a first question, what OS, what version of libmicrohttpd have you got installed etc.

As a quick check, there's nothing listening on port 9090 already is there?

I assume you've compiled it from scratch yourself? Could you share your config.log please?

If you're up for some investigation yourself, it's failing somewhere in here:

ola/olad/OlaServer.cpp

Lines 407 to 443 in ff8bf86

bool OlaServer::StartHttpServer(ola::rpc::RpcServer *server,
const ola::network::Interface &iface) {
if (!m_options.http_enable) {
return true;
}
// create a pipe for the HTTP server to communicate with the main
// server on.
auto_ptr<ola::io::PipeDescriptor> pipe_descriptor(
new ola::io::PipeDescriptor());
if (!pipe_descriptor->Init()) {
return false;
}
// ownership of the pipe_descriptor is transferred here.
OladHTTPServer::OladHTTPServerOptions options;
options.port = m_options.http_port ? m_options.http_port : DEFAULT_HTTP_PORT;
options.data_dir = (m_options.http_data_dir.empty() ? HTTP_DATA_DIR :
m_options.http_data_dir);
options.enable_quit = m_options.http_enable_quit;
auto_ptr<OladHTTPServer> httpd(
new OladHTTPServer(m_export_map, options,
pipe_descriptor->OppositeEnd(),
this, iface));
if (httpd->Init()) {
httpd->Start();
// register the pipe descriptor as a client
InternalNewConnection(server, pipe_descriptor.release());
m_httpd.reset(httpd.release());
return true;
} else {
pipe_descriptor->Close();
return false;
}
}

If you chucked some of these:
OLA_WARN << "Failed to do x";

In that function just before each return false line, we can start to work out where it's breaking and then hopefully what's going wrong. If you put some vaguely sensible messages in them, feel free to open a PR with the changes and we'll get them merged as they'd help others in future.

Then it's just a case of working up the chain until we find a cause.

You could also try posting a strace olad -l4 which might tell us what's happening.

@hgshoggins
Copy link
Author

Of course that was it! Sorry for the noise, I tried indeed to debug manually with some logging at some points, and... that was the server already listening on port 9090 because it's a Fedora VM with the cockpit service up and running.
That should have been the first thing to look for before opening an issue. Sorry again.

@peternewman
Copy link
Member

Glad you've sorted it @hgshoggins and that's probably worthy of our FAQ given it's a standard Fedora VM config.

I'm reopening this only because I feel you probably shouldn't have even had to open an issue. For such a relatively simple issue ideally our logging should signpost the cause of the issue better.

Do you fancy opening a PR with some suitable logging given you've got an easy test environment?

@peternewman peternewman reopened this Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants