linuxserver / docker-pyload-ng

GNU General Public License v3.0
83 stars 10 forks source link

[BUG] Restarting pyLoad via the webinterface causes infinite loop #55

Closed Sab44 closed 3 months ago

Sab44 commented 3 months ago

Is there an existing issue for this?

Current Behavior

When restarting pyLoad via the web interface on the "Settings" tab (clicking the "Restart pyLoad" button), the docker logs get spammed with

pyload-ng  | pyLoad already running with pid xxx
pyload-ng  | Connection to localhost (127.0.0.1) 8000 port [tcp/*] succeeded!
pyload-ng  | pyLoad already running with pid xxx
pyload-ng  | Connection to localhost (127.0.0.1) 8000 port [tcp/*] succeeded!
pyload-ng  | pyLoad already running with pid xxx
pyload-ng  | Connection to localhost (127.0.0.1) 8000 port [tcp/*] succeeded!

Note: not talking about the pyLoad log visible on the web UI in the Logs tab, but the logs inside the docker container as observed by Dockge. There is also a slight but noticeable increase in CPU load observable.

It seems, there's some kind of watchdog that implicitly restarts pyLoad if it exits. If I click on the "Quit pyLoad" button, it is also restarted straight away (although without the log spam). So if I click "Restart pyLoad" it is presumably either

Expected Behavior

Restarting pyLoad via the web interface should not cause this loop and spam in the logs.

Steps To Reproduce

  1. docker compose up with pyload-ng:latest
  2. restart pyLoad on Settings tab in web interface
  3. observe docker logs (e.g. in Dockge)

Environment

- OS: Debian 12
- How docker service was installed: according to official docker documentation

CPU architecture

x86-64

Docker creation

services:
  pyload-ng:
    image: lscr.io/linuxserver/pyload-ng:latest
    container_name: pyload-ng
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
    volumes:
      - /root/pyload:/config
      - /mnt/downloads:/downloads
    ports:
      - 8000:8000 # Webinterface
      - 9666:9666 # Click 'N' Load
    restart: unless-stopped
networks: {}

Container logs

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

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

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

To support the app dev(s) visit:
pyLoad: https://PayPal.Me/nitzo2001/0usd

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

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

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

cp: not replacing '/config/settings/pyload.cfg'
[custom-init] No custom files found, skipping...
[2024-08-22 12:02:42]  INFO                pyload  *** Welcome to pyLoad 0.5.0 ***
[2024-08-22 12:02:42]  WARNING             pyload  Download folder was specified from the commandline
[2024-08-22 12:02:42]  INFO                pyload  ADDON ExternalScripts: Activated scripts in folder `package_extracted`: webhook.sh
[2024-08-22 12:02:42]  INFO                pyload  Activated addons: ClickNLoad, ExternalScripts, ExtractArchive, UnSkipOnFail, UserAgentSwitcher
[2024-08-22 12:02:42]  INFO                pyload  Deactivate addons: AndroidPhoneNotify, AntiCaptcha, AntiStandby, AntiVirus, AppriseNotify, BypassCaptcha, Captcha9Kw, Checksum, CloudFlareDdos, DeathByCaptcha, DeleteFinished, DiscordNotifier, DownloadScheduler, ExpertDecoders, HotFolder, IRC, ImageTyperz, JustPremium, LinkFilter, LogMarker, MergeFiles, MultiHome, PushBullet, PushOver, RestartFailed, SkipRev, TORRENT, TransmissionRPC, UpdateManager, WindowsPhoneNotify, XFileSharing, XMPP
[2024-08-22 12:02:42]  INFO                pyload  User directory: /config
[2024-08-22 12:02:42]  INFO                pyload  Cache directory: /tmp/pyLoad
[2024-08-22 12:02:42]  INFO                pyload  Storage directory: /downloads
[2024-08-22 12:02:42]  INFO                pyload  Storage free space: 3.07 TiB
[2024-08-22 12:02:42]  INFO                pyload  Activating accounts...
[2024-08-22 12:02:42]  INFO                pyload  ACCOUNT DdownloadCom: Adding user `big*******`...
[2024-08-22 12:02:42]  INFO                pyload  ACCOUNT DdownloadCom: Login user `big****`...
[2024-08-22 12:02:42]  INFO                pyload  ACCOUNT DdownloadCom: Checking for link errors...
[2024-08-22 12:02:42]  INFO                pyload  ACCOUNT DdownloadCom: No errors found
[2024-08-22 12:02:42]  INFO                pyload  ACCOUNT DdownloadCom: Grabbing account info for user `big****`...
[2024-08-22 12:02:42]  INFO                pyload  Activating plugins...
[2024-08-22 12:02:42]  INFO          pyload.webui  Starting webserver: http://0.0.0.0:8000
Connection to localhost (127.0.0.1) 8000 port [tcp/*] succeeded!
[ls.io-init] done.
[2024-08-22 12:02:47]  INFO                pyload  ADDON ClickNLoad: Proxy listening on 0.0.0.0:9666
[2024-08-22 12:03:02]  INFO                pyload  pyLoad is restarting...
[2024-08-22 12:03:02]  INFO                pyload  ADDON ClickNLoad: Shutting down proxy...
[2024-08-22 12:03:02]  INFO                pyload  Exiting core...
[2024-08-22 12:03:03]  INFO                pyload  *** Welcome to pyLoad 0.5.0 ***
[2024-08-22 12:03:03]  WARNING             pyload  Download folder was specified from the commandline
pyLoad already running with pid 207
[2024-08-22 12:03:03]  INFO                pyload  ADDON ExternalScripts: Activated scripts in folder `package_extracted`: webhook.sh
[2024-08-22 12:03:03]  INFO                pyload  Activated addons: ClickNLoad, ExternalScripts, ExtractArchive, UnSkipOnFail, UserAgentSwitcher
[2024-08-22 12:03:03]  INFO                pyload  Deactivate addons: AndroidPhoneNotify, AntiCaptcha, AntiStandby, AntiVirus, AppriseNotify, BypassCaptcha, Captcha9Kw, Checksum, CloudFlareDdos, DeathByCaptcha, DeleteFinished, DiscordNotifier, DownloadScheduler, ExpertDecoders, HotFolder, IRC, ImageTyperz, JustPremium, LinkFilter, LogMarker, MergeFiles, MultiHome, PushBullet, PushOver, RestartFailed, SkipRev, TORRENT, TransmissionRPC, UpdateManager, WindowsPhoneNotify, XFileSharing, XMPP
[2024-08-22 12:03:03]  INFO                pyload  User directory: /config
[2024-08-22 12:03:03]  INFO                pyload  Cache directory: /tmp/pyLoad
[2024-08-22 12:03:03]  INFO                pyload  Storage directory: /downloads
[2024-08-22 12:03:03]  INFO                pyload  Storage free space: 3.07 TiB
[2024-08-22 12:03:03]  INFO                pyload  Activating accounts...
[2024-08-22 12:03:03]  INFO                pyload  ACCOUNT DdownloadCom: Adding user `big*******`...
[2024-08-22 12:03:03]  INFO                pyload  ACCOUNT DdownloadCom: Login user `big****`...
[2024-08-22 12:03:03]  INFO                pyload  ACCOUNT DdownloadCom: Checking for link errors...
[2024-08-22 12:03:03]  INFO                pyload  ACCOUNT DdownloadCom: No errors found
[2024-08-22 12:03:03]  INFO                pyload  ACCOUNT DdownloadCom: Grabbing account info for user `big****`...
[2024-08-22 12:03:03]  INFO                pyload  Activating plugins...
[2024-08-22 12:03:03]  INFO          pyload.webui  Starting webserver: http://0.0.0.0:8000
Connection to localhost (127.0.0.1) 8000 port [tcp/*] succeeded!
pyLoad already running with pid 207
Connection to localhost (127.0.0.1) 8000 port [tcp/*] succeeded!
pyLoad already running with pid 207
Connection to localhost (127.0.0.1) 8000 port [tcp/*] succeeded!
pyLoad already running with pid 207
Connection to localhost (127.0.0.1) 8000 port [tcp/*] succeeded!
pyLoad already running with pid 207
Connection to localhost (127.0.0.1) 8000 port [tcp/*] succeeded!
pyLoad already running with pid 207
[2024-08-22 12:03:08]  INFO                pyload  ADDON ClickNLoad: Proxy listening on 0.0.0.0:9666
Connection to localhost (127.0.0.1) 8000 port [tcp/*] succeeded!
pyLoad already running with pid 207
Connection to localhost (127.0.0.1) 8000 port [tcp/*] succeeded!
pyLoad already running with pid 207
Connection to localhost (127.0.0.1) 8000 port [tcp/*] succeeded!
pyLoad already running with pid 207
Connection to localhost (127.0.0.1) 8000 port [tcp/*] succeeded!
pyLoad already running with pid 207
Connection to localhost (127.0.0.1) 8000 port [tcp/*] succeeded!
github-actions[bot] commented 3 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.

aptalca commented 3 months ago

Our container uses s6 as the supervisor, which is what you're seeing restart the service when it stops.

We don't recommend using app commands to stop or restart processes inside the container because the app does not know how it is started and often leads to issues you're observing. And we have no control over how the app tries to restart itself.

To restart, you should restart the container.

Sab44 commented 3 months ago

I see, thanks for the explanation. It is unfortunate that it can lead to this behaviour, but I understand. Going to close the issue then.