SynoCommunity / spksrc

Cross compilation framework to create native packages for the Synology's NAS
https://synocommunity.com
Other
3.01k stars 1.23k forks source link

Updated to DSM7, fresh install of Sabnzbd and Sonarr, installation completes then automatically asks to repair the package, fails to repair with error "Failed to run the package service" #4892

Closed murthybruit closed 1 year ago

murthybruit commented 2 years ago

Hi,

Forgive me if I'm duplicating or not following protocol, I've never used GitHub before, I've just joined as I'm having exactly the same issue that a user posted at the very end of a thread that was then locked as resolved. I've clicked on create new issue from that post in the hope that it lands in the right place

I can't find any other reference to precisely the issue I'm having, and I'm not a programmer, but I'm facing an issue trying to reinstall this package following an issue with my NAS reinstalling DSM7 after a power failure occured that was longer than my UPS could handle, in the middle of a RAID rebuild

It was previously installed and working, after a previous repair process when it first upgraded from DSM6 - 7

Any suggestions would be greatly appreciated!

Just completed update to DSM7 and trying to do fresh install of Sabnzbd, after installation is completed it automatically ask me to repair the package, fails to repair and then i get this message.

Screen Shot 2021-09-15 at 8 32 40 am Screen Shot 2021-09-15 at 8 36 58 am

Originally posted by @italeet in https://github.com/SynoCommunity/spksrc/issues/4748#issuecomment-919558911

BenjV commented 2 years ago

Repairing of third party package is always a bad idea!!!!!

Nobody (except Synology) knows what that repairing is trying to do, but it almost always fails and thereafter the package won't start and cannot be upgraded anymore.

The only thing left is to remove SABnzbd and thereafter do a fresh install.

murthybruit commented 2 years ago

That's interesting, as most of my packages repaired successfully after the initial upgrade to DSM7, except Couchpotato and Headphones, but since SAB and Sonarr succeeded, I switched to Radarr and Lidarr, and by the end of last week, the whole thing was singing, until the power outage nobbled the RAID rebuild

I was actually about to flatten the volume this morning, as Synology support concluded that the data Storage Manager was reporting was ghost data, but whilst looking at file permissions in an effort to triage SABnzbd I discovered that they'd all been screwed up, and in fact, I haven't lost my 11TB of Plex libraries!

SABnzbd was a fresh install this morning, it went straight in to the need for a Repair before reporting this issue, so I did an uninstall and told it to delete all data to the point of being unrecoverable, in case there was a legacy config file causing the issue, but re-installing just takes me back the need for Repair with the same outcome

murthybruit commented 2 years ago

I've just installed Somarr and had exactly the same behaviour :(

BenjV commented 2 years ago

A fresh install while the old SABnzbd is still there will do an upgrade and then you get this repair question. A remove and fresh install is the only option after a failed repair.

I don't know what "all of my packages" means, but most non-Synology packages won't survive a repair. And plex libraries have nothing to do with packages, that is data on a share which will always survive everything.

murthybruit commented 2 years ago

So I've just installed Radarr and Lidarr without issue, have uninstalled SABnzbd and Sonarr and told it to remove all data (again), and tried reinstalling from the package center, same issue. Have downloaded the latest installer for SAB for DSM7 and my architecture, tried a manual install and got the error "The operation failed, please sign in to DSM again and retry", logging out and back in makes no difference

"all of my packages" that successfully repaired after the initial DSM update included SABnzbd, Sonarr, ResilioSync, and Python. I know the Plex libraries have nothing to do with Synology Packages, I was just adding some background to what I'm experiencing

BenjV commented 2 years ago

Look in the log why the installation failed.

/var/log/packages/sabnzbd.log

murthybruit commented 2 years ago

2021/09/30 14:53:07 rm: cannot remove '/volume1/@appdata/sabnzbd/logs/sabnzbd.log.1': Permission denied 2021/09/30 14:53:07 rm: cannot remove '/volume1/@appdata/sabnzbd/scripts/CharTranslator.py': Permission denied 2021/09/30 14:53:07 rm: cannot remove '/volume1/@appdata/sabnzbd/scripts/SabToSyno.py': Permission denied 2021/09/30 14:53:07 uninstall sabnzbd 3.3.1-49 End postuninst ret=[0]

Something else I've tried to do as well as the issue mentioned before in respect to the libraries is leading me to believe that my permissions have gone screwy

murthybruit commented 2 years ago

