docker icon indicating copy to clipboard operation
docker copied to clipboard

Scheduler is not running when using compose.yml

Open abacef opened this issue 2 years ago • 4 comments

Support guidelines

I've found a bug and checked that ...

  • [X] ... the documentation does not mention anything about my problem
  • [X] ... there are no open or closed issues that are related to my problem

Description

FAIL: Scheduler is not running with a fix of sudo cp /opt/librenms/dist/librenms-scheduler.cron /etc/cron.d/

Expected behaviour

The scheduler should be started using docker compose without any extra intervention

Actual behaviour

The scheduler is not started

Steps to reproduce

Follow the instructions here https://docs.librenms.org/Installation/Docker/

Docker info

Client: Docker Engine - Community
 Version:    24.0.7
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.11.2
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.21.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 7
  Running: 7
  Paused: 0
  Stopped: 0
 Images: 5
 Server Version: 24.0.7
 Storage Driver: overlay2
  Backing Filesystem: btrfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: false
  userxattr: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 3dd1e886e55dd695541fdcd67420c2888645a495
 runc version: v1.1.10-0-g18a0cb0
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
 Kernel Version: 6.1.55-06877-gc83437f2949f
 Operating System: Debian GNU/Linux 11 (bullseye)
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 6.436GiB
 Name: penguin
 ID: 76aaec60-4c0d-46fc-af9d-70722419157b
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

Docker Compose config

