docker-czkawka icon indicating copy to clipboard operation
docker-czkawka copied to clipboard

[Bug] fail to start at host network mode

Open qhgary opened this issue 1 year ago • 8 comments

Current Behavior

I used this docker on my Synology 918 (DSM7) There’s no problem if I started it with port mapping, like 5800:5800, however if I started the docker in host network mode, it reported the below log:

Log: [app ] 06:51:38.237 [INFO] czkawka_gui: Set thread number to 2 [app ] (czkawka_gui:630): Gdk-WARNING **: 14:51:38.561: The program 'czkawka_gui' received an X Window System error. [app ] This probably reflects a bug in the program. [app ] The error was 'BadShmSeg (invalid shared segment parameter)'. [app ] (Details: serial 1230 error_code 128 request_code 130 (MIT-SHM) minor_code 3) [app ] (Note to programmers: normally, X errors are reported asynchronously; [app ] that is, you will receive the error a while after causing it. [app ] To debug your program, run it with the GDK_SYNCHRONIZE environment [app ] variable to change this behavior. You can then get a meaningful [app ] backtrace from your debugger if you break on the gdk_x_error() function.)

Expected Behavior

No response

Steps To Reproduce

No response

Environment

  • OS:
  • OS version:
  • CPU:
  • Docker version:
  • Device model:
  • Browser/OS:

Container creation

It only has problems at host network mode.

Container log

[init        ] container is starting...
[cont-env    ] loading container environment variables...
[cont-env    ] APP_NAME: loading...
[cont-env    ] APP_VERSION: loading...
[cont-env    ] DISPLAY: executing...
[cont-env    ] DISPLAY: terminated successfully.
[cont-env    ] DISPLAY: loading...
[cont-env    ] DOCKER_IMAGE_PLATFORM: loading...
[cont-env    ] DOCKER_IMAGE_VERSION: loading...
[cont-env    ] GTK2_RC_FILES: executing...
[cont-env    ] GTK2_RC_FILES: terminated successfully.
[cont-env    ] GTK2_RC_FILES: loading...
[cont-env    ] GTK_THEME: executing...
[cont-env    ] GTK_THEME: terminated successfully.
[cont-env    ] GTK_THEME: loading...
[cont-env    ] HOME: loading...
[cont-env    ] QT_STYLE_OVERRIDE: executing...
[cont-env    ] QT_STYLE_OVERRIDE: terminated successfully.
[cont-env    ] QT_STYLE_OVERRIDE: loading...
[cont-env    ] TAKE_CONFIG_OWNERSHIP: loading...
[cont-env    ] XDG_CACHE_HOME: loading...
[cont-env    ] XDG_CONFIG_HOME: loading...
[cont-env    ] XDG_DATA_HOME: loading...
[cont-env    ] XDG_RUNTIME_DIR: loading...
[cont-env    ] XDG_STATE_HOME: loading...
[cont-env    ] container environment variables initialized.
[cont-secrets] loading container secrets...
[cont-secrets] container secrets loaded.
[cont-init   ] executing container initialization scripts...
[cont-init   ] 10-certs.sh: executing...
[cont-init   ] 10-certs.sh: terminated successfully.
[cont-init   ] 10-check-app-niceness.sh: executing...
[cont-init   ] 10-check-app-niceness.sh: terminated successfully.
[cont-init   ] 10-clean-logmonitor-states.sh: executing...
[cont-init   ] 10-clean-logmonitor-states.sh: terminated successfully.
[cont-init   ] 10-clean-tmp-dir.sh: executing...
[cont-init   ] 10-clean-tmp-dir.sh: terminated successfully.
[cont-init   ] 10-fontconfig-cache-dir.sh: executing...
[cont-init   ] 10-fontconfig-cache-dir.sh: terminated successfully.
[cont-init   ] 10-init-users.sh: executing...
[cont-init   ] 10-init-users.sh: terminated successfully.
[cont-init   ] 10-nginx.sh: executing...
[cont-init   ] 10-nginx.sh: terminated successfully.
[cont-init   ] 10-openbox.sh: executing...
[cont-init   ] 10-openbox.sh: terminated successfully.
[cont-init   ] 10-pkgs-mirror.sh: executing...
[cont-init   ] 10-pkgs-mirror.sh: terminated successfully.
[cont-init   ] 10-set-tmp-dir-perms.sh: executing...
[cont-init   ] 10-set-tmp-dir-perms.sh: terminated successfully.
[cont-init   ] 10-vnc-password.sh: executing...
[cont-init   ] 10-vnc-password.sh: creating VNC password file from environment variable...
[cont-init   ] 10-vnc-password.sh: terminated successfully.
[cont-init   ] 10-web-data.sh: executing...
[cont-init   ] 10-web-data.sh: terminated successfully.
[cont-init   ] 10-x11-unix.sh: executing...
[cont-init   ] 10-x11-unix.sh: terminated successfully.
[cont-init   ] 10-xdg-runtime-dir.sh: executing...
[cont-init   ] 10-xdg-runtime-dir.sh: terminated successfully.
[cont-init   ] 15-cjk-font.sh: executing...
[cont-init   ] 15-cjk-font.sh: CJK font already installed.
[cont-init   ] 15-cjk-font.sh: terminated successfully.
[cont-init   ] 15-install-pkgs.sh: executing...
[cont-init   ] 15-install-pkgs.sh: terminated successfully.
[cont-init   ] 55-czkawka.sh: executing...
[cont-init   ] 55-czkawka.sh: terminated successfully.
[cont-init   ] 85-take-config-ownership.sh: executing...
[cont-init   ] 85-take-config-ownership.sh: terminated successfully.
[cont-init   ] 89-info.sh: executing...
    ╭――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――╮
    │                                                                      │
    │ Application:           Czkawka                                       │
    │ Application Version:   6.1.0                                         │
    │ Docker Image Version:  23.11.2                                       │
    │ Docker Image Platform: linux/amd64                                   │
    │                                                                      │
    ╰――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――╯
