Page 1 of 1

[0.7.12] Service dies when machine reboots

Posted: June 3rd, 2013, 10:38 am
by Taomyn
I run SABnzbd as a service on my Windows server, but I've noticed with the last few releases that when I reboot the machine I'm alerted that the service crashed during shutdown (I use LogMeIn to monitor various aspects with the SABnzbd service being one of them, so I know if it crashes during normal operation).

The System event log shows me this during the shutdown phase:

Code: Select all

Message: 	

The SABnzbd Binary Newsreader service terminated unexpectedly.  It has done this 1 time(s).
According to the sabnzbdlog the shutdown is being caught:

Code: Select all

2013-06-03 17:17:05,914::WARNING::[__init__:169] Signal 6 caught, saving and exiting...
2013-06-03 17:17:05,914::INFO::[nzbqueue:211] Saving queue
2013-06-03 17:17:05,914::INFO::[__init__:904] Saving data for queue9.sab in D:\Program Files\SABnzbd\admin\queue9.sab
2013-06-03 17:17:05,917::INFO::[__init__:904] Saving data for totals9.sab in D:\Program Files\SABnzbd\admin\totals9.sab
2013-06-03 17:17:05,918::INFO::[__init__:904] Saving data for rss_data.sab in D:\Program Files\SABnzbd\admin\rss_data.sab
2013-06-03 17:17:05,920::INFO::[__init__:904] Saving data for bookmarks.sab in D:\Program Files\SABnzbd\admin\bookmarks.sab
2013-06-03 17:17:05,921::INFO::[__init__:904] Saving data for watched_data.sab in D:\Program Files\SABnzbd\admin\watched_data.sab
2013-06-03 17:17:05,923::INFO::[postproc:84] Saving postproc queue
2013-06-03 17:17:05,924::INFO::[__init__:904] Saving data for postproc1.sab in D:\Program Files\SABnzbd\admin\postproc1.sab
2013-06-03 17:20:38,380::INFO::[sabnzbd:1256] --------------------------------
2013-06-03 17:20:38,403::INFO::[sabnzbd:1257] SABnzbd-service.exe-0.7.12 (rev=ca9f10c12fb3dada0c50b7e6aa3f08e091a003d3)
2013-06-03 17:20:38,459::INFO::[sabnzbd:1265] Platform=Windows-Vista-6.2.9200 (=Vista+ x64) Class=nt
2013-06-03 17:20:38,459::INFO::[sabnzbd:1270] Python-version = 2.5.5 (r255:77872, Jan 31 2010, 15:49:35) [MSC v.1310 32 bit (Intel)]
2013-06-03 17:20:38,460::INFO::[sabnzbd:1271] Arguments = 
2013-06-03 17:20:38,460::INFO::[sabnzbd:1284] Read INI file D:\Program Files\SABnzbd\sabnzbd.ini
2013-06-03 17:20:38,581::INFO::[__init__:928] Loading data for bookmarks.sab from D:\Program Files\SABnzbd\admin\bookmarks.sab
2013-06-03 17:20:38,594::INFO::[__init__:928] Loading data for rss_data.sab from D:\Program Files\SABnzbd\admin\rss_data.sab
2013-06-03 17:20:38,604::INFO::[__init__:928] Loading data for totals9.sab from D:\Program Files\SABnzbd\admin\totals9.sab
2013-06-03 17:20:38,624::INFO::[postproc:90] Loading postproc queue
2013-06-03 17:20:38,624::INFO::[__init__:928] Loading data for postproc1.sab from D:\Program Files\SABnzbd\admin\postproc1.sab
2013-06-03 17:20:38,635::INFO::[__init__:928] Loading data for queue9.sab from D:\Program Files\SABnzbd\admin\queue9.sab
2013-06-03 17:20:38,661::INFO::[__init__:928] Loading data for watched_data.sab from D:\Program Files\SABnzbd\admin\watched_data.sab
2013-06-03 17:20:38,696::INFO::[scheduler:172] Setting schedule for midnight BPS reset
2013-06-03 17:20:38,696::INFO::[downloader:211] Resuming
2013-06-03 17:20:38,696::INFO::[__init__:330] All processes started
2013-06-03 17:20:38,697::INFO::[sabnzbd:334] Web dir is D:\Program Files\SABnzbd\interfaces\Plush
2013-06-03 17:20:38,801::INFO::[sabnzbd:334] Web dir is D:\Program Files\SABnzbd\interfaces\Mobile
2013-06-03 17:20:38,811::INFO::[sabnzbd:334] Web dir is D:\Program Files\SABnzbd\interfaces\Config
2013-06-03 17:20:39,000::INFO::[sabnzbd:463] _yenc module... found!
2013-06-03 17:20:39,000::INFO::[sabnzbd:471] par2 binary... found (D:\Program Files\SABnzbd\win\par2\x64\par2.exe)
2013-06-03 17:20:39,000::INFO::[sabnzbd:476] par2-classic binary... found (D:\Program Files\SABnzbd\win\par2\par2-classic.exe)
2013-06-03 17:20:39,000::INFO::[sabnzbd:479] unrar binary... found (D:\Program Files\SABnzbd\win\unrar\x64\UnRAR.exe)
2013-06-03 17:20:39,000::INFO::[sabnzbd:484] unzip binary... found (D:\Program Files\SABnzbd\win\unzip\unzip.exe)
2013-06-03 17:20:39,000::INFO::[sabnzbd:499] pyOpenSSL... found (True)
2013-06-03 17:20:39,003::INFO::[sabnzbd:1483] Starting web-interface on 0.0.0.0:8080
2013-06-03 17:20:41,006::INFO::[_cplogging:55] [03/Jun/2013:17:20:41] ENGINE Bus STARTING
2013-06-03 17:20:41,105::INFO::[_cplogging:55] [03/Jun/2013:17:20:41] ENGINE Started monitor thread '_TimeoutMonitor'.
2013-06-03 17:20:41,308::INFO::[_cplogging:55] [03/Jun/2013:17:20:41] ENGINE Serving on ::1:8080
2013-06-03 17:20:41,510::INFO::[_cplogging:55] [03/Jun/2013:17:20:41] ENGINE Serving on 0.0.0.0:8080
2013-06-03 17:20:41,512::INFO::[_cplogging:55] [03/Jun/2013:17:20:41] ENGINE Bus STARTED
2013-06-03 17:20:41,845::INFO::[sabnzbd:1539] Connected to the SABHelper service
2013-06-03 17:20:41,845::INFO::[sabnzbd:1552] Starting SABnzbd-service.exe-0.7.12
2013-06-03 17:20:41,848::INFO::[dirscanner:274] Dirscanner starting up
2013-06-03 17:20:41,849::INFO::[urlgrabber:77] URLGrabber starting up
Any ideas?