-DS920:/var/log/packages# tail -n 100 sabnzbd.log 2021/09/30 10:16:00 install sabnzbd 3.3.1-49 Begin /bin/mv -f /volume1/@tmp /pkginstall/extract.ChMk02/package /volume1/@appstore/sabnzbd 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 End /bin/mv -f /volume1/@tmp/p kginstall/extract.ChMk02/package /volume1/@appstore/sabnzbd ret=[0] 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 Begin /bin/rm -rf /var/package s/sabnzbd 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 End /bin/rm -rf /var/packages/ sabnzbd ret=[0] 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 Begin /bin/mkdir -p /var/packa ges/sabnzbd 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 End /bin/mkdir -p /var/package s/sabnzbd ret=[0] 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 Begin /bin/touch /var/packages /sabnzbd/installing 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 End /bin/touch /var/packages/s abnzbd/installing ret=[0] 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 Begin /bin/mv -f /volume1/@tmp /pkginstall/extract.ChMk02/INFO /var/packages/sabnzbd/INFO 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 End /bin/mv -f /volume1/@tmp/p kginstall/extract.ChMk02/INFO /var/packages/sabnzbd/INFO ret=[0] 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 Begin /bin/rm -rf /var/package s/sabnzbd/scripts 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 End /bin/rm -rf /var/packages/ sabnzbd/scripts ret=[0] 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 Begin /bin/mv -f /volume1/@tmp /pkginstall/extract.ChMk02/scripts /var/packages/sabnzbd/scripts 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 End /bin/mv -f /volume1/@tmp/p kginstall/extract.ChMk02/scripts /var/packages/sabnzbd/scripts ret=[0] 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 Begin /bin/rm -rf /var/package s/sabnzbd/WIZARD_UIFILES 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 End /bin/rm -rf /var/packages/ sabnzbd/WIZARD_UIFILES ret=[0] 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 Begin /bin/mv -f /volume1/@tmp /pkginstall/extract.ChMk02/WIZARD_UIFILES /var/packages/sabnzbd/WIZARD_UIFILES 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 End /bin/mv -f /volume1/@tmp/p kginstall/extract.ChMk02/WIZARD_UIFILES /var/packages/sabnzbd/WIZARD_UIFILES re t=[0] 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 Begin /bin/rm -rf /var/package s/sabnzbd/conf 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 End /bin/rm -rf /var/packages/ sabnzbd/conf ret=[0] 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 Begin /bin/mv -f /volume1/@tmp /pkginstall/extract.ChMk02/conf /var/packages/sabnzbd/conf 2021/09/30 10:16:01 install sabnzbd 3.3.1-49 End /bin/mv -f /volume1/@tmp/p kginstall/extract.ChMk02/conf /var/packages/sabnzbd/conf ret=[0] 2021/09/30 10:16:02 install sabnzbd 3.3.1-49 Begin postinst 2021/09/30 10:16:02 ===> Step postinst. USER=sc-sabnzbd GROUP= SHARE_PATH=/ volume1/downloads

murthybruit commented 2 years ago

2021/09/30 10:16:08 Processing /volume1/@appstore/sabnzbd/share/wheelhouse/ six-1.16.0-py2.py3-none-any.whl 2021/09/30 10:16:08 Processing /volume1/@appstore/sabnzbd/share/wheelhouse/ tempora-4.0.2-py3-none-any.whl 2021/09/30 10:16:08 Processing /volume1/@appstore/sabnzbd/share/wheelhouse/ zc.lockfile-2.0-py2.py3-none-any.whl 2021/09/30 10:16:08 Installing collected packages: zc.lockfile, tempora, si x, sgmllib3k, sabyenc3, pytz, portend, more-itertools, jaraco.text, jaraco.func tools, jaraco.collections, jaraco.classes, feedparser, configobj, CherryPy, che root, Cheetah3, chardet 2021/09/30 10:16:08 Attempting uninstall: six 2021/09/30 10:16:08 Found existing installation: six 1.16.0 2021/09/30 10:16:08 Not uninstalling six at /volume1/@appstore/python38 /lib/python3.8/site-packages, outside environment /volume1/@appstore/sabnzbd/en v 2021/09/30 10:16:08 Can't uninstall 'six'. No files were found to unins tall. 2021/09/30 10:16:11 Successfully installed Cheetah3-3.2.6 CherryPy-18.6.0 c hardet-4.0.0 cheroot-8.5.2 configobj-5.0.6 feedparser-6.0.6 jaraco.classes-3.2. 1 jaraco.collections-3.3.0 jaraco.functools-3.3.0 jaraco.text-3.5.0 more-iterto ols-8.8.0 portend-2.7.1 pytz-2021.1 sabyenc3-4.0.2 sgmllib3k-1.0.0 six-1.16.0 t empora-4.0.2 zc.lockfile-2.0 2021/09/30 10:16:11 sed: can't read /volume1/@appdata/sabnzbd/config.ini: N o such file or directory 2021/09/30 10:16:11 sed: can't read /volume1/@appdata/sabnzbd/config.ini: N o such file or directory 2021/09/30 10:16:11 sed: can't read /volume1/@appdata/sabnzbd/config.ini: N o such file or directory 2021/09/30 10:16:11 End service_postinst

BenjV commented 2 years ago

It think I found the problem, the repair creates the folder /volume1/@appdata/sabnzbd because under DSM 6 that folder was not used and was also not created. The problem is that this folder after the repair is owned by root and the package cannot use it at all (a stupid Synology fault).

You can try to fix the as follow. First uninstall SABnzbd Then login to the commandline and remove /volume1/@appdata/sabnzbd with this command:

sudo rm -r /volume1/@appdata/sabnzbd

To be sure you can do that also with the application location but I don't that should be necessary but is cannot hurt.

sudo rm -r /volume1/@appstore/sabnzbd

Now you can try to install SABnzbd fresh and that should fix the problem. And don't ever use repair again on non Synology packages.

@hgy59 Maybe we should in the preinstall phase test if the @appdata folder for a package already exists and if so test if the package has permissions there. If not, write a message to ${SYNOPKG_TEMP_LOGFILE} which will be shown in a popup.

