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

can not connect to librenms gui - 404 page not found #1

Closed
mirzawaqasahmed opened this issue Oct 23, 2018 · 19 comments
Closed

can not connect to librenms gui - 404 page not found #1

mirzawaqasahmed opened this issue Oct 23, 2018 · 19 comments

Comments

@mirzawaqasahmed
Copy link

mirzawaqasahmed commented Oct 23, 2018

I am trying to test the setup with the docker-compose file provided in example.
However when all containers start, I can not connect to the GUI. The page says 404 page not found.

Doing a docker-compose log -f shows following:

app_1        | Setting timezone to Americas/Toronto...
app_1        | Checking if librenms UID / GID has changed...
app_1        | Setting PHP-FPM configuration...
app_1        | Setting OpCache configuration...
app_1        | Setting Nginx configuration...
app_1        | Updating SNMP community...
app_1        | Initializing LibreNMS files / folders...
app_1        | Setting LibreNMS configuration...
app_1        | Fixing permissions...
app_1        | Checking additional Monitoring plugins...
app_1        | Waiting 30s for database to be ready...
app_1        | ERROR: Failed to connect to database on db
traefik_1    | time="2018-10-23T17:42:59Z" level=warning msg="Unable to find the IP address for the container \"/librenms_app_1\": the server is ignored."

Any help is appreciated.

@crazy-max
Copy link
Member

The error seems obvious : app_1 | ERROR: Failed to connect to database on db
Your database is not up.

Can you paste here your docker-compose.yml please. Thanks.

@mirzawaqasahmed
Copy link
Author

mirzawaqasahmed commented Oct 23, 2018

Thanks for the quick reply.
Here is docker-compose.yml

version: "3.2"

