linuxserver / docker-smokeping

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

Fping exited unexpectedly with status 256 on podman #138

Closed anshprat closed 1 year ago

anshprat commented 1 year ago

Is there an existing issue for this?

Current Behavior

While running the default image with podman, fping failed to run.

 docker logs -f smokeping
[custom-init] No custom services found, skipping...
[migrations] started
[migrations] 01-nginx-site-confs-default: executing...
[migrations] 01-nginx-site-confs-default: succeeded
[migrations] done

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/

Brought to you by linuxserver.io
-------------------------------------

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

User uid:    1000
User gid:    1000
-------------------------------------

Setting resolver to  192.168.127.1
Setting worker_processes to 1
generating self-signed keys in /config/keys, you can replace these with your own keys if required
.+....+..+......+.......+..+...+.+.........+.....+.......+...+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..+...+....+...........+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.+....+..+....+.........+..+.............+...+...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*...........+..+...+...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..+.+............+.....+.......+.....+....+.....+....+...+..+.......+...+...+..+......+.........+.......+......+........+.+...+..+.+...+..+...............+.......+......+............+...+..............+............+....+......+.....+.............+...+........+...................+.....+...+...+.........+...+....+..............+......+......+.......+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
[custom-init] No custom files found, skipping...
[ls.io-init] done.
WARNING: Hostname 'ipv6.google.com' does currently not resolve to an IPv4 address
### assuming you are using an fping copy reporting in milliseconds
### assuming you are using an fping copy reporting in milliseconds
Smokeping version 2.007003 successfully launched.
Entering multiprocess mode.
### parsing dig output...OK
Child process 278 started for probe DNS.
Child process 279 started for probe FPing6.
Child process 280 started for probe FPing.
All probe processes started successfully.
FPing6: probing 1 targets with step 300 s and offset 53 s.FPing: probing 25 targets with step 300 s and offset 79 s.DNS: probing 9 targets with step 300 s and offset 239 s.

open3: exec of /usr/sbin/fping -C 20 -q -B1 -r1 -6 -i10 ipv6.google.com failed: Operation not permitted at /usr/share/perl5/vendor_perl/Smokeping/probes/FPing.pm line 147.
Child process 279 (probe FPing6) exited unexpectedly with status 256.
open3: exec of /usr/sbin/fping -C 20 -q -B1 -r1 -4 -i10 www.berkeley.edu www.indiana.edu www.uea.ac.uk 8.8.8.8 9.9.9.9 google.com 8.8.4.4 208.67.220.220 1.0.0.1 youtube.com www.telefonica.de 1.1.1.1 208.67.222.222 web.mit.edu cam.ac.uk ucsd.edu 4.2.2.1 osuosl.org twin-cities.umn.edu facebook.com jupiterbroadcasting.com 4.2.2.2 linuxserver.io cixp.web.cern.ch failed: Operation not permitted at /usr/share/perl5/vendor_perl/Smokeping/probes/FPing.pm line 147.
Child process 280 (probe FPing) exited unexpectedly with status 256.
RRDs::update ERROR: mmaping file '/data/DNSProbes/GoogleDNS1.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/Quad9.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/CloudflareDNS2.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/L3-2.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/CloudflareDNS1.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/OpenDNS2.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/OpenDNS1.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/L3-1.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/GoogleDNS2.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/GoogleDNS1.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/Quad9.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/CloudflareDNS2.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/L3-2.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/CloudflareDNS1.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/OpenDNS2.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/OpenDNS1.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/L3-1.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/GoogleDNS2.rrd': Invalid argument

Following https://lists.oetiker.ch/pipermail/smokeping-users/2017-July/005966.html , I did a docker exec and then a chmos u+s. fping worked fine after that.

-rwxr-xr-x 1 root root 68120 Mar  9  2022 /usr/sbin/fping
root@8da9a171f2a2:/# chown root:root /usr/sbin/fping #Even though its already owned by root, it still fails without this chown somehow?
root@8da9a171f2a2:/# chmod u+s /usr/sbin/fping
root@8da9a171f2a2:/# /usr/sbin/fping 
^C

A docker restart after the above worked fine. This feels like something that needs to be fixed in the base image?

REPOSITORY                       TAG         IMAGE ID      CREATED     SIZE
lscr.io/linuxserver/smokeping    latest      c5871466cd47  2 days ago  272 MB
docker.io/linuxserver/smokeping  latest      c5871466cd47  2 days ago  272 MB```

### Expected Behavior

smokeping/fping should run successfully

### Steps To Reproduce

1. docker run -d \         
  --name=smokeping \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Europe/London \
  -p 80:80 \
  -v $HOME/tmp/smokeping/config:/config \
  -v $HOME/tmp/smokeping/data:/data \
  --restart unless-stopped \
  lscr.io/linuxserver/smokeping:latest
2. docker logs smokeping shows fping failure
3. Checking the web UI shows no ping data etc.

### Environment

```markdown
- OS: Mac OS Ventura 13.0.1 (22A400)
- How docker service was installed:
  - Running podman

CPU architecture

x86-64

Docker creation

docker run -d \         
  --name=smokeping \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Europe/London \
  -p 80:80 \
  -v $HOME/tmp/smokeping/config:/config \
  -v $HOME/tmp/smokeping/data:/data \
  --restart unless-stopped \
  lscr.io/linuxserver/smokeping:latest

Container logs

docker logs -f smokeping
[custom-init] No custom services found, skipping...
[migrations] started
[migrations] 01-nginx-site-confs-default: executing...
[migrations] 01-nginx-site-confs-default: succeeded
[migrations] done

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/