hgy59 commented 2 years ago

@hgy59 Maybe we should in the preinstall phase test if the @appdata folder for a package already exists and if so test if the package has permissions there. If not, write a message to ${SYNOPKG_TEMP_LOGFILE} which will be shown in a popup.

@BenjV thanks for staying tuned on this. I think @th0ma7 working on #4797 or @publicarray have engough experiance to adjust the installation process. Unfortunately I will be more or less offline for the next few weeks

BenjV commented 2 years ago

No problem, I just wanted to share my findings about the Synology "repair" mystery.

th0ma7 commented 2 years ago

@BenjV I just completed the testing to use the default tmp directory for target/var when "upgrading". I've tested things in multiple ways and it looks like working out well for all the use-cases I tried. We should be better covered than previously with this code change (at least in theory, can't wait to see in practice).

On that note feel free to test package using my branch to see if it behave correctly.

Now I wonder what's going on with the repair:

  1. does it actually "move" the target/var/ files over to target/../var/ (hence /volume/@appdata/<package>)?
  2. does it invoke the package setup script for install or upgrade?
  3. where you able to see any activity from the /var/log/package/<package>.log when hitting repair?

Because if the permissions is wrongly set for @appdata there isn't much we can do as we can't play with permissions anymore on DSM7. And any subsequent upgrade will leave the package into an unknown state for its var directory ownership...

I'll try to find some time re-setup a DSM6 using the kvmx64 VM on my DS-918+ and upgrade to DSM7 and see if I can find more details about what this actually do... Feel free to share any additional finding you make on your end!

murthybruit commented 2 years ago

@BenjV that has completey resolved the issue with SABnzdb, thank you SO much, it is now installed and running.

I still have the same issue with Sonarr however, so I applied your suggestion to looking for the log file under /var/log/packages but none exists for this package, nor does /volume1/@appdata/sonarr (lidarr and radarr both do, in both folders?

Any thoughts? Thanks again for your wisdom, you coding guys are on another level!

BenjV commented 2 years ago

Sonar is internally called nzbdrone and not Sonarr (historical reasons). So you have to remove that folder with:

sudo rm -r /volume1/@appstore/nzbdrone

murthybruit commented 2 years ago

@BenjV you are a LEGEND!

Thank you :)

BenjV commented 2 years ago

@th0ma7 Repair does not move anything as far as I can see and does not invoke any script at all. During the upgrade from DSM 6 to DSM 7 for all installed packages a @appdata/package folder is created with root as owner Installing or upgrading a package will change the ownership of the @appdata/package from root to the package user (or create if it is a new package).

For some packages (like git) it changes the os_min version in the INFO file and nothing more and the @appstore/package folder will still be owned by root. So repairing a package after the DSM upgrade will only work if the @appstore/package folder is not used.

I think removing the @appdata/package folder in the uninstall phase should be added to all package of the SynoCommunity, else they will be left there forever. Also the @appconfig/package folder could be removed although at the moment no package is using it.

Chocka commented 2 years ago

Sonar is internally called nzbdrone and not Sonarr (historical reasons). So you have to remove that folder with:

sudo rm -r /volume1/@appstore/nzbdrone

DS213J [armada370]

Update went well, accept for Sonarr. Very pleased to find a solution to solve this last part of upgrading to DSM7.

Followed the above comments. Deleted Sonarr and removed "/volume1/@appstore/nzbdrone" After reboot manually installed latest version "nzbdrone.v19.f40000.spk"

But still get "Failed to run the package service"

Any suggestions would be greatly appreciated!

BenjV commented 2 years ago

Not without any information from your log files, but try to read this: https://github.com/SynoCommunity/spksrc/wiki/Radarr-Sonarr-Lidarr-Jackett#rtd1296-armv8-devices-and-mono

Chocka commented 2 years ago

Start to try downgrade mono without uninstalling, modify went well, but as soon I manual install mono.v11.f15047, get an error "invalid file format"

hgy59 commented 2 years ago

Start to try downgrade mono without uninstalling, modify went well, but as soon I manual install mono.v11.f15047, get an error "invalid file format"

You cannot downgrade mono on DSM 7. Only v17 (Version 5.20.1.34-17) is built for DSM 7. DSM 6.1 versions will show error "invalid file format".

Chocka commented 2 years ago

Started a new install, but still get "Failed to run the package service"

Copied log