services:
  traefik:
    image: traefik:1.6-alpine
    command:
      - "--logLevel=INFO"
      - "--defaultentrypoints=http,https"
      - "--entryPoints=Name:http Address::80 Redirect.EntryPoint:https"
      - "--entryPoints=Name:https Address::443 TLS"
      - "--docker"
      - "--docker.exposedbydefault=false"
      - "--docker.domain=${DOMAINNAME}"
      - "--acme=true"
      - "--acme.acmelogging=true"
      - "--acme.email=licensing@domain.ca"
      - "--acme.storage=acme.json"
      - "--acme.entryPoint=https"
      - "--acme.onhostrule=true"
      - "--acme.httpchallenge=true"
      - "--acme.httpchallenge.entrypoint=http"
    ports:
      - "172.10.10.12:8080:80"
      - "172.10.10.12:8443:443"
    volumes:
      - "/librenms/acme.json:/acme.json"
      - "/var/run/docker.sock:/var/run/docker.sock"
    restart: always

  db:
    image: mariadb:10.2
    command:
      - "mysqld"
      - "--sql-mode="
      - "--innodb-file-per-table=1"
      - "--lower-case-table-names=0"
      - "--log-bin=/var/lib/mysql/mysql-bin.log"
    volumes:
      - "/librenms/db:/var/lib/mysql"
    environment:
      - "TZ=${TZ}"
      - "MYSQL_ALLOW_EMPTY_PASSWORD=yes"
      - "MYSQL_DATABASE=${MYSQL_DATABASE}"
      - "MYSQL_USER=${MYSQL_USER}"
      - "MYSQL_PASSWORD=${MYSQL_PASSWORD}"
    restart: always

  memcached:
    image: memcached:alpine
    environment:
      - "TZ=${TZ}"
    restart: always

  rrdcached:
    image: crazymax/rrdcached
    volumes:
      - "/librenms/rrd:/data/db"
      - "/librenms/rrd-journal:/data/journal"
    environment:
      - "TZ=${TZ}"
      - "PUID=${PUID}"
      - "PGID=${PUID}"
      - "LOG_LEVEL=LOG_INFO"
      - "WRITE_TIMEOUT=1800"
      - "WRITE_JITTER=1800"
      - "WRITE_THREADS=4"
      - "FLUSH_DEAD_DATA_INTERVAL=3600"
    restart: always

  smtp:
    image: juanluisbaptiste/postfix
    volumes:
      - "/etc/localtime:/etc/localtime:ro"
    environment:
      - "SERVER_HOSTNAME=${HOSTNAME}.${DOMAINNAME}"
      - "SMTP_SERVER=${SMTP_SERVER}"
      - "SMTP_USERNAME=${SMTP_USERNAME}"
      - "SMTP_PASSWORD=${SMTP_PASSWORD}"
    restart: always

  app:
    image: librenms/librenms:latest
    domainname: ${DOMAINNAME}
    hostname: ${HOSTNAME}
    depends_on:
      - db
      - memcached
      - rrdcached
      - smtp
    volumes:
      - "/librenms:/data"
    labels:
      - "traefik.enable=true"
      - "traefik.backend=librenms"
      - "traefik.port=80"
      - "traefik.frontend.rule=Host:${HOSTNAME}.${DOMAINNAME}"
    environment:
      - "TZ=${TZ}"
      - "PUID=${PUID}"
      - "PGID=${PGID}"
      - "DB_HOST=db"
      - "DB_NAME=${MYSQL_DATABASE}"
      - "DB_USER=${MYSQL_USER}"
      - "DB_PASSWORD=${MYSQL_PASSWORD}"
      - "DB_TIMEOUT=30"
    env_file:
      - "./librenms.env"
    restart: always

  cron:
    image: librenms/librenms:latest
    domainname: ${DOMAINNAME}
    hostname: ${HOSTNAME}
    command:
      - "/usr/local/bin/cron"
    depends_on:
      - app
    volumes:
      - "/librenms:/data"
    environment:
      - "TZ=${TZ}"
      - "PUID=${PUID}"
      - "PGID=${PGID}"
      - "DB_HOST=db"
      - "DB_NAME=${MYSQL_DATABASE}"
      - "DB_USER=${MYSQL_USER}"
      - "DB_PASSWORD=${MYSQL_PASSWORD}"
      - "DB_TIMEOUT=30"
    env_file:
      - "./librenms.env"
    restart: always

  syslog-ng:
    image: librenms/librenms:latest
    domainname: ${DOMAINNAME}
    hostname: ${HOSTNAME}
    command:
      - "/usr/sbin/syslog-ng"
      - "-F"
    depends_on:
      - app
    ports:
      - "172.10.10.12:514:514/tcp"
      - "172.10.10.12:514:514/udp"
    volumes:
      - "/librenms:/data"
    environment:
      - "TZ=${TZ}"
      - "PUID=${PUID}"
      - "PGID=${PGID}"
      - "DB_HOST=db"
      - "DB_NAME=${MYSQL_DATABASE}"
      - "DB_USER=${MYSQL_USER}"
      - "DB_PASSWORD=${MYSQL_PASSWORD}"
      - "DB_TIMEOUT=30"
    env_file:
      - "./librenms.env"
    restart: always

@crazy-max
Copy link
Member

Hum strange some services are missing in your compose logs. Can you give me the output of docker ps -a and also what is your host operating system ?

@mirzawaqasahmed
Copy link
Author

The logs were truncated.

please find below the output of docker ps -a
And I am running on fresh install of Ubuntu 18.0.4.1 (Desktop and Server). Two seperate VMs with same outcome.
This is from the server.

CONTAINER ID        IMAGE                      COMMAND                  CREATED             STATUS                          PORTS                                                NAMES
4459d2b1ccae        librenms/librenms:latest   "/entrypoint.sh /usr…"   3 minutes ago       Up 3 minutes                    80/tcp, 514/tcp, 514/udp                             librenms_cron_1
34fe0d3382c7        librenms/librenms:latest   "/entrypoint.sh /usr…"   3 minutes ago       Up 3 minutes                    80/tcp, 0.0.0.0:514->514/tcp, 0.0.0.0:514->514/udp   librenms_syslog-ng_1
8083dc4fe36f        librenms/librenms:latest   "/entrypoint.sh /usr…"   3 minutes ago       Up 24 seconds                   80/tcp, 514/tcp, 514/udp                             librenms_app_1
cfe66c15817b        crazymax/rrdcached         "/entrypoint.sh /usr…"   4 minutes ago       Up 3 minutes                    42217/tcp                                            librenms_rrdcached_1
684ac211f804        traefik:1.6-alpine         "/entrypoint.sh --lo…"   4 minutes ago       Up 3 minutes                    0.0.0.0:8080->80/tcp, 0.0.0.0:8443->443/tcp          librenms_traefik_1
cb31c2fa02b0        juanluisbaptiste/postfix   "/run.sh"                4 minutes ago       Restarting (1) 14 seconds ago                                                        librenms_smtp_1
9d8c6fccf411        memcached:alpine           "docker-entrypoint.s…"   4 minutes ago       Up 3 minutes                    11211/tcp                                            librenms_memcached_1
cb31975d1322        mariadb:10.2               "docker-entrypoint.s…"   4 minutes ago       Up 3 minutes                    3306/tcp                                             librenms_db_1

