Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sabnzbd won't start after being stuck #6386

Closed
1 task done
depeter opened this issue Jan 10, 2025 · 4 comments
Closed
1 task done

Sabnzbd won't start after being stuck #6386

depeter opened this issue Jan 10, 2025 · 4 comments
Labels

Comments

@depeter
Copy link

depeter commented Jan 10, 2025

Is this a new Bug?

  • I checked that the bug hasn't been reported before

Package Name

SABnzbd

Package Version

4.4.1-72

Device Model

DS916+

Device Architecture

x86_64

Firmware Version

DSM 7.1.1-42962 Update 7

What happened?

I have been downloading quite a lot (1.5TB) yesterday and after a whole day of downloading, sabnzbd suddenly became unresponsive. After restarting the entire NAS I could no longer start sabnzbd.

I then tried to repair the installation but I keep getting "Failed to run the package service".

Also when opening the details of the package, none of the information is filled in except for developer and publisher. Uninstalling from the UI is therefore not possible.

Reproduction steps

  1. Open package center
  2. Install sabnzbd
  3. notice it installs but fails to start
  4. try to repair it
  5. get "Failed to run the package service" error

Install Log

2025/01/10 11:17:23     (system) trigger sabnzbd 4.4.1-72 Begin start-stop-status start
2025/01/10 11:17:45     (system) trigger sabnzbd 4.4.1-72 End start-stop-status start ret=[1]
2025/01/10 11:29:35     (system) trigger sabnzbd 4.4.1-72 Begin start-stop-status start
2025/01/10 11:30:27     (system) trigger sabnzbd 4.4.1-72 Begin start-stop-status start
2025/01/10 11:30:55     (system) trigger sabnzbd 4.4.1-72 End start-stop-status start ret=[1]
2025/01/10 11:55:02     start sabnzbd 4.4.1-72 Begin start-stop-status start
2025/01/10 11:55:23     start sabnzbd 4.4.1-72 End start-stop-status start ret=[1]
2025/01/10 11:55:24     (system) trigger sabnzbd 4.4.1-72 Begin start-stop-status stop
2025/01/10 11:55:24     (system) trigger sabnzbd 4.4.1-72 End start-stop-status stop ret=[0]
2025/01/10 11:59:01     (system) trigger sabnzbd 4.4.1-72 Begin start-stop-status start
2025/01/10 11:59:22     (system) trigger sabnzbd 4.4.1-72 End start-stop-status start ret=[1]
2025/01/10 12:12:59     start sabnzbd 4.4.1-72 Begin start-stop-status start
2025/01/10 12:13:20     start sabnzbd 4.4.1-72 End start-stop-status start ret=[1]
2025/01/10 12:13:20     (system) trigger sabnzbd 4.4.1-72 Begin start-stop-status stop
2025/01/10 12:13:20     (system) trigger sabnzbd 4.4.1-72 End start-stop-status stop ret=[0]
2025/01/10 18:32:21     start sabnzbd 4.4.1-72 Begin start-stop-status start
2025/01/10 18:32:44     start sabnzbd 4.4.1-72 End start-stop-status start ret=[1]
2025/01/10 18:32:44     (system) trigger sabnzbd 4.4.1-72 Begin start-stop-status stop
2025/01/10 18:32:44     (system) trigger sabnzbd 4.4.1-72 End start-stop-status stop ret=[0]

Service Log

Fri Jan 10 18:32:21 CET 2025
Starting sabnzbd command env LANG=en_US.UTF-8 /volume1/@appstore/sabnzbd/env/bin/python3 -OO /volume1/@appstore/sabnzbd/share/SABnzbd/SABnzbd.py -f /volume1/@appdata/sabnzbd/config.ini --pidfile /volume1/@appdata/sabnzbd/sabnzbd.pid -d
sabnzbd is not running

Other Logs