name: librenms
services:
  db:
    command:
    - mysqld
    - --innodb-file-per-table=1
    - --lower-case-table-names=0
    - --character-set-server=utf8mb4
    - --collation-server=utf8mb4_unicode_ci
    container_name: librenms_db
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
      MYSQL_DATABASE: librenms
      MYSQL_PASSWORD: asupersecretpassword
      MYSQL_USER: librenms
      TZ: Europe/Paris
    image: mariadb:10.5
    networks:
      default: null
    restart: always
    volumes:
    - type: bind
      source: /home/bacef/ws/librenms/docker-master/examples/compose/db
      target: /var/lib/mysql
      bind:
        create_host_path: true
  dispatcher:
    cap_add:
    - NET_ADMIN
    - NET_RAW
    container_name: librenms_dispatcher
    depends_on:
      librenms:
        condition: service_started
        required: true
      redis:
        condition: service_started
        required: true
    environment:
      CACHE_DRIVER: redis
      DB_HOST: db
      DB_NAME: librenms
      DB_PASSWORD: asupersecretpassword
      DB_TIMEOUT: "60"
      DB_USER: librenms
      DISPATCHER_NODE_ID: dispatcher1
      LIBRENMS_SNMP_COMMUNITY: librenmsdocker
      LIBRENMS_WEATHERMAP: "false"
      LIBRENMS_WEATHERMAP_SCHEDULE: '*/5 * * * *'
      LOG_IP_VAR: remote_addr
      MAX_INPUT_VARS: "1000"
      MEMORY_LIMIT: 256M
      OPCACHE_MEM_SIZE: "128"
      PGID: "1000"
      PUID: "1000"
      REAL_IP_FROM: 0.0.0.0/32
      REAL_IP_HEADER: X-Forwarded-For
      REDIS_HOST: redis
      SESSION_DRIVER: redis
      SIDECAR_DISPATCHER: "1"
      TZ: Europe/Paris
      UPLOAD_MAX_SIZE: 16M
    hostname: librenms-dispatcher
    image: librenms/librenms:latest
    networks:
      default: null
    restart: always
    volumes:
    - type: bind
      source: /home/bacef/ws/librenms/docker-master/examples/compose/librenms
      target: /data
      bind:
        create_host_path: true
  librenms:
    cap_add:
    - NET_ADMIN
    - NET_RAW
    container_name: librenms
    depends_on:
      db:
        condition: service_started
        required: true
      msmtpd:
        condition: service_started
        required: true
      redis:
        condition: service_started
        required: true
    environment:
      CACHE_DRIVER: redis
      DB_HOST: db
      DB_NAME: librenms
      DB_PASSWORD: asupersecretpassword
      DB_TIMEOUT: "60"
      DB_USER: librenms
      LIBRENMS_SNMP_COMMUNITY: librenmsdocker
      LIBRENMS_WEATHERMAP: "false"
      LIBRENMS_WEATHERMAP_SCHEDULE: '*/5 * * * *'
      LOG_IP_VAR: remote_addr
      MAX_INPUT_VARS: "1000"
      MEMORY_LIMIT: 256M
      OPCACHE_MEM_SIZE: "128"
      PGID: "1000"
      PUID: "1000"
      REAL_IP_FROM: 0.0.0.0/32
      REAL_IP_HEADER: X-Forwarded-For
      REDIS_HOST: redis
      SESSION_DRIVER: redis
      TZ: Europe/Paris
      UPLOAD_MAX_SIZE: 16M
    hostname: librenms
    image: librenms/librenms:latest
    networks:
      default: null
    ports:
    - target: 8000
      published: "8000"
      protocol: tcp
    restart: always
    volumes:
    - type: bind
      source: /home/bacef/ws/librenms/docker-master/examples/compose/librenms
      target: /data
      bind:
        create_host_path: true
  msmtpd:
    container_name: librenms_msmtpd
    environment:
      SMTP_AUTH: "on"
      SMTP_FROM: [email protected]
      SMTP_HOST: smtp.gmail.com
      SMTP_PASSWORD: bar
      SMTP_PORT: "587"
      SMTP_STARTTLS: "on"
      SMTP_TLS: "on"
      SMTP_TLS_CHECKCERT: "on"
      SMTP_USER: foo
    image: crazymax/msmtpd:latest
    networks:
      default: null
    restart: always
  redis:
    container_name: librenms_redis
    environment:
      TZ: Europe/Paris
    image: redis:5.0-alpine
    networks:
      default: null
    restart: always
  snmptrapd:
    cap_add:
    - NET_ADMIN
    - NET_RAW
    container_name: librenms_snmptrapd
    depends_on:
      librenms:
        condition: service_started
        required: true
      redis:
        condition: service_started
        required: true
    environment:
      CACHE_DRIVER: redis
      DB_HOST: db
      DB_NAME: librenms
      DB_PASSWORD: asupersecretpassword
      DB_TIMEOUT: "60"
      DB_USER: librenms
      LIBRENMS_SNMP_COMMUNITY: librenmsdocker
      LIBRENMS_WEATHERMAP: "false"
      LIBRENMS_WEATHERMAP_SCHEDULE: '*/5 * * * *'
      LOG_IP_VAR: remote_addr
      MAX_INPUT_VARS: "1000"
      MEMORY_LIMIT: 256M
      OPCACHE_MEM_SIZE: "128"
      PGID: "1000"
      PUID: "1000"
      REAL_IP_FROM: 0.0.0.0/32
      REAL_IP_HEADER: X-Forwarded-For
      REDIS_HOST: redis
      SESSION_DRIVER: redis
      SIDECAR_SNMPTRAPD: "1"
      TZ: Europe/Paris
      UPLOAD_MAX_SIZE: 16M
    hostname: librenms-snmptrapd
    image: librenms/librenms:latest
    networks:
      default: null
    ports:
    - target: 162
      published: "162"
      protocol: tcp
    - target: 162
      published: "162"
      protocol: udp
    restart: always
    volumes:
    - type: bind
      source: /home/bacef/ws/librenms/docker-master/examples/compose/librenms
      target: /data
      bind:
        create_host_path: true
  syslogng:
    cap_add:
    - NET_ADMIN
    - NET_RAW
    container_name: librenms_syslogng
    depends_on:
      librenms:
        condition: service_started
        required: true
      redis:
        condition: service_started
        required: true
    environment:
      CACHE_DRIVER: redis
      DB_HOST: db
      DB_NAME: librenms
      DB_PASSWORD: asupersecretpassword
      DB_TIMEOUT: "60"
      DB_USER: librenms
      LIBRENMS_SNMP_COMMUNITY: librenmsdocker
      LIBRENMS_WEATHERMAP: "false"
      LIBRENMS_WEATHERMAP_SCHEDULE: '*/5 * * * *'
      LOG_IP_VAR: remote_addr
      MAX_INPUT_VARS: "1000"
      MEMORY_LIMIT: 256M
      OPCACHE_MEM_SIZE: "128"
      PGID: "1000"
      PUID: "1000"
      REAL_IP_FROM: 0.0.0.0/32
      REAL_IP_HEADER: X-Forwarded-For
      REDIS_HOST: redis
      SESSION_DRIVER: redis
      SIDECAR_SYSLOGNG: "1"
      TZ: Europe/Paris
      UPLOAD_MAX_SIZE: 16M
    hostname: librenms-syslogng
    image: librenms/librenms:latest
    networks:
      default: null
    ports:
    - target: 514
      published: "514"
      protocol: tcp
    - target: 514
      published: "514"
      protocol: udp
    restart: always
    volumes:
    - type: bind
      source: /home/bacef/ws/librenms/docker-master/examples/compose/librenms
      target: /data
      bind:
        create_host_path: true
networks:
  default:
    name: librenms_default

Logs

Where are these logs?

Additional info

No response

abacef avatar Dec 28 '23 20:12 abacef

Check #382

Don-Swanson avatar Jan 22 '24 03:01 Don-Swanson

The problem is that the env is not populated into the php-fpm process for some reason so CACHE_DRIVER (and others?) is different between OS and php-fpm.

Jellyfrog avatar Jan 26 '24 12:01 Jellyfrog

We are experiencing a persistent issue where our vanilla Docker Compose setup fails to pull data. Upon entering the container and manually executing the update command, the data is refreshed. This leads me to believe there may be a malfunction with either the dispatcher or the cron job.

python poller-wrapper.py 4 && sleep 300 && python poller-wrapper.py 4

vladaman avatar Feb 16 '24 19:02 vladaman