2021/11/23 20:08:51 install nzbdrone 20210717-19 Begin preinst 2021/11/23 20:08:51 ===> Step preinst. USER=sc-nzbdrone GROUP=sc-download SHARE_PATH= 2021/11/23 20:08:51 install nzbdrone 20210717-19 End preinst ret=[0] 2021/11/23 20:08:51 install nzbdrone 20210717-19 Begin /bin/mkdir -p /volume1/@appstore/nzbdrone 2021/11/23 20:08:51 install nzbdrone 20210717-19 End /bin/mkdir -p /volume1/@appstore/nzbdrone ret=[0] 2021/11/23 20:08:51 install nzbdrone 20210717-19 Begin /bin/rm -rf /volume1/@appstore/nzbdrone 2021/11/23 20:08:51 install nzbdrone 20210717-19 End /bin/rm -rf /volume1/@appstore/nzbdrone ret=[0] 2021/11/23 20:08:51 install nzbdrone 20210717-19 Begin /bin/mv -f /volume1/@tmp/pkginstall/extract.3N453m/package /volume1/@appstore/nzbdrone 2021/11/23 20:08:51 install nzbdrone 20210717-19 End /bin/mv -f /volume1/@tmp/pkginstall/extract.3N453m/package /volume1/@appstore/nzbdrone ret=[0] 2021/11/23 20:08:51 install nzbdrone 20210717-19 Begin /bin/rm -rf /var/packages/nzbdrone 2021/11/23 20:08:51 install nzbdrone 20210717-19 End /bin/rm -rf /var/packages/nzbdrone ret=[0] 2021/11/23 20:08:51 install nzbdrone 20210717-19 Begin /bin/mkdir -p /var/packages/nzbdrone 2021/11/23 20:08:51 install nzbdrone 20210717-19 End /bin/mkdir -p /var/packages/nzbdrone ret=[0] 2021/11/23 20:08:51 install nzbdrone 20210717-19 Begin /bin/touch /var/packages/nzbdrone/installing 2021/11/23 20:08:51 install nzbdrone 20210717-19 End /bin/touch /var/packages/nzbdrone/installing ret=[0] 2021/11/23 20:08:51 install nzbdrone 20210717-19 Begin /bin/mv -f /volume1/@tmp/pkginstall/extract.3N453m/INFO /var/packages/nzbdrone/INFO 2021/11/23 20:08:51 install nzbdrone 20210717-19 End /bin/mv -f /volume1/@tmp/pkginstall/extract.3N453m/INFO /var/packages/nzbdrone/INFO ret=[0] 2021/11/23 20:08:51 install nzbdrone 20210717-19 Begin /bin/rm -rf /var/packages/nzbdrone/scripts 2021/11/23 20:08:51 install nzbdrone 20210717-19 End /bin/rm -rf /var/packages/nzbdrone/scripts ret=[0] 2021/11/23 20:08:51 install nzbdrone 20210717-19 Begin /bin/mv -f /volume1/@tmp/pkginstall/extract.3N453m/scripts /var/packages/nzbdrone/scripts 2021/11/23 20:08:51 install nzbdrone 20210717-19 End /bin/mv -f /volume1/@tmp/pkginstall/extract.3N453m/scripts /var/packages/nzbdrone/scripts ret=[0] 2021/11/23 20:08:51 install nzbdrone 20210717-19 Begin /bin/rm -rf /var/packages/nzbdrone/WIZARD_UIFILES 2021/11/23 20:08:51 install nzbdrone 20210717-19 End /bin/rm -rf /var/packages/nzbdrone/WIZARD_UIFILES ret=[0] 2021/11/23 20:08:51 install nzbdrone 20210717-19 Begin /bin/mv -f /volume1/@tmp/pkginstall/extract.3N453m/WIZARD_UIFILES /var/packages/nzbdrone/WIZARD_UIFILES 2021/11/23 20:08:51 install nzbdrone 20210717-19 End /bin/mv -f /volume1/@tmp/pkginstall/extract.3N453m/WIZARD_UIFILES /var/packages/nzbdrone/WIZARD_UIFILES ret=[0] 2021/11/23 20:08:51 install nzbdrone 20210717-19 Begin /bin/rm -rf /var/packages/nzbdrone/conf 2021/11/23 20:08:51 install nzbdrone 20210717-19 End /bin/rm -rf /var/packages/nzbdrone/conf ret=[0] 2021/11/23 20:08:51 install nzbdrone 20210717-19 Begin /bin/mv -f /volume1/@tmp/pkginstall/extract.3N453m/conf /var/packages/nzbdrone/conf 2021/11/23 20:08:51 install nzbdrone 20210717-19 End /bin/mv -f /volume1/@tmp/pkginstall/extract.3N453m/conf /var/packages/nzbdrone/conf ret=[0] 2021/11/23 20:08:57 install nzbdrone 20210717-19 Begin postinst 2021/11/23 20:08:57 ===> Step postinst. USER=sc-nzbdrone GROUP=sc-download SHARE_PATH= 2021/11/23 20:08:57 Begin service_postinst 2021/11/23 20:08:57 Notice: set_unix_permissions() is no longer required on DSM7. 2021/11/23 20:08:57 End service_postinst 2021/11/23 20:08:57 install nzbdrone 20210717-19 End postinst ret=[0] 2021/11/23 20:08:58 install nzbdrone 20210717-19 Begin start-stop-status start 2021/11/23 20:09:18 install nzbdrone 20210717-19 End start-stop-status start ret=[1] 2021/11/23 20:09:23 (system) trigger nzbdrone 20210717-19 Begin start-stop-status stop 2021/11/23 20:09:23 (system) trigger nzbdrone 20210717-19 End start-stop-status stop ret=[0]

DerFireWal commented 2 years ago

Got a similar issue as @Chocka. I'm also still using my trusty DS213j for the Sonarr, Radarr and SABnzbd combination and made the wrong choice to update to DSM7.

SABnzbd is running without any issues after simply removing and installing it again via the Package Center.