Do you want me to share complete logs?

@crazy-max
Copy link
Member

Yes please :)

@mirzawaqasahmed
Copy link
Author

@crazy-max
Copy link
Member

Ok there are permissions issues on your host.
Is it the first time you use Docker ?
What user are you using when you type docker-compose up -d ?
Can you clean your logs by typing docker-compose down && docker-compose up -d and post them again ?

@crazy-max
Copy link
Member

crazy-max commented Oct 23, 2018

Also paste your .env and librenms.env file (remove sensitive values btw) and list files and folders where your docker-compose.yml file is located please ?

@mirzawaqasahmed
Copy link
Author

mirzawaqasahmed commented Oct 23, 2018

well not first time use but not an expert too.
docker commands are being run as ```waqas` user.

waqas@opsp1:/var/librenms$ cat librenms.env

MEMORY_LIMIT=256M
UPLOAD_MAX_SIZE=16M
OPCACHE_MEM_SIZE=128

LIBRENMS_POLLER_THREADS=16
LIBRENMS_POLLER_INTERVAL=5

LIBRENMS_CRON_DISCOVERY_ENABLE=true
LIBRENMS_CRON_DAILY_ENABLE=true
LIBRENMS_CRON_ALERTS_ENABLE=true
LIBRENMS_CRON_BILLING_ENABLE=true
LIBRENMS_CRON_BILLING_CALCULATE_ENABLE=true
LIBRENMS_CRON_CHECK_SERVICES_ENABLE=true
LIBRENMS_CRON_POLLER_ENABLE=true

LIBRENMS_SNMP_COMMUNITY=librenmsdocker
MEMCACHED_HOST=memcached
MEMCACHED_PORT=11211
RRDCACHED_HOST=rrdcached
RRDCACHED_PORT=42217

waqas@opsp1:/var/librenms$ cat .env

DOMAINNAME=domain.local
HOSTNAME=librenms

MYSQL_DATABASE=librenms
MYSQL_USER=librenms
MYSQL_PASSWORD=asupersecretpassword

SMTP_SERVER=smtp.domain.local
SMTP_USERNAME=smtp@domain.local
SMTP_PASSWORD=

