Docker Container Woes

Tags: #<Tag:0x00007f52243b75b8>

Hi all -

Having a real headache getting the official LibreNMS Docker container to work with the example config - I’m running Centos7 on ESXi and have disabled selinux for now.

I followed the Docker Compose instructions here to the letter:

https://github.com/librenms/docker/blob/master/doc/usage.md

I left all of the example file contents as they were, hoping that everything would at least start up (without the correct hostname etc), but I can’t get the web UI to load.

docker-compose logs | grep error doesn’t show any errors - here are the last few lines (guessing the SMTP_PASSWORD messages are not fatal to the app as a whole):

db_1         | 2020-04-28 19:05:35 140533594838784 [Note] InnoDB: Buffer pool(s) load completed at 200428 19:05:35
librenms     | Nothing to migrate.
librenms     | [cont-init.d] 04-svc-main.sh: exited 0.
librenms     | [cont-init.d] 05-svc-cron.sh: executing...
librenms     | [cont-init.d] 05-svc-cron.sh: exited 0.
librenms     | [cont-init.d] 06-svc-syslogng.sh: executing...
librenms     | [cont-init.d] 06-svc-syslogng.sh: exited 0.
librenms     | [cont-init.d] done.
librenms     | [services.d] starting services
librenms     | 2020/04/28 19:05:35 [notice] 318#318: using the "epoll" event method
librenms     | 2020/04/28 19:05:35 [notice] 318#318: nginx/1.16.1
librenms     | 2020/04/28 19:05:35 [notice] 318#318: OS: Linux 3.10.0-1127.el7.x86_64
librenms     | 2020/04/28 19:05:35 [notice] 318#318: getrlimit(RLIMIT_NOFILE): 1048576:1048576
librenms     | 2020/04/28 19:05:35 [notice] 318#318: start worker processes
librenms     | 2020/04/28 19:05:35 [notice] 318#318: start worker process 325
librenms     | [services.d] done.
librenms     | [28-Apr-2020 19:05:35] NOTICE: fpm is running, pid 316
librenms     | [28-Apr-2020 19:05:35] NOTICE: ready to handle connections
librenms_smtp exited with code 1
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
librenms_smtp exited with code 1
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
cron_1       | crond: USER librenms pid 320 cmd /opt/librenms/alerts.php >> /dev/null 2>&1
librenms_smtp exited with code 1
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
smtp_1       | SMTP_PASSWORD is not set
librenms     | OMITTED - - [28/Apr/2020:19:06:46 +0200] "GET / HTTP/1.1" 302 386 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0"
librenms     | OMITTED - - [28/Apr/2020:19:06:46 +0200] "GET /login HTTP/1.1" 200 2401 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0"

Port 8000 is listening (assuming that’s what I should connect to to see the LibreNMS GUI?):

netstat -plant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1619/master
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1068/sshd
tcp        0     36 OMITTED:22       OMITTED:25688      ESTABLISHED 12010/sshd: [email protected]
tcp6       0      0 ::1:25                  :::*                    LISTEN      1619/master
tcp6       0      0 :::8000                 :::*                    LISTEN      20091/docker-proxy
tcp6       0      0 :::514                  :::*                    LISTEN      20570/docker-proxy
tcp6       0      0 :::22                   :::*                    LISTEN      1068/sshd

Navigating to http://OMITTED:8000 redirects to OMITTED/login and the page doesn’t load (presumably because nothing is listening on TCP 80). I am seeing some 200 HTTP response codes in the log (see above).

Running containers:

docker ps
CONTAINER ID        IMAGE                      COMMAND                  CREATED             STATUS                         PORTS                                                  NAMES
382f1508f001        librenms/librenms:latest   "/init"                  16 minutes ago      Up 3 minutes                   514/tcp, 8000/tcp, 514/udp                             librenms_cron
a7c183cb5203        librenms/librenms:latest   "/init"                  16 minutes ago      Up 3 minutes                   0.0.0.0:514->514/tcp, 0.0.0.0:514->514/udp, 8000/tcp   librenms_syslog
b2d71f2126f2        librenms/librenms:latest   "/init"                  16 minutes ago      Up 3 minutes                   514/tcp, 514/udp, 0.0.0.0:8000->8000/tcp               librenms
a173db1e5aca        crazymax/rrdcached         "/entrypoint.sh /usr…"   16 minutes ago      Up 3 minutes (healthy)         42217/tcp                                              librenms_rrdcached
9f171c76a1e8        juanluisbaptiste/postfix   "/run.sh"                16 minutes ago      Restarting (1) 7 seconds ago                                                          librenms_smtp
811239db7d04        mariadb:10.2               "docker-entrypoint.s…"   16 minutes ago      Up 3 minutes                   3306/tcp                                               librenms_db
14458bfdc2e4        memcached:alpine           "docker-entrypoint.s…"   16 minutes ago      Up 3 minutes                   11211/tcp                                              librenms_memcached

Docker version: 19.03.8, build afacb8b

Have I missed anything obvious? I tried messing around with the traefik example and got a little further (it would display 404 errors, which showed the web server was running) but again, couldn’t get the UI to load.

Any help would be gratefully received.

Just to update what I have done since the post above:

1: Tried installing LibreNMS natively with Nginx - this resulted in a PHP issue which I tried to troubleshoot with members on Discord (thanks to those who assisted). We changed a lot of settings, but could not get the web pages to load after Setup was completed.
2: Decided to reinstall CentOS 7 and start from scratch with the Docker container again (as that is how I want to run it).
3: Used the Docker-Compose example again and this time, added a hostname to .env and docker-compose.yml - I’m not using DNS here, so I added the same hostname for the machine to my Windows hosts file and also the /etc/hosts file on the CentOS machine.

I’m still running into the same problem - the web server itself seems to be working OK (http://omitted:8000 redirects to /login) but then the login page does not load - I can’t proceed any further.

Guessing it’s a PHP issue, or an issue with NGINX talking to PHP (same as I saw with the native install)… can anyone suggest how to troubleshoot this further?

Did you user the docker-compose.yml or the minimal run command in that how-to link?

If docker-compose please attach that file.

I’m no expert but I’ve spun up a couple of instances using compose