[cont-init   ] 89-info.sh: terminated successfully.
[cont-init   ] all container initialization scripts executed.
[init        ] giving control to process supervisor.
[supervisor  ] loading services...
[supervisor  ] loading service 'default'...
[supervisor  ] loading service 'app'...
[supervisor  ] loading service 'gui'...
[supervisor  ] loading service 'certsmonitor'...
[supervisor  ] service 'certsmonitor' is disabled.
[supervisor  ] loading service 'nginx'...
[supervisor  ] loading service 'xvnc'...
[supervisor  ] loading service 'openbox'...
[supervisor  ] loading service 'logmonitor'...
[supervisor  ] service 'logmonitor' is disabled.
[supervisor  ] loading service 'logrotate'...
[supervisor  ] all services loaded.
[supervisor  ] starting services...
[supervisor  ] starting service 'xvnc'...
[xvnc        ] Xvnc TigerVNC 1.13.1 - built Nov 10 2023 13:43:39
[xvnc        ] Copyright (C) 1999-2022 TigerVNC Team and many others (see README.rst)
[xvnc        ] See https://www.tigervnc.org for information on TigerVNC.
[xvnc        ] Underlying X server release 12014000
[xvnc        ] Mon Feb  5 14:51:35 2024
[xvnc        ]  vncext:      VNC extension running!
[xvnc        ]  vncext:      Listening for VNC connections on /tmp/vnc.sock (mode 0660)
[xvnc        ]  vncext:      created VNC server for screen 0
[supervisor  ] starting service 'nginx'...
[nginx       ] Listening for HTTP connections on port 5800.
[supervisor  ] starting service 'openbox'...
[supervisor  ] starting service 'app'...
[app         ] 06:51:37.429 [INFO] czkawka_core::common: Czkawka version: 6.1.0, was compiled with release mode
[supervisor  ] all services started.
[app         ] 06:51:38.237 [INFO] czkawka_gui: Set thread number to 2
[app         ] (czkawka_gui:630): Gdk-WARNING **: 14:51:38.561: The program 'czkawka_gui' received an X Window System error.
[app         ] This probably reflects a bug in the program.
[app         ] The error was 'BadShmSeg (invalid shared segment parameter)'.
[app         ]   (Details: serial 1230 error_code 128 request_code 130 (MIT-SHM) minor_code 3)
[app         ]   (Note to programmers: normally, X errors are reported asynchronously;
[app         ]    that is, you will receive the error a while after causing it.
[app         ]    To debug your program, run it with the GDK_SYNCHRONIZE environment
[app         ]    variable to change this behavior. You can then get a meaningful
[app         ]    backtrace from your debugger if you break on the gdk_x_error() function.)
[supervisor  ] service 'app' exited (with status 1).
[supervisor  ] service 'app' exited, shutting down...
[supervisor  ] stopping service 'openbox'...
[supervisor  ] service 'openbox' exited (with status 0).
[supervisor  ] stopping service 'nginx'...
[supervisor  ] service 'nginx' exited (with status 0).
[supervisor  ] stopping service 'xvnc'...
[xvnc        ] Mon Feb  5 14:51:39 2024
[xvnc        ]  ComparingUpdateTracker: 0 pixels in / 0 pixels out
[xvnc        ]  ComparingUpdateTracker: (1:-nan ratio)
[supervisor  ] service 'xvnc' exited (with status 0).
[supervisor  ] sending SIGTERM to all processes...
[finish      ] executing container finish scripts...
[finish      ] all container finish scripts executed.