Removing Sonarr and Radarr via the Package Center will in my case also remove the corresponding folders under /volume1/@appstore. I've als manually removed all related folders under /volume1/@appconf, /volume1/@appdata, /volume1/@apphome, /volume1/@appstore and /volume1/@apptemp.

Sonarr/nzbdrone simply fails to start and I can't find any reason. The mono.log is not giving any insight.

admin@DS213j:/var/log/packages$ sudo synopkg start nzbdrone {"action":"prepare","error":{"code":272,"description":"Failed to run script, script=start]"},"stage":"prepare","success":false}

admin@DS213j:/var/log/packages$ tail nzbdrone.log 2021/12/10 07:23:42 start nzbdrone 20210717-19 Begin start-stop-status start 2021/12/10 07:24:03 start nzbdrone 20210717-19 End start-stop-status start ret=[1] 2021/12/10 07:24:06 (system) trigger nzbdrone 20210717-19 Begin start-stop-status stop 2021/12/10 07:24:06 (system) trigger nzbdrone 20210717-19 End start-stop-status stop ret=[0]

Radarr is failing with a core dump.

admin@DS213j:/var/log/packages$ sudo synopkg start radarr {"action":"prepare","error":{"code":272,"description":"Failed to run script, script=[start]"},"stage":"prepare","success":false}

admin@DS213j:/var/log/packages$ tail radarr.log 2021/12/10 07:31:29 start radarr 20210708-15 Begin start-stop-status start /var/packages/radarr/scripts/start-stop-status: line 118: 15027 Illegal instruction (core dumped) ${SERVICE_COMMAND} >> ${OUT} 2>&1 2021/12/10 07:31:49 start radarr 20210708-15 End start-stop-status start ret=[1] 2021/12/10 07:31:52 (system) trigger radarr 20210708-15 Begin start-stop-status stop 2021/12/10 07:31:52 (system) trigger radarr 20210708-15 End start-stop-status stop ret=[0]

Anything I can do to support further troubleshooting / testing?

publicarray commented 2 years ago

Radarr is failing with a core dump.

DS213j - armada370 - armv7 you would need to get the mono version as the .net is causing problems for you. Unfortunately I don't think we have a mono version compiled for DSM7 yet. https://github.com/SynoCommunity/spksrc/wiki/Radarr-Sonarr-Lidarr-Jackett

DerFireWal commented 2 years ago

@publicarray That also explains, why mono is longer listed as dependent packages for Radarr - thanks for giving the hint. https://github.com/SynoCommunity/spksrc/wiki/Radarr-Sonarr-Lidarr-Jackett doesn't seem to list any steps I could take for armv7 - docker is definitely out of question on that old hardware ;-) Maybe is finally time to say goodbye to the armv7 based boxes.

hgy59 commented 2 years ago

We (only) have Mono 5.20.1.34-17 for DSM 7 https://synocommunity.com/package/mono

DerFireWal commented 2 years ago

Mono 5.20.1.34-17 is already installed on my DS213j and as mentioned above, the mono.log is not giving (me) any insight on why Sonarr / nzbdrone is failing to start. @hgy59 Are there additional places where to look for clues?

hgy59 commented 2 years ago

On DSM 7 the installer log is /var/log/packages/sabnzbd.log and some errors may appear in /var/log/messages.

The sabnzb logs are in /var/packages/sabnzbd/var/sabnzbd.log and /var/packages/sabnzbd/var/sabnzbd.error.log

EDIT: oops, you asked for sonarr (nzbdrone): use nzbdone instead of sabnzbd above (except the *.error.log)

Chocka commented 2 years ago

/var/packages/nzbdrone/var/nzbdrone.log

Sat Dec 11 20:17:49 CET 2021 Starting nzbdrone command env PATH=/var/packages/mono/target/bin:/volume1/@appstore/nzbdrone/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin HOME=/volume1/@appdata/nzbdrone LD_LIBRARY_PATH=/volume1/@appstore/nzbdrone/lib /var/packages/mono/target/bin/mono /volume1/@appstore/nzbdrone/share/Sonarr/Sonarr.exe [Info] Bootstrap: Starting Sonarr - /volume1/@appstore/nzbdrone/share/Sonarr/Sonarr.exe - Version 3.0.5.1144 nzbdrone is not running

/var/log/messages

2021-12-11T20:18:09+01:00 DS213 synocgid[1418]: SYSTEM: Last message 'session/timeout.cpp:' repeated 9 times, suppressed by syslog-ng on DS213 2021-12-11T20:18:09+01:00 DS213 synopkgctl[29442]: pkgctl_start_stop.cpp:354 Failed to start package, pkg=[nzbdrone] context=[{"action":"install","beta":false,"betaIncoming":false,"error":{"code":272,"description":"Failed to run script, script=[start]"},"finished":false,"installReboot":false,"installing":true,"language":"nld","last_stage":"prepare_start","package":"nzbdrone","packageName":"Sonarr","pid":29442,"scripts":[{"code":0,"message":"","type":"preinst"},{"code":0,"message":"","type":"postinst"},{"code":1,"message":"","type":"start"}],"spk":"/volume2/@tmp/upload_tmp.289900","stage":"start_failed","status":"installing","success":false,"username":"admin"}] 2021-12-11T20:19:24+01:00 DS213 notification_utils[30662]: notification_utils.cpp:816 notification level is empty (tag: net_lanport_exceed_maxlanport) 2021-12-11T20:19:40+01:00 DS213 notification_utils[31085]: notification_utils.cpp:816 notification level is empty (tag: net_lanport_exceed_maxlanport) 2021-12-11T20:19:45+01:00 DS213 notification_utils[31302]: notification_utils.cpp:816 notification level is empty (tag: net_lanport_exceed_maxlanport) 2021-12-11T20:20:11+01:00 DS213 notification_utils[31824]: notification_utils.cpp:816 notification level is empty (tag: net_lanport_exceed_maxlanport)