Brought to you by linuxserver.io
-------------------------------------

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

User uid:    1000
User gid:    1000
-------------------------------------

Setting resolver to  192.168.127.1
Setting worker_processes to 1
generating self-signed keys in /config/keys, you can replace these with your own keys if required
.+....+..+......+.......+..+...+.+.........+.....+.......+...+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..+...+....+...........+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.+....+..+....+.........+..+.............+...+...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*...........+..+...+...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..+.+............+.....+.......+.....+....+.....+....+...+..+.......+...+...+..+......+.........+.......+......+........+.+...+..+.+...+..+...............+.......+......+............+...+..............+............+....+......+.....+.............+...+........+...................+.....+...+...+.........+...+....+..............+......+......+.......+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
[custom-init] No custom files found, skipping...
[ls.io-init] done.
WARNING: Hostname 'ipv6.google.com' does currently not resolve to an IPv4 address
### assuming you are using an fping copy reporting in milliseconds
### assuming you are using an fping copy reporting in milliseconds
Smokeping version 2.007003 successfully launched.
Entering multiprocess mode.
### parsing dig output...OK
Child process 278 started for probe DNS.
Child process 279 started for probe FPing6.
Child process 280 started for probe FPing.
All probe processes started successfully.
FPing6: probing 1 targets with step 300 s and offset 53 s.FPing: probing 25 targets with step 300 s and offset 79 s.DNS: probing 9 targets with step 300 s and offset 239 s.

open3: exec of /usr/sbin/fping -C 20 -q -B1 -r1 -6 -i10 ipv6.google.com failed: Operation not permitted at /usr/share/perl5/vendor_perl/Smokeping/probes/FPing.pm line 147.
Child process 279 (probe FPing6) exited unexpectedly with status 256.
open3: exec of /usr/sbin/fping -C 20 -q -B1 -r1 -4 -i10 www.berkeley.edu www.indiana.edu www.uea.ac.uk 8.8.8.8 9.9.9.9 google.com 8.8.4.4 208.67.220.220 1.0.0.1 youtube.com www.telefonica.de 1.1.1.1 208.67.222.222 web.mit.edu cam.ac.uk ucsd.edu 4.2.2.1 osuosl.org twin-cities.umn.edu facebook.com jupiterbroadcasting.com 4.2.2.2 linuxserver.io cixp.web.cern.ch failed: Operation not permitted at /usr/share/perl5/vendor_perl/Smokeping/probes/FPing.pm line 147.
Child process 280 (probe FPing) exited unexpectedly with status 256.
RRDs::update ERROR: mmaping file '/data/DNSProbes/GoogleDNS1.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/Quad9.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/CloudflareDNS2.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/L3-2.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/CloudflareDNS1.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/OpenDNS2.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/OpenDNS1.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/L3-1.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/GoogleDNS2.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/GoogleDNS1.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/Quad9.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/CloudflareDNS2.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/L3-2.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/CloudflareDNS1.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/OpenDNS2.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/OpenDNS1.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/L3-1.rrd': Invalid argument
RRDs::update ERROR: mmaping file '/data/DNSProbes/GoogleDNS2.rrd': Invalid argument
github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

anshprat commented 1 year ago

This seem to be podman specific issue. I did a local build on podman which still failed. I then did a local build on docker where fping is successful at least. Closing this for now since Its not this image specific issue.

timaeos commented 1 year ago

Sorry for reviving this dead issue, however I did want to let people using podman know that in order to get FPing to work in podman you must run it with the follow settings:

--cap-add net_raw and --cap-add net_admin

the command would end up as something like this:

podman run -d \
  --name=smokeping \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  --cap-add net_raw \
  --cap-add net_admin \
  -p 80:80 \
  -v /path/to/smokeping/config:/config \
  -v /path/to/smokeping/data:/data \
  --restart unless-stopped \
  lscr.io/linuxserver/smokeping:latest
BrandonG777 commented 1 year ago

Sorry for reviving this dead issue, however I did want to let people using podman know that in order to get FPing to work in podman you must run it with the follow settings:

--cap-add net_raw and --cap-add net_admin

the command would end up as something like this:

podman run -d \
  --name=smokeping \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  --cap-add net_raw \
  --cap-add net_admin \
  -p 80:80 \
  -v /path/to/smokeping/config:/config \
  -v /path/to/smokeping/data:/data \
  --restart unless-stopped \
  lscr.io/linuxserver/smokeping:latest

struggling to make this work in a podman-compose.yml? I found this... https://stackoverflow.com/questions/58377469/difference-between-cap-add-net-admin-and-add-capabilities-in-yml but still haven't found a working solution.

timaeos commented 1 year ago

Sorry for reviving this dead issue, however I did want to let people using podman know that in order to get FPing to work in podman you must run it with the follow settings: --cap-add net_raw and --cap-add net_admin the command would end up as something like this:

podman run -d \
  --name=smokeping \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  --cap-add net_raw \
  --cap-add net_admin \
  -p 80:80 \
  -v /path/to/smokeping/config:/config \
  -v /path/to/smokeping/data:/data \
  --restart unless-stopped \
  lscr.io/linuxserver/smokeping:latest

struggling to make this work in a podman-compose.yml? I found this... https://stackoverflow.com/questions/58377469/difference-between-cap-add-net-admin-and-add-capabilities-in-yml but still haven't found a working solution.

I don't use podman-compose but from what I'm seeing there's this issue noted

They provide an example that's a bit different from the one you provide. Based on what they wrote, I'd expect it to be something like:

cap_add:
 - net_raw
 - net_admin

They also seem to note that the capability was added in a specific version of podman-compose. Which version are you running?