Re: [0.7.12] Service dies when machine reboots

Posted: June 3rd, 2013, 12:11 pm
by shypike
Windows tells SABnzbd to shutdown and it does.
Nothing special in the logging.
Maybe check the Windows Application logging?

Re: [0.7.12] Service dies when machine reboots

Posted: June 4th, 2013, 9:19 am
by Taomyn
shypike wrote:Maybe check the Windows Application logging?
Nothing there unfortunately - is it possible that the service is returning a non-zero return code when closing down therefore making Windows think it has crashed? I accidentally did this with a compiled AutoIT script I created that I also used as a service.

Re: [0.7.12] Service dies when machine reboots

Posted: June 4th, 2013, 2:03 pm
by shypike
Are you using the "Automatic (delayed)" startup method in Services?
Works for me.

Re: [0.7.12] Service dies when machine reboots

Posted: June 4th, 2013, 3:44 pm
by Taomyn
shypike wrote:Are you using the "Automatic (delayed)" startup method in Services?
Works for me.
Nope, but I changed (in fact I had it this way on my old machine to help the load during startup) and it's still the same - it's happening during the shutdown not the start-up.

Re: [0.7.12] Service dies when machine reboots

Posted: June 5th, 2013, 3:48 am
by shypike
The service code hasn't changed in long time, and as far as I can tell there's no non-zero exit.
At least not when there isn't an error situation.
Are dependencies still defined? SABnzbd Service depends on TCP/IP, Eventlog and SABnzbd Helper.
Does the service start when you use "net start sabnzbd" ?
Maybe a fix is to use a scheduled task to start the service?

Re: [0.7.12] Service dies when machine reboots

Posted: June 5th, 2013, 4:01 am
by Taomyn
Yes, all 3 dependencies are there.

There's nothing wrong with the start-up, that's working just fine fortunately. Both when the machine starts or if I use "net start". FYI - a manual "net stop" works ok.

It's only during a shutdown that I get alerted that the service terminated unexpectedly.

Re: [0.7.12] Service dies when machine reboots

Posted: June 5th, 2013, 8:55 am
by shypike
Taomyn wrote: It's only during a shutdown that I get alerted that the service terminated unexpectedly.
OK, must have misread your message a bit.
But again, I cannot find anything in the logging of my system, also not for a shutdown.
Does your system shutdown in the middle of post-processing or downloading?
In those cases SABnznd's shutdown may take a very long time and possibly Windows doesn't like that.
Currently post-processing cannot be aborted elegantly.

Re: [0.7.12] Service dies when machine reboots

Posted: May 8th, 2015, 4:38 pm
by Zango
I realize that this is a super old thread, but I'm have the EXACT problem on system reboot or shutdown.

The SABnzbd Binary Newsreader service terminated unexpectedly.

Anyone ever figure out how to fix this?


Thanks!

Re: [0.7.12] Service dies when machine reboots

Posted: May 9th, 2015, 4:51 am
by shypike
There's no fix.
When SABnzbd is tied up in a long operation (like running par2 or unrar)
it gets terminated by the OS when it's shutdown time.
Most of the time, nothing bad will happen.

Re: [0.7.12] Service dies when machine reboots

Posted: May 13th, 2015, 5:52 am
by Zango
Yes I totally understand, but I get that event log error on every single shutdown or reboot, Even when I haven't used or touched sab in over 24 hours.

So there is definitely no downloading , no post-processing or anything going on.

Re: [0.7.12] Service dies when machine reboots

Posted: May 14th, 2015, 12:20 pm
by shypike
Can you see how the logging of SABnzbd ends at shutdown time?
Please enable debug logging first.