/var/log/packages/nzbdrone.log

2021/12/11 20:17:43 install nzbdrone 20210717-19 Begin preinst 2021/12/11 20:17:43 ===> Step preinst. USER=sc-nzbdrone GROUP=sc-download SHARE_PATH= 2021/12/11 20:17:44 install nzbdrone 20210717-19 End preinst ret=[0] 2021/12/11 20:17:44 install nzbdrone 20210717-19 Begin /bin/mkdir -p /volume1/@appstore/nzbdrone 2021/12/11 20:17:44 install nzbdrone 20210717-19 End /bin/mkdir -p /volume1/@appstore/nzbdrone ret=[0] 2021/12/11 20:17:44 install nzbdrone 20210717-19 Begin /bin/rm -rf /volume1/@appstore/nzbdrone 2021/12/11 20:17:44 install nzbdrone 20210717-19 End /bin/rm -rf /volume1/@appstore/nzbdrone ret=[0] 2021/12/11 20:17:44 install nzbdrone 20210717-19 Begin /bin/mv -f /volume1/@tmp/pkginstall/extract.Dldv3A/package /volume1/@appstore/nzbdrone 2021/12/11 20:17:44 install nzbdrone 20210717-19 End /bin/mv -f /volume1/@tmp/pkginstall/extract.Dldv3A/package /volume1/@appstore/nzbdrone ret=[0] 2021/12/11 20:17:44 install nzbdrone 20210717-19 Begin /bin/rm -rf /var/packages/nzbdrone 2021/12/11 20:17:44 install nzbdrone 20210717-19 End /bin/rm -rf /var/packages/nzbdrone ret=[0] 2021/12/11 20:17:44 install nzbdrone 20210717-19 Begin /bin/mkdir -p /var/packages/nzbdrone 2021/12/11 20:17:44 install nzbdrone 20210717-19 End /bin/mkdir -p /var/packages/nzbdrone ret=[0] 2021/12/11 20:17:44 install nzbdrone 20210717-19 Begin /bin/touch /var/packages/nzbdrone/installing 2021/12/11 20:17:44 install nzbdrone 20210717-19 End /bin/touch /var/packages/nzbdrone/installing ret=[0] 2021/12/11 20:17:44 install nzbdrone 20210717-19 Begin /bin/mv -f /volume1/@tmp/pkginstall/extract.Dldv3A/INFO /var/packages/nzbdrone/INFO 2021/12/11 20:17:44 install nzbdrone 20210717-19 End /bin/mv -f /volume1/@tmp/pkginstall/extract.Dldv3A/INFO /var/packages/nzbdrone/INFO ret=[0] 2021/12/11 20:17:44 install nzbdrone 20210717-19 Begin /bin/rm -rf /var/packages/nzbdrone/scripts 2021/12/11 20:17:44 install nzbdrone 20210717-19 End /bin/rm -rf /var/packages/nzbdrone/scripts ret=[0] 2021/12/11 20:17:44 install nzbdrone 20210717-19 Begin /bin/mv -f /volume1/@tmp/pkginstall/extract.Dldv3A/scripts /var/packages/nzbdrone/scripts 2021/12/11 20:17:44 install nzbdrone 20210717-19 End /bin/mv -f /volume1/@tmp/pkginstall/extract.Dldv3A/scripts /var/packages/nzbdrone/scripts ret=[0] 2021/12/11 20:17:44 install nzbdrone 20210717-19 Begin /bin/rm -rf /var/packages/nzbdrone/WIZARD_UIFILES 2021/12/11 20:17:44 install nzbdrone 20210717-19 End /bin/rm -rf /var/packages/nzbdrone/WIZARD_UIFILES ret=[0] 2021/12/11 20:17:44 install nzbdrone 20210717-19 Begin /bin/mv -f /volume1/@tmp/pkginstall/extract.Dldv3A/WIZARD_UIFILES /var/packages/nzbdrone/WIZARD_UIFILES 2021/12/11 20:17:44 install nzbdrone 20210717-19 End /bin/mv -f /volume1/@tmp/pkginstall/extract.Dldv3A/WIZARD_UIFILES /var/packages/nzbdrone/WIZARD_UIFILES ret=[0] 2021/12/11 20:17:44 install nzbdrone 20210717-19 Begin /bin/rm -rf /var/packages/nzbdrone/conf 2021/12/11 20:17:44 install nzbdrone 20210717-19 End /bin/rm -rf /var/packages/nzbdrone/conf ret=[0] 2021/12/11 20:17:44 install nzbdrone 20210717-19 Begin /bin/mv -f /volume1/@tmp/pkginstall/extract.Dldv3A/conf /var/packages/nzbdrone/conf 2021/12/11 20:17:44 install nzbdrone 20210717-19 End /bin/mv -f /volume1/@tmp/pkginstall/extract.Dldv3A/conf /var/packages/nzbdrone/conf ret=[0] 2021/12/11 20:17:48 install nzbdrone 20210717-19 Begin postinst 2021/12/11 20:17:48 ===> Step postinst. USER=sc-nzbdrone GROUP=sc-download SHARE_PATH= 2021/12/11 20:17:48 Begin service_postinst 2021/12/11 20:17:48 Notice: set_unix_permissions() is no longer required on DSM7. 2021/12/11 20:17:48 End service_postinst 2021/12/11 20:17:48 install nzbdrone 20210717-19 End postinst ret=[0] 2021/12/11 20:17:49 install nzbdrone 20210717-19 Begin start-stop-status start 2021/12/11 20:18:09 install nzbdrone 20210717-19 End start-stop-status start ret=[1] 2021/12/11 20:18:12 (system) trigger nzbdrone 20210717-19 Begin start-stop-status stop 2021/12/11 20:18:13 (system) trigger nzbdrone 20210717-19 End start-stop-status stop ret=[0]

