linuxserver / docker-smokeping

GNU General Public License v3.0
346 stars 95 forks source link

[BUG] Smokeping service fails to start automatically #175

Closed jordandalley closed 4 months ago

jordandalley commented 6 months ago

Is there an existing issue for this?

Current Behavior

I'm uncertain when this started happening, but I noticed one day that my smokeping instance had not been collecting any metrics. The web service was running, but no new metrics were being collected.

After some troubleshooting, I discovered that the container is no longer starting the smokeping service automatically, and thus, none of the probes are running.

I then discovered that if I run the following, it starts working again: docker exec -it smokeping /run/service/svc-smokeping/run &

That is until the container is updated or restarted,

I have tried a completely new container by deleting the existing container,, and purging any old images, then using 'docker compose up -d smokeping' to recreate it. I've also completely started the smokeping config again, including the database and it still won't auto start.

Expected Behavior

No response

Steps To Reproduce

For me, it's just starting the container.

The following processes fail to start unless I start them manually:

abc 769 0.0 0.5 60632 47808 ? S 19:22 0:00 /usr/bin/perl /usr/sbin/smokeping --config=/etc/smokeping/config --nodaemon abc 783 0.0 0.4 60680 39380 ? S 19:23 0:00 /usr/sbin/smokeping [FPing] abc 784 0.0 0.4 60632 39352 ? S 19:23 0:00 /usr/sbin/smokeping [DNS] abc 785 0.0 0.4 60676 39332 ? S 19:23 0:00 /usr/sbin/smokeping [FPing6]

Environment

OS: Debian 11 (Bullseye)
Installed using APT package management

More info below:

1. Output of uname -mr && docker version

6.1.0-0.deb11.17-amd64 x86_64
Client: Docker Engine - Community
 Version:           26.1.0
 API version:       1.45
 Go version:        go1.21.9
 Git commit:        9714adc
 Built:             Mon Apr 22 17:07:06 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          26.1.0
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.9
  Git commit:       c8af8eb
  Built:            Mon Apr 22 17:07:06 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.31
  GitCommit:        e377cd56a71523140ca6ae87e30244719194a521
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

2. Output of cat /etc/os-release

PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

CPU architecture

x86-64

Docker creation

---
services:
  smokeping:
    image: lscr.io/linuxserver/smokeping:latest
    container_name: smokeping
    network_mode: host
    hostname: smokeping
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Pacific/Auckland
    volumes:
      - /home/svcs/docker/smokeping/config:/config
      - /home/svcs/docker/smokeping/data:/data
    restart: unless-stopped

Container logs

[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────

[custom-init] No custom files found, skipping...
AH00557: httpd: apr_sockaddr_info_get() failed for smokeping
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
github-actions[bot] commented 6 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

jordandalley commented 6 months ago

Update - Running 'docker exec -it smokeping s6-svc -u /run/service/svc-smokeping' brings the service up. Has to be done each time the container is restarted.

LinuxServer-CI commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

hagaram commented 4 months ago

Arent you by any chance running apache on different than default port e.g. 8080 in my case. Also I run it with network mode host.

The culprit was /etc/s6-overlay/s6-rc.d/svc-apache/run in my case.

--- /tmp/svc-apache
+++ /etc/s6-overlay/s6-rc.d/svc-apache/run
@@ -2,5 +2,5 @@
 # shellcheck shell=bash

 exec \
-    s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 80" \
+    s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 8080" \
         /usr/sbin/apachectl -D FOREGROUND

Until apache is not sucesfuly running , smokeping wont start, because it has apache as dependency

Try to run the container with these additional env vars and see for yourself

  S6_LOGGING: "0"
  S6_VERBOSITY: "5"

When I ran the instance on port 8080 with nginx in front of it listening on port 80 it ran OK, If not, apache never "finished" the startup process thus smokeping startup wasnt triggered.

Wireheadbe commented 4 months ago

Same issue - running in host mode.

hagaram commented 4 months ago

@Wireheadbe Check the s6-overlay logs by including the additional ENV variables I've posted - it might give you an insigth what services are being started, or if they are started succesfully. I dont think its an issue with this container itself, as I've resolved it with the steps provided - it was issue with my local setup and changes.

When running in network mode host, even your firewall (if it is in place) might interfere with the notify.

I found out something from container is trying to communicate to port 80, even tough my apache config stated 8080 with tcpdump, then I searched this repo for "80" and found the s6-notifyoncheck and voala.

thespad commented 4 months ago

FWIW that should be fixed in https://github.com/linuxserver/docker-smokeping/pull/177

jordandalley commented 4 months ago

@thespad Thank you very much! :)

thespad commented 4 months ago

You can test with lspipepr/smokeping:2.8.2-r3-pkg-5382b62f-dev-0df9a2a3bfceb1d7bfccd2c42658715e4a2eb8fc-pr-177 if you want to see if it resolves the issues.

jordandalley commented 4 months ago

Perfect! ran that image and those processes come straight up.