Container inspect

No response

Anything else?

No response

qhgary avatar Feb 05 '24 07:02 qhgary

Do you have the same crash when you execute:

docker run --rm --network host jlesage/czkawka

jlesage avatar Feb 05 '24 16:02 jlesage

Also, could you provide the output of:

docker run --rm --network host jlesage/czkawka sh -c "netstat -x|grep X11-unix"

jlesage avatar Feb 05 '24 17:02 jlesage

Do you have the same crash when you execute:

docker run --rm --network host jlesage/czkawka

yes, same crash.

qhgary avatar Feb 06 '24 04:02 qhgary

Also, could you provide the output of:

docker run --rm --network host jlesage/czkawka sh -c "netstat -x|grep X11-unix"

If the container cannot be started successfully, will the command sh -c "netstat -x|grep X11-unix" be executed.

qhgary avatar Feb 06 '24 04:02 qhgary

Yes, the command is executed in a new temporary container instance.

jlesage avatar Feb 06 '24 04:02 jlesage

Also, could you provide the output of:

docker run --rm --network host jlesage/czkawka sh -c "netstat -x|grep X11-unix"

If the container cannot be started successfully, will the command sh -c "netstat -x|grep X11-unix" be executed.

I tried your command, but there's no output(a pause, and then returned to the command prompt.). I also tried to use "docker ps -a --latest", but there was no container-id found.

If I use this: docker run --rm --network host jlesage/czkawka, there would be ouput just as similar as I submitted.

qhgary avatar Feb 06 '24 07:02 qhgary

Do you have an X server running on the host ? You can also execute a similar command on the to verify: sudo netstat -x|grep X11-unix

jlesage avatar Feb 08 '24 12:02 jlesage

Do you have an X server running on the host ? You can also execute a similar command on the to verify: sudo netstat -x|grep X11-unix

Sure, actually I'd tried the same command(sudo netstat -x|grep X11-unix) on my host at the same time when I executed it on the container. There was no X11 on my host which is a NAS (Synology 918), and the system is called DSM which is based on web rather than X11, so no output was generated.

qhgary avatar Feb 09 '24 00:02 qhgary