hgy59 commented 2 years ago

from /var/log/messages I read that the start command/script failed (exit 1).

2021-12-11T20:18:09+01:00 DS213 synopkgctl[29442]: 
pkgctl_start_stop.cpp:354 
Failed to start package, pkg=[nzbdrone] 
context=
[{
    "action": "install",
    "beta": false,
    "betaIncoming": false,
    "error": {
      "code": 272,
      "description": "Failed to run script, script=[start]"
    },
    "finished": false,
    "installReboot": false,
    "installing": true,
    "language": "nld",
    "last_stage": "prepare_start",
    "package": "nzbdrone",
    "packageName": "Sonarr",
    "pid": 29442,
    "scripts": [{
        "code": 0,
        "message": "",
        "type": "preinst"
      }, {
        "code": 0,
        "message": "",
        "type": "postinst"
      }, {
        "code": 1,
        "message": "",
        "type": "start"
      }
    ],
    "spk": "/volume2/@tmp/upload_tmp.289900",
    "stage": "start_failed",
    "status": "installing",
    "success": false,
    "username": "admin"
  }
]

similar info comes from /var/log/packages/nzbdrone.log:

2021/12/11 20:18:09 install nzbdrone 20210717-19 End start-stop-status start ret=[1]

For further analysis you could try to run the start command in the terminal to see more output...

PATH=/var/packages/mono/target/bin:/volume1/@appstore/nzbdrone/bin:${PATH} HOME=/volume1/@appdata/nzbdrone LD_LIBRARY_PATH=/volume1/@appstore/nzbdrone/lib /var/packages/mono/target/bin/mono /volume1/@appstore/nzbdrone/share/Sonarr/Sonarr.exe

I suppose that the error nzbdrone is not running appears as the pid file is not created at startup.

hgy59 commented 2 years ago

@Chocka I have installed sonarr now on my DS115j (armv7) under DSM 6 (I have only one Diskstation with DSM 7, but it is x64, so sonarr runs with dotnet instead of mono).

I got a similar error as in DSM 7. But I have a pid file /var/packages/nzbdrone/target/var/.config/Sonarr/sonarr.pid and a mono process is listening on port 8989:

# netstat -tulpn  | grep mono
tcp        0      0 0.0.0.0:8989            0.0.0.0:*               LISTEN      22637/mono

With http://<ip-of-my-diskstation>:8989 I get the sonarr web page. This looks like a problem with the start-stop-status script that does not find the pid file so it pretends that the service does not run.

Can you validate, whether this is the same on DSM 7?

BenjV commented 2 years ago

If it is a problem with the pidfile, maybe maybe it should be added to the command line which starts nzbdrone. Something like this adding to the SERVICE_COMMAND variable in the services-setup script:

--pidfile $PID_FILE

Chocka commented 2 years ago
PATH=/var/packages/mono/target/bin:/volume1/@appstore/nzbdrone/bin:${PATH} HOME=/volume1/@appdata/nzbdrone LD_LIBRARY_PATH=/volume1/@appstore/nzbdrone/lib /var/packages/mono/target/bin/mono /volume1/@appstore/nzbdrone/share/Sonarr/Sonarr.exe

I suppose that the error nzbdrone is not running appears as the pid file is not created at startup.

I run it, and this is what I get:

[Info] Bootstrap: Starting Sonarr - /volume1/@appstore/nzbdrone/share/Sonarr/Sonarr.exe - Version 3.0.5.1144 [Trace] DiskProviderBase: Directory '/volume1/@appdata/nzbdrone/.config/Sonarr' isn't writable. Access to the path "/volume1/@appdata/nzbdrone/.config/Sonarr/sonarr_write_test.txt" is denied.

[Fatal] ConsoleApp: EPIC FAIL!