TZ=Americas/Toronto
PUID=1000
PGID=1000```

@crazy-max
Copy link
Member

Ok, for traefik container why using those ports :

ports:
      - "172.10.10.12:8080:80"
      - "172.10.10.12:8443:443"

Also I saw you are using /librenms as based folder for your volumes. Is that folder exists with good permissions for waqas user ?

If you are not an expert, I suggest to use as close as possible our docker-compose.yml

@mirzawaqasahmed
Copy link
Author

mirzawaqasahmed commented Oct 23, 2018

ports:
      - "172.10.10.12:8080:80"
      - "172.10.10.12:8443:443"

is used for specific IP on the docker host.

/librenms has all the permissions for waqas

waqas@opsp1:/var/librenms$ ll /librenms/
total 40
drwxr-xr-x 10 waqas waqas 4096 Oct 23 19:01 ./
drwxr-xr-x 25 root  root  4096 Oct 23 19:00 ../
drwxr-xr-x  2 waqas waqas 4096 Oct 23 19:00 acme.json/
drwxr-xr-x  2 waqas waqas 4096 Oct 23 19:00 config/
drwxr-xr-x  3 waqas waqas 4096 Oct 23 19:26 db/
drwxrwxr-x  2 waqas waqas 4096 Oct 23 19:00 logs/
drwxr-xr-x  2 waqas waqas 4096 Oct 23 19:00 monitoring-plugins/
drwxrwxr-x  2 waqas waqas 4096 Oct 23 19:00 rrd/
drwxr-xr-x  2 waqas waqas 4096 Oct 23 19:26 rrd-journal/
drwxr-xr-x  2 waqas waqas 4096 Oct 23 19:01 syslog-ng/

the simple docker-compose.yml didn't work either...I tried that too.

@mirzawaqasahmed
Copy link
Author

and can you please help me understand from the logs where the permission error is obvious

@mirzawaqasahmed
Copy link
Author

same results with running by root.

root@opsp1:/var/librenms# docker-compose logs -f
Attaching to librenms_syslog-ng_1, librenms_cron_1, librenms_app_1, librenms_rrdcached_1, librenms_db_1, librenms_traefik_1, librenms_smtp_1, librenms_memcached_1
traefik_1    | time="2018-10-23T19:48:23Z" level=info msg="Traefik version v1.6.6 built on 2018-08-20_01:10:06PM"
traefik_1    | time="2018-10-23T19:48:23Z" level=info msg="\nStats collection is disabled.\nHelp us improve Traefik by turning this feature on :)\nMore details on: https://docs.traefik.io/basics/#collected-data\n"
traefik_1    | time="2018-10-23T19:48:23Z" level=error msg="Failed to read new account, ACME data conversion is not available : permissions 755 for acme.json are too open, please use 600"
traefik_1    | time="2018-10-23T19:48:23Z" level=info msg="Preparing server http &{Address::80 TLS:<nil> Redirect:0xc4200e94c0 Auth:<nil> WhitelistSourceRange:[] WhiteList:<nil> Compress:false ProxyProtocol:<nil> ForwardedHeaders:0xc4204fcb00} with readTimeout=0s writeTimeout=0s idleTimeout=3m0s"
traefik_1    | time="2018-10-23T19:48:23Z" level=info msg="Preparing server https &{Address::443 TLS:0xc420509380 Redirect:<nil> Auth:<nil> WhitelistSourceRange:[] WhiteList:<nil> Compress:false ProxyProtocol:<nil> ForwardedHeaders:0xc4204fcba0} with readTimeout=0s writeTimeout=0s idleTimeout=3m0s"
traefik_1    | time="2018-10-23T19:48:23Z" level=info msg="Starting server on :80"
traefik_1    | time="2018-10-23T19:48:23Z" level=info msg="Starting provider configuration.providerAggregator {}"
traefik_1    | time="2018-10-23T19:48:23Z" level=info msg="Starting server on :443"
traefik_1    | time="2018-10-23T19:48:23Z" level=info msg="Starting provider *docker.Provider {\"Watch\":true,\"Filename\":\"\",\"Constraints\":null,\"Trace\":false,\"TemplateVersion\":2,\"DebugLogGeneratedTemplate\":false,\"Endpoint\":\"unix:///var/run/docker.sock\",\"Domain\":\"amjinc.local\",\"TLS\":null,\"ExposedByDefault\":false,\"UseBindPortIP\":false,\"SwarmMode\":false}"
traefik_1    | time="2018-10-23T19:48:23Z" level=info msg="Starting provider *acme.Provider {\"Email\":\"licensing@amjinc.org\",\"ACMELogging\":true,\"CAServer\":\"https://acme-v02.api.letsencrypt.org/directory\",\"Storage\":\"acme.json\",\"EntryPoint\":\"https\",\"OnHostRule\":true,\"OnDemand\":false,\"DNSChallenge\":null,\"HTTPChallenge\":{\"EntryPoint\":\"http\"},\"Domains\":null,\"Store\":{}}"
traefik_1    | time="2018-10-23T19:48:23Z" level=error msg="Error starting provider *acme.Provider: unable to get ACME account : permissions 755 for acme.json are too open, please use 600"
traefik_1    | time="2018-10-23T19:48:25Z" level=info msg="Server configuration reloaded on :443"
traefik_1    | time="2018-10-23T19:48:25Z" level=info msg="Server configuration reloaded on :80"
traefik_1    | time="2018-10-23T19:48:32Z" level=info msg="Skipping same configuration for provider docker"
app_1        | Setting timezone to Americas/Toronto...
app_1        | Checking if librenms UID / GID has changed...
app_1        | Setting PHP-FPM configuration...
app_1        | Setting OpCache configuration...
app_1        | Setting Nginx configuration...
app_1        | Updating SNMP community...
app_1        | Initializing LibreNMS files / folders...
app_1        | Setting LibreNMS configuration...
app_1        | Fixing permissions...
app_1        | Checking additional Monitoring plugins...
app_1        | Waiting 30s for database to be ready...
cron_1       | Setting timezone to Americas/Toronto...
cron_1       | Checking if librenms UID / GID has changed...
cron_1       | Setting PHP-FPM configuration...
cron_1       | Setting OpCache configuration...
cron_1       | Setting Nginx configuration...
cron_1       | Updating SNMP community...
cron_1       | Initializing LibreNMS files / folders...
cron_1       | Setting LibreNMS configuration...
cron_1       | Fixing permissions...
cron_1       | Checking additional Monitoring plugins...
cron_1       | >>
cron_1       | >> Sidecar cron container detected
cron_1       | >>
cron_1       | Fixing crontab permissions...
cron_1       | crond: crond (busybox 1.28.4) started, log level 8
rrdcached_1  | Setting timezone to Americas/Toronto...
rrdcached_1  | Checking if rrdcached UID / GID has changed...
rrdcached_1  | Initializing LibreNMS files / folders...
rrdcached_1  | Creating RRDcached configuration...
rrdcached_1  | Fixing permissions...
rrdcached_1  | starting up
rrdcached_1  | setgid(1000) succeeded
rrdcached_1  | setuid(1000) succeeded
rrdcached_1  | checking for journal files
rrdcached_1  | journal processing complete
rrdcached_1  | listening for connections
syslog-ng_1  | Setting timezone to Americas/Toronto...
syslog-ng_1  | Checking if librenms UID / GID has changed...
syslog-ng_1  | Setting PHP-FPM configuration...
syslog-ng_1  | Setting OpCache configuration...
syslog-ng_1  | Setting Nginx configuration...
syslog-ng_1  | Updating SNMP community...
syslog-ng_1  | Initializing LibreNMS files / folders...
syslog-ng_1  | Setting LibreNMS configuration...
syslog-ng_1  | Fixing permissions...
syslog-ng_1  | Checking additional Monitoring plugins...
syslog-ng_1  | >>
syslog-ng_1  | >> Sidecar syslog-ng container detected
syslog-ng_1  | >>
db_1         | 2018-10-23 19:48:26 140718759884736 [Note] mysqld (mysqld 10.2.18-MariaDB-1:10.2.18+maria~bionic-log) starting as process 1 ...
db_1         | 2018-10-23 19:48:26 140718759884736 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db_1         | 2018-10-23 19:48:26 140718759884736 [Note] InnoDB: Uses event mutexes
db_1         | 2018-10-23 19:48:26 140718759884736 [Note] InnoDB: Compressed tables use zlib 1.2.11
db_1         | 2018-10-23 19:48:26 140718759884736 [Note] InnoDB: Using Linux native AIO
db_1         | 2018-10-23 19:48:26 140718759884736 [Note] InnoDB: Number of pools: 1
db_1         | 2018-10-23 19:48:26 140718759884736 [Note] InnoDB: Using SSE2 crc32 instructions
db_1         | 2018-10-23 19:48:26 140718759884736 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
db_1         | 2018-10-23 19:48:26 140718759884736 [Note] InnoDB: Completed initialization of buffer pool
db_1         | 2018-10-23 19:48:26 140718019229440 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
db_1         | 2018-10-23 19:48:26 140718759884736 [Note] InnoDB: Highest supported file format is Barracuda.
db_1         | 2018-10-23 19:48:27 140718759884736 [Note] InnoDB: 128 out of 128 rollback segments are active.
db_1         | 2018-10-23 19:48:27 140718759884736 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
db_1         | 2018-10-23 19:48:27 140718759884736 [Note] InnoDB: Creating shared tablespace for temporary tables
db_1         | 2018-10-23 19:48:27 140718759884736 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
db_1         | 2018-10-23 19:48:27 140718759884736 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db_1         | 2018-10-23 19:48:27 140718759884736 [Note] InnoDB: 5.7.23 started; log sequence number 1603548
db_1         | 2018-10-23 19:48:27 140717850601216 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db_1         | 2018-10-23 19:48:27 140717850601216 [Note] InnoDB: Cannot open '/var/lib/mysql/ib_buffer_pool' for reading: No such file or directory
db_1         | 2018-10-23 19:48:27 140718759884736 [Note] Plugin 'FEEDBACK' is disabled.
db_1         | 2018-10-23 19:48:27 140718759884736 [Note] Recovering after a crash using /var/lib/mysql/mysql-bin
db_1         | 2018-10-23 19:48:27 140718759884736 [Note] Starting crash recovery...
db_1         | 2018-10-23 19:48:27 140718759884736 [Note] Crash recovery finished.
db_1         | 2018-10-23 19:48:27 140718106134272 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' doesn't exist
db_1         | 2018-10-23 19:48:28 140718759884736 [Note] Server socket created on IP: '::'.
db_1         | 2018-10-23 19:48:28 140718759884736 [ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it
db_1         | 2018-10-23 19:48:28 140718105519872 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' doesn't exist
db_1         | 2018-10-23 19:48:28 140718759884736 [Note] Reading of all Master_info entries succeded
db_1         | 2018-10-23 19:48:28 140718759884736 [Note] Added new Master_info '' to hash table
db_1         | 2018-10-23 19:48:28 140718759884736 [Note] mysqld: ready for connections.
db_1         | Version: '10.2.18-MariaDB-1:10.2.18+maria~bionic-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
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_1 exited with code 1
cron_1       | crond: USER librenms pid  42 cmd /opt/librenms/alerts.php >> /dev/null 2>&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
app_1        | ERROR: Failed to connect to database on db
traefik_1    | time="2018-10-23T19:49:06Z" level=warning msg="Unable to find the IP address for the container \"/librenms_app_1\": the server is ignored."
librenms_smtp_1 exited with code 1

@mirzawaqasahmed
Copy link
Author

I have just run it with the docker-compose file you mentioned above and with root user, however I am still seeing errors.
The gist is available at:
https://gist.github.com/mirzawaqasahmed/a4a47e0dcc3d0b763ec3e7abf9906da7

@laf
Copy link
Member

laf commented Oct 23, 2018

That gist indicates it's ok to me, it's not completed the db schema work but I guess that's because it hadn't finished before you took a snap of the logs?

@mirzawaqasahmed
Copy link
Author

well it still didnt work after waiting for 30 min or 1 hour

@laf
Copy link
Member

laf commented Oct 23, 2018

What you get a 404 still?

What about the rest of the logs, looks more output should be showing than is?

@crazy-max
Copy link
Member

@mirzawaqasahmed Can you try this config in a brand new folder with your env files :

version: "3.2"

services:
  traefik:
    image: traefik:1.6-alpine
    command:
      - "--logLevel=INFO"
      - "--defaultentrypoints=http,https"
      - "--entryPoints=Name:http Address::80 Redirect.EntryPoint:https"
      - "--entryPoints=Name:https Address::443 TLS"
      - "--docker"
      - "--docker.exposedbydefault=false"
      - "--docker.domain=${DOMAINNAME}"
      - "--acme=true"
      - "--acme.acmelogging=true"
      - "--acme.email=licensing@domain.ca"
      - "--acme.storage=acme.json"
      - "--acme.entryPoint=https"
      - "--acme.onhostrule=true"
      - "--acme.httpchallenge=true"
      - "--acme.httpchallenge.entrypoint=http"
    ports:
      - "172.10.10.12:8080:80"
      - "172.10.10.12:8443:443"
    volumes:
      - "./acme.json:/acme.json"
      - "/var/run/docker.sock:/var/run/docker.sock"
    restart: always

  db:
    image: mariadb:10.2
    command:
      - "mysqld"
      - "--sql-mode="
      - "--innodb-file-per-table=1"
      - "--lower-case-table-names=0"
    volumes:
      - "./db:/var/lib/mysql"
    environment:
      - "TZ=${TZ}"
      - "MYSQL_ALLOW_EMPTY_PASSWORD=yes"
      - "MYSQL_DATABASE=${MYSQL_DATABASE}"
      - "MYSQL_USER=${MYSQL_USER}"
      - "MYSQL_PASSWORD=${MYSQL_PASSWORD}"
    restart: always

  memcached:
    image: memcached:alpine
    environment:
      - "TZ=${TZ}"
    restart: always

  rrdcached:
    image: crazymax/rrdcached
    volumes:
      - "./librenms/rrd:/data/db"
      - "./rrd-journal:/data/journal"
    environment:
      - "TZ=${TZ}"
      - "PUID=${PUID}"
      - "PGID=${PUID}"
      - "LOG_LEVEL=LOG_INFO"
      - "WRITE_TIMEOUT=1800"
      - "WRITE_JITTER=1800"
      - "WRITE_THREADS=4"
      - "FLUSH_DEAD_DATA_INTERVAL=3600"
    restart: always

  smtp:
    image: juanluisbaptiste/postfix
    volumes:
      - "/etc/localtime:/etc/localtime:ro"
    environment:
      - "SERVER_HOSTNAME=${HOSTNAME}.${DOMAINNAME}"
      - "SMTP_SERVER=${SMTP_SERVER}"
      - "SMTP_USERNAME=${SMTP_USERNAME}"
      - "SMTP_PASSWORD=${SMTP_PASSWORD}"
    restart: always

  app:
    image: librenms/librenms:latest
    domainname: ${DOMAINNAME}
    hostname: ${HOSTNAME}
    depends_on:
      - db
      - memcached
      - rrdcached
      - smtp
    volumes:
      - "./librenms:/data"
    labels:
      - "traefik.enable=true"
      - "traefik.backend=librenms"
      - "traefik.port=80"
      - "traefik.frontend.rule=Host:${HOSTNAME}.${DOMAINNAME}"
    environment:
      - "TZ=${TZ}"
      - "PUID=${PUID}"
      - "PGID=${PGID}"
      - "DB_HOST=db"
      - "DB_NAME=${MYSQL_DATABASE}"
      - "DB_USER=${MYSQL_USER}"
      - "DB_PASSWORD=${MYSQL_PASSWORD}"
      - "DB_TIMEOUT=30"
    env_file:
      - "./librenms.env"
    restart: always

  cron:
    image: librenms/librenms:latest
    domainname: ${DOMAINNAME}
    hostname: ${HOSTNAME}
    command:
      - "/usr/local/bin/cron"
    depends_on:
      - app
    volumes:
      - "./librenms:/data"
    environment:
      - "TZ=${TZ}"
      - "PUID=${PUID}"
      - "PGID=${PGID}"
      - "DB_HOST=db"
      - "DB_NAME=${MYSQL_DATABASE}"
      - "DB_USER=${MYSQL_USER}"
      - "DB_PASSWORD=${MYSQL_PASSWORD}"
      - "DB_TIMEOUT=30"
    env_file:
      - "./librenms.env"
    restart: always

  syslog-ng:
    image: librenms/librenms:latest
    domainname: ${DOMAINNAME}
    hostname: ${HOSTNAME}
    command:
      - "/usr/sbin/syslog-ng"
      - "-F"
    depends_on:
      - app
    ports:
      - "172.10.10.12:514:514/tcp"
      - "172.10.10.12:514:514/udp"
    volumes:
      - "./librenms:/data"
    environment:
      - "TZ=${TZ}"
      - "PUID=${PUID}"
      - "PGID=${PGID}"
      - "DB_HOST=db"
      - "DB_NAME=${MYSQL_DATABASE}"
      - "DB_USER=${MYSQL_USER}"
      - "DB_PASSWORD=${MYSQL_PASSWORD}"
      - "DB_TIMEOUT=30"
    env_file:
      - "./librenms.env"
    restart: always
sudo touch acme.json
sudo chmod 600 acme.json
sudo docker-compose up -d

@mirzawaqasahmed
Copy link
Author

Hi @crazy-max,
This worked! Thanks for the help.

I have verified the access to GUI only...and not checked other resources. But I would assume the rest will work too.

Thanks for all the help.

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

3 participants