Docker image without Traefik: web ERR_CONNECTION_REFUSED

I’ll say thank you now as there is too much text below to put it at the bottom!

I’m running into an issue where I’m getting ERR_CONNECTION_REFUSED on the web ui of the docker librenms install I pulled down today from https://github.com/librenms/docker. It happens externally, or within the container:

root@server:~# docker exec -it --user librenms librenms bash
bash-5.0$ curl "http://localhost"
curl: (7) Failed to connect to localhost port 80: Connection refused
bash-5.0$

I’m not overly familiar with nginx, and the rest of the install seems to be relatively functional after I initialized the DB manually.

root@server:~# docker exec -it --user librenms librenms php validate.php
====================================
Component | Version
--------- | -------
LibreNMS  | 1.57
DB Schema | 2019_10_03_211702_serialize_config (145)
PHP       | 7.3.11
MySQL     | 10.2.29-MariaDB-1:10.2.29+maria~bionic
RRDTool   | 1.7.2
SNMP      | NET-SNMP 5.8
====================================

[OK]    Composer Version: 1.9.1
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database schema correct
[WARN]  You have not added any devices yet.
        [FIX]:
        You can add a device in the webui or with ./addhost.php
[WARN]  IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[WARN]  Your install is over 24 hours out of date, last update: Tue, 29 Oct 2019 00:40:17 +0000
        [FIX]:
        Make sure your daily.sh cron is running and run ./daily.sh by hand to see if there are any errors.
[WARN]  Your local git branch is not master, this will prevent automatic updates.
        [FIX]:
        You can switch back to master with git checkout master
[WARN]  Your local git contains modified files, this could prevent automatic updates.
        [FIX]:
        You can fix this with ./scripts/github-remove
        Modified Files:
         snmp-scan.py
[FAIL]  Some folders have incorrect file permissions, this may cause issues.
        [FIX]:
        sudo chown -R librenms:librenms /opt/librenms
        sudo setfacl -d -m g::rwx /data/rrd /data/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
        sudo chmod -R ug=rwX /data/rrd /data/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
        Files:
         /opt/librenms/bootstrap/cache/packages.php

inside the container try run /usr/bin/supervisord -c /etc/supervisord.conf

Here’s the output, and that of netstat from within the container:

bash-5.0# /usr/bin/supervisord -c /etc/supervisord.conf
2019-11-15 13:35:05,754 INFO Included extra file "/etc/supervisord/cron.conf" during parsing
2019-11-15 13:35:05,754 INFO Set uid to user 0 succeeded
Error: Another program is already listening on a port that one of our HTTP servers is configured to use.  Shut this program down first before starting supervisord.
For help, use /usr/bin/supervisord -h
bash-5.0# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.11:38845        0.0.0.0:*               LISTEN      -
udp        0      0 127.0.0.11:52970        0.0.0.0:*                           -
bash-5.0#

when I test nginx from inside the container:

bash-5.0# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
bash-5.0# nginx

I get a 502 Bad Gateway error. It almost seems like things aren’t starting up inside the container?

Just to add to this, I was attempting to get it set up in docker with no luck last week :frowning:

Anything in the docker logs for the container?

There’s lots when I initialize, but it’s hard to tell after that, as nothing springs out. I’m happy to post if someone thinks it will be helpful. The system feels like it’s not getting setup all the way when I run docker-compose up -d the first time: have to run DB setup manually, and then nginx is not running, probably among other things.

I went through the three config files ( .env librenms.env and docker-compose.yml) with the changes I had made one at a time. Everything work until I tried to turn on the sidecar cron container by setting SIDECAR_CRON=1 in librenms.env . That broke it. I may be misunderstanding the docker documentation, but it read to me like the cron sidecar container had to be turned on with by by setting the SIDECAR_CRON environment variable to 1, but it seems to run just fine so far without, and won’t run with.

1 Like

As it’s called, a sidecar cron is a dedicated container and must be run alongside your actual librenms container. See crons doc and this compose example. Read also the documenation section.