[v3.0.5.1144] NzbDrone.Common.Exceptions.SonarrStartupException: Sonarr failed to start: AppFolder /volume1/@appdata/nzbdrone/.config/Sonarr is not writable at NzbDrone.Common.EnvironmentInfo.AppFolderFactory.Register () [0x00081] in <838290d41cb7431fbc4fa8070d0b0648>:0 at NzbDrone.Host.Bootstrap.Start (NzbDrone.Common.EnvironmentInfo.StartupContext startupContext, NzbDrone.Host.IUserAlert userAlert, System.Action`1[T] startCallback) [0x00064] in <8a5f101a5342479bad56b0f3fcfd4d64>:0 at NzbDrone.Console.ConsoleApp.Main (System.String[] args) [0x00036] in :0

Press enter to exit...

Chocka commented 2 years ago

I got a similar error as in DSM 7. But I have a pid file /var/packages/nzbdrone/target/var/.config/Sonarr/sonarr.pid and a mono process is listening on port 8989:

I have been looking for what you said but I have no /var/.config/Sonarr/sonarr.pid in /var/packages/nzbdrone/target/

In /var/packages/nzbdrone/target/ I only the folders app; bin; lib and share

May be the pid file is somewhere else, but not there

BenjV commented 2 years ago

Maybe you are experiencing problems with leftover permissions from a pre DSM 7 installation. Try to correct the permissions from the commandline. Login as a user with admin privileges and give this commands:

sudo chown -R sc-nzbdrone:sc-nzbdrone /var/packages/nzbdrone/target/ sudo chown -R sc-nzbdrone:sc-nzbdrone /var/packages/nzbdrone/var/

Chocka commented 2 years ago

Maybe you are experiencing problems with leftover permissions from a pre DSM 7 installation. Try to correct the permissions from the commandline. Login as a user with admin privileges and give this commands:

sudo chown -R sc-nzbdrone:sc-nzbdrone /var/packages/sabnzbd/target/ sudo chown -R sc-nzbdrone:sc-nzbdrone /var/packages/sabnzbd/var/

I dont use sabnzbd. So I think these sudo wont work for me?

BenjV commented 2 years ago

Sorry typo, I corrected the commands in my post.

Chocka commented 2 years ago

Did as you mentioned and tried to start Sonarr, but still the same "cant start service"

Chocka commented 2 years ago

With http://<ip-of-my-diskstation>:8989 I get the sonarr web page. This looks like a problem with the start-stop-status script that does not find the pid file so it pretends that the service does not run.

Is there a way to create or add that pid file?

BenjV commented 2 years ago

The start-stop-status script is looking in the correct location, unless you installed the wrong Sonarr version. The pidfile is created by Sonarr the moment it starts and should be found here:

/var/packages/nzbdrone/var/.config/Sonarr/sonarr.pid

And I installed Sonarr on my test Nas (DS116) with DSM 7 and it installed and runs fine.

Chocka commented 2 years ago

The start-stop-status script is looking in the correct location, unless you installed the wrong Sonarr version. The pidfile is created by Sonarr the moment it starts and should be found here:

/var/packages/nzbdrone/var/.config/Sonarr/sonarr.pid

And I installed Sonarr on my test Nas (DS116) with DSM 7 and it installed and runs fine.

OK just complete uninstall Sonarr. Rebooted, and install Sonarr from the package center. After install I get info that "start Sonarr has failed"

afbeelding

BenjV commented 2 years ago

Waarschijnlijk wil deze mono versie niet draaien op jouw Nas (te oud). Als je even terug kijkt heb ik daar al een link over gegeven.

Je zou ook kunnen overwegen over te stappen op medusa, die kun je hier vinden. Die kun je hier vinden: https://github.com/BenjV/SYNO-packages

Chocka commented 2 years ago

Seems Mono works fine

afbeelding

Chocka commented 2 years ago

Waarschijnlijk heb wil deze mono versie niet draaien op jouw Nas (te oud). Als je even terug kijkt heb ik daar al een link over gegeven.

Je zou ook kunnen overwegen over te stappen op medusa, die kun je hier vinden. Die kun je hier vinden: https://github.com/BenjV/SYNO-packages

So if the 213J is to old, than it will be time a buy a new. I think a 920+ will do ok, and than can I start using Sonarr with Docker ;-)

mreid-tt commented 1 year ago

Hi there! It looks like this issue has been open for some time without any recent updates. Since then, a new version of SABnzbd (v3.7.2-60) has been released which may have resolved this issue. Can you please test with the latest version and let us know if the issue persists? If we don't hear back from you in a few days, we'll assume the issue has been resolved and close this ticket. Thank you!

murthybruit commented 1 year ago

Hi, yes, sorry..... this issue is resolved

Thanks, Martyn

On Wed, 5 Apr 2023 at 13:55, Michael Reid @.***> wrote:

Hi there! It looks like this issue has been open for some time without any recent updates. Since then, a new version of SABnzbd (v3.7.2-60) has been released which may have resolved this issue. Can you please test with the latest version and let us know if the issue persists? If we don't hear back from you in a few days, we'll assume the issue has been resolved and close this ticket. Thank you!

— Reply to this email directly, view it on GitHub https://github.com/SynoCommunity/spksrc/issues/4892#issuecomment-1497440031, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV3K4K5EUPSUDTUVRYLYC3DW7VTUXANCNFSM5FB34ZDA . You are receiving this because you authored the thread.Message ID: @.***>

mreid-tt commented 1 year ago

Thanks for the feedback. The issue will now be closed.