2025-01-10T12:13:20+01:00 Synology synopkgctl[29764]: pkgctl_start_stop.cpp:355 Failed to start package, pkg=[sabnzbd] context=[{"action":"start","beta":false,>2025-01-10T18:32:44+01:00 Synology synopkgctl[22284]: pkgctl_start_stop.cpp:355 Failed to start package, pkg=[sabnzbd] context=[{"action":"start","beta":false,>2

------

2025/01/10 18:32:21 start sabnzbd: begin to start version 4.4.1-72                                                                                              2025/01/10 18:32:21 Acquire usr-local-linker for sabnzbd when 0x0008 (ready)                                                                                    2025/01/10 18:32:21 Acquire usr-local-linker for sabnzbd when 0x0008 (done)                                                                                     2025/01/10 18:32:21 Acquire data-share for sabnzbd when 0x0008 (ready)                                                                                          2025/01/10 18:32:21 Acquire data-share for sabnzbd when 0x0008 (done)                                                                                           2025/01/10 18:32:21 Acquire port-config for sabnzbd when 0x0008 (ready)                                                                                         2025/01/10 18:32:21 Acquire port-config for sabnzbd when 0x0008 (done)                                                                                          2025/01/10 18:32:21 start sabnzbd 4.4.1-72 Begin start-stop-status start                                                                                        2025/01/10 18:32:44 start sabnzbd 4.4.1-72 End start-stop-status start ret=[1]                                                                                  2025/01/10 18:32:44 Release port-config for sabnzbd when 0x0008 (ready)                                                                                         2025/01/10 18:32:44 Release port-config for sabnzbd when 0x0008 (done)                                                                                          2025/01/10 18:32:44 Release usr-local-linker for sabnzbd when 0x0008 (ready)
2025/01/10 18:32:44 Release usr-local-linker for sabnzbd when 0x0008 (done)                                                                                     2025/01/10 18:32:44 start sabnzbd: start version 4.4.1-72 failed, result 0                                                                                      2025/01/10 18:32:44 (system) trigger sabnzbd 4.4.1-72 Begin start-stop-status stop                                                                              2025/01/10 18:32:44 (system) trigger sabnzbd 4.4.1-72 End start-stop-status stop ret=[0]
2025/01/10 18:32:44 Release port-config for sabnzbd when 0x0000 (ready)
2025/01/10 18:32:44 Release port-config for sabnzbd when 0x0000 (done)                                                                                          2025/01/10 18:32:44 Release usr-local-linker for sabnzbd when 0x0000 (ready)                                                                                    2025/01/10 18:32:44 Release usr-local-linker for sabnzbd when 0x0000 (done)
------

Installed python version is 3.11.10-9

------

File: /var/packages/sabnzbd/var/logs/sabnzbd.error.log

/var/packages/python311/target/lib/python3.11/warnings.py:47: RuntimeWarning: coroutine 'DirScanner.shutdown' was never awaited
  linecache = None
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/var/packages/python311/target/lib/python3.11/logging/__init__.py:1118: RuntimeWarning: coroutine 'DirScanner.shutdown' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/volume1/@appstore/sabnzbd/share/SABnzbd/sabnzbd/__init__.py:387: RuntimeWarning: coroutine 'DirScanner.shutdown' was never awaited
  pass
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/volume1/@appstore/sabnzbd/share/SABnzbd/sabnzbd/__init__.py:393: RuntimeWarning: coroutine 'DirScanner.shutdown' was never awaited
  logging.error(T("Fatal error at saving state"), exc_info=True)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Traceback (most recent call last):
  File "/volume1/@appstore/sabnzbd/share/SABnzbd/SABnzbd.py", line 1754, in <module>
    main()
  File "/volume1/@appstore/sabnzbd/share/SABnzbd/SABnzbd.py", line 1508, in main
    sabnzbd.SABSTOP_CONDITION.wait(3)
  File "/var/packages/python311/target/lib/python3.11/threading.py", line 331, in wait
    gotit = waiter.acquire(True, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/volume1/@appstore/sabnzbd/share/SABnzbd/sabnzbd/__init__.py", line 200, in sig_handler
    sabnzbd.shutdown_program()
  File "/volume1/@appstore/sabnzbd/share/SABnzbd/sabnzbd/__init__.py", line 417, in shutdown_program
    sabnzbd.halt()
  File "/volume1/@appstore/sabnzbd/share/SABnzbd/sabnzbd/decorators.py", line 46, in call_func
    lock.release()
RuntimeError: release unlocked lock
@depeter depeter added the bug label Jan 10, 2025
@mreid-tt
Copy link
Contributor

mreid-tt commented Jan 10, 2025

hey @depeter, I'm on a very similar platform (DS916+, DSM 7.2.2-72806 Update 2) but this is a new one for me. Given the strangeness with the application log (/var/packages/sabnzbd/var/logs/), I'm not sure what to recommend. Do the other logs in that folder give any other insights?

For the repair package function you mentioned, was this the repair button in the Package Center? If so, the installation log should have shown the package being reinstalled (usually) but I don't see any evidence of this in the logs you shared.

Alternately, my recommendation would be to uninstall the package and reinstall it. However, as you pointed out you are running DSM 7.1.1-42962 Update 7 which has a known bug as documented in #6337. Until Synology fixes this I don't think there is a reliable way to do this via command line (you can try to explore the conversation in #3403 which may have some insights). Finally, you can try upgrading to DSM 7.2.

@mreid-tt
Copy link
Contributor

mreid-tt commented Jan 10, 2025

hey @depeter, someone more familiar with the inner workings of sabnzbd will have to validate this but these errors are interesting:

RuntimeWarning: coroutine 'DirScanner.shutdown' was never awaited
lock.release()
RuntimeError: release unlocked lock

I wonder if this could be some sort of file locking that the app does to manage the partial downloads and decompressed files. If so, another option you could try (assuming you have nothing critical in your queue) is to temporarily move your entire downloads folder (in particular the incomplete sub-folder) to another location and try starting it up again.

The theory I have is that if it does scan for locks on startup, the locks may not be present if you move the downloads folder. There may also be files in /volume1/@appdata/sabnzbd that could contribute to this but someone with more knowledge about sabnzbd will have to speak to this. @Safihre ?

@depeter
Copy link
Author

depeter commented Jan 10, 2025

Thanks for the feedback @mreid-tt.

For the repair package function you mentioned, was this the repair button in the Package Center? If so, the installation log should have shown the package being reinstalled (usually) but I don't see any evidence of this in the logs you shared.

Yes the repair in the package center. I tried many things afterwards too which could explain the logs being filled with other things?

I already did the uninstall and reinstall several times using synopkg but to no avail. The same issue keeps happening. I am indeed also experiencing the issue that everything is empty on the package details screen: 6337.

I cleaned up the incomplete folder as you suggested. No files there anymore but still no dice after running another repair:

peter@Synology:/volume1/downloads/incomplete$ rm -rf ./*
peter@Synology:/volume1/downloads/incomplete$ ls
peter@Synology:/volume1/downloads/incomplete$ sudo systemctl status pkgctl-sabnzbd
Password:
Sorry, try again.
Password:
● pkgctl-sabnzbd.service - sabnzbd's service unit
   Loaded: loaded (/usr/local/lib/systemd/system/pkgctl-sabnzbd.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2025-01-10 20:17:07 CET; 38s ago
  Process: 24200 ExecStart=/bin/bash -c /usr/syno/sbin/synopkgctl start $SELF && /bin/touch /var/packages/$SELF/enabled (code=exited, status=1/FAILURE)
 Main PID: 24200 (code=exited, status=1/FAILURE)

Jan 10 20:17:07 Synology synopkgctl[24201]: plugin_action.c:317 synoplugin: [24201][POST][package_action][MAIN] Scripts=[synomibclient_package_action.sh]; Args=[PKGEVENT={"action":"start","available_operation":{},"beta":false,"error":{"code":272,"description":"Failed to run script, script=[start]"},"fin...true,"language":"enu","las
Jan 10 20:17:07 Synology synopkgctl[24390]: plugin_action.c:319 synoplugin: [24201][POST][package_action][synomibclient_package_action.sh][24390] ExitCode: 0
Jan 10 20:17:07 Synology synopkgctl[24390]: plugin_action.c:319 synoplugin: [24201][POST][package_action][synomibclient_package_action.sh][24390] Runtime: 0.047s
Jan 10 20:17:07 Synology synopkgctl[24201]: plugin_action.c:317 synoplugin: [24201][POST][package_action][MAIN] Runtime: 0.051s
Jan 10 20:17:07 Synology synopkgctl[24201]: pkgctl_start_stop.cpp:355 Failed to start package, pkg=[sabnzbd] context=[{"action":"start","beta":false,"error":{"code":272,"description":"Failed to run script, script=[start]"},"finished":true,"language":"enu","last_stage":"prepare_start","package":"sabnzbd"...24201,"scripts":[{"code":1
Jan 10 20:17:07 Synology systemd[1]: pkgctl-sabnzbd.service: main process exited, code=exited, status=1/FAILURE
Jan 10 20:17:07 Synology systemd[1]: Failed to start sabnzbd's service unit.
Jan 10 20:17:07 Synology systemd[1]: Unit pkgctl-sabnzbd.service entered failed state.
Jan 10 20:17:07 Synology systemd[1]: Triggering OnFailure= dependencies of pkgctl-sabnzbd.service.
Jan 10 20:17:07 Synology systemd[1]: pkgctl-sabnzbd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
peter@Synology:/volume1/downloads/incomplete$ sudo systemctl status pkgctl-sabnzbd -l
● pkgctl-sabnzbd.service - sabnzbd's service unit
   Loaded: loaded (/usr/local/lib/systemd/system/pkgctl-sabnzbd.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2025-01-10 20:17:07 CET; 46s ago
  Process: 24200 ExecStart=/bin/bash -c /usr/syno/sbin/synopkgctl start $SELF && /bin/touch /var/packages/$SELF/enabled (code=exited, status=1/FAILURE)
 Main PID: 24200 (code=exited, status=1/FAILURE)

Jan 10 20:17:07 Synology synopkgctl[24201]: plugin_action.c:317 synoplugin: [24201][POST][package_action][MAIN] Scripts=[synomibclient_package_action.sh]; Args=[PKGEVENT={"action":"start","available_operation":{},"beta":false,"error":{"code":272,"description":"Failed to run script, script=[start]"},"finished":true,"language":"enu","last_stage":"prepare_start","package":"sabnzbd","pid":24201,"scripts":[{"code":1,"message":"","type":"start"}],"stage":"start_failed","status":"start_failed","status_code":272,"status_description":"failed to start on previous startup","success":false,"timestamp":1736536627763,"username":"peter","version":"4.4.1-72"},PKGNAME=sabnzbd]
Jan 10 20:17:07 Synology synopkgctl[24390]: plugin_action.c:319 synoplugin: [24201][POST][package_action][synomibclient_package_action.sh][24390] ExitCode: 0
Jan 10 20:17:07 Synology synopkgctl[24390]: plugin_action.c:319 synoplugin: [24201][POST][package_action][synomibclient_package_action.sh][24390] Runtime: 0.047s
Jan 10 20:17:07 Synology synopkgctl[24201]: plugin_action.c:317 synoplugin: [24201][POST][package_action][MAIN] Runtime: 0.051s
Jan 10 20:17:07 Synology synopkgctl[24201]: pkgctl_start_stop.cpp:355 Failed to start package, pkg=[sabnzbd] context=[{"action":"start","beta":false,"error":{"code":272,"description":"Failed to run script, script=[start]"},"finished":true,"language":"enu","last_stage":"prepare_start","package":"sabnzbd","pid":24201,"scripts":[{"code":1,"message":"","type":"start"}],"stage":"start_failed","status":"start_failed","status_code":272,"status_description":"failed to start on previous startup","success":false,"username":"peter","version":"4.4.1-72"}]
Jan 10 20:17:07 Synology systemd[1]: pkgctl-sabnzbd.service: main process exited, code=exited, status=1/FAILURE
Jan 10 20:17:07 Synology systemd[1]: Failed to start sabnzbd's service unit.
Jan 10 20:17:07 Synology systemd[1]: Unit pkgctl-sabnzbd.service entered failed state.
Jan 10 20:17:07 Synology systemd[1]: Triggering OnFailure= dependencies of pkgctl-sabnzbd.service.
Jan 10 20:17:07 Synology systemd[1]: pkgctl-sabnzbd.service failed.

After uninstalling and then installing again through the Package Center the result is unfortunately the same

peter@Synology:/volume1/downloads/incomplete$ sudo synopkg stop sabnzbd
{"action":"prepare","error":{"code":0},"stage":"prepare","success":true}
peter@Synology:/volume1/downloads/incomplete$ sudo synopkg uninstall sabnzbd
{"action":"prepare","error":{"code":0},"stage":"prepare","success":true}
peter@Synology:/volume1/downloads/incomplete$ sudo synopkg status sabnzbd
{"aspect":{"active":{"status":"stop","status_description":"retrieve from systemd failed status"},"error":{"broken_by":"install_corruption","status":"broken","status_code":150,"status_description":"failed to complete installation"},"working":{"installing_target":{"beta":false},"status":"installing"}},"description":"Status: [150], package is stopped","package":"sabnzbd","status":"installing"}
peter@Synology:/volume1/downloads/incomplete$ sudo synopkg status sabnzbd
{"aspect":{"active":{"status":"starting","status_description":"translate from systemd status"},"working":{"installing_target":{"beta":false},"status":"installing"}},"description":"Status: [0], package is stopped","package":"sabnzbd","status":"installing"}
peter@Synology:/volume1/downloads/incomplete$ sudo synopkg status sabnzbd
{"aspect":{"active":{"status":"stop","status_description":"retrieve from systemd failed status"},"error":{"status":"start_failed","status_code":272,"status_description":"failed to start on previous startup"}},"description":"Status: [272], package is stopped","package":"sabnzbd","status":"start_failed"}
peter@Synology:/volume1/downloads/incomplete$ sudo synopkg status sabnzbd
{"aspect":{"active":{"status":"stop","status_description":"retrieve from systemd failed status"},"error":{"status":"start_failed","status_code":272,"status_description":"failed to start on previous startup"}},"description":"Status: [272], package is stopped","package":"sabnzbd","status":"start_failed"}
peter@Synology:/volume1/downloads/incomplete$

I'l try updating to DSM 7.2 now

@depeter
Copy link
Author

depeter commented Jan 10, 2025

Ok, so uninstalling through the package center. Thereby deleting all files (so I have to set it up again).
Then installing sabnzbd again from scratch solved it.

Thanks for the suggestion @mreid-tt.

Must have been a stuck lock file or a corrupt config file or what have you... I'm just glad it's solved.

@depeter depeter closed this as completed Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants