Page 1 of 1

Replacing 4.2.0RC1 with RC2 lost my Windows service

Posted: December 15th, 2023, 4:58 pm
by Taomyn
I updated my 4.2.0RC1 folder with the RC2 files and everything seemed to be fine for a few hours. Now when I went to check on things the site was no longer loaded. I checked on the server and the Windows service has vanished - no idea why and can't find anything logged. So I tried to recreate it using the website instructions and I get this:

Code: Select all

D:\Program Files\SABnzbd>SABnzbd-console.exe -f "D:\Program Files\SABnzbd\sabnzbd.ini" install
Installing service SABnzbd
Traceback (most recent call last):
  File "SABnzbd.py", line 1742, in <module>
  File "SABnzbd.py", line 1714, in handle_windows_service
  File "win32serviceutil.py", line 841, in HandleCommandLine
  File "win32serviceutil.py", line 224, in InstallService
  File "win32serviceutil.py", line 56, in LocatePythonServiceExe
RuntimeError: Can't find 'D:\Program Files\SABnzbd\pythonservice.exe'
[10596] Failed to execute script 'SABnzbd' due to unhandled exception!
Any ideas? I cannot find pythonservice.exe anywhere, not even in the downloaded ZIP for RC2.

Re: Replacing 4.2.0RC1 with RC2 lost my Windows service

Posted: December 15th, 2023, 5:27 pm
by Taomyn
I continued digging and discovered the main executable changed from SABnzbd.exe to SABnzbd-console.exe between RC1 and RC2 - not sure how it continued to work before, but the older file must have been deleted by SABnzbd itself which I can only assume then tried to recover/reset the service and in the process deleted it.

Fortunately the old registry entry for the service was in ControlSet002, so I exported it, used the "sc" command to create a basic service and then restored the old service registry after changing it to use CurrentControlSet. Afterwards, I renamed the executable in the registry to match the new name and started it up. So for the moment everything is running again.