Problem shutting down Sonarr

**Sonarr version 2.0.0.4230:
**Mono version: 4.2.3 (Stable 4.2.3.4/832de4b Wed Mar 16 13:19:08 UTC 2016)
OS: Ubuntu Linux 16.04 64-bit

Description of issue: When shutting down my computer for the night for the night, I shutdown all of my running applications first. For Sonarr, I select System/Shutdown. When I select Shutdown, Sonarr immediately tries to update the storage status. If I select Shutdown before Sonarr finishes gathering the information, I get an Ubuntu error message “Sorry, Ubuntu 16.04 has experienced an internal error” panel. Clicking on the Show Details button shows the details of the /opt/NzbDrone/NzbDrone crash. If I wait until Sonarr completes the status display, THEN select Shutdown, Sonarr will shutdown normally. The only problem is that it may take a full minute or more to get the info, and I get impatient.

((Debug logs)) from Sonarr and standard output/error logs from the mono process (redirect to a file) would be helpful.

I’ll work on the logs. Quickly, do you know where the mono logs go?

Wayne

Standard output and error aren’t logged by default to my knowledge.

Attached (hopefully) is the debug log from Sonarr. It looks to me like all of the error messages are a failure to connect to nzbget. Shutdown starts at 11:42:10.1

http://pastebin.com/raw/7mhMkAK2

Moved the logs to pastebin, more readable and don’t require massive amounts of scrolling to read the rest of the thread…

Is that because NZBget was already shutdown? (there are minutes worth of errors though).

I don’t see any shutdown requests in the logs (which is logged at Info).

I see two requests later for the diskspace (within the same second):

16-8-24 11:49:08.0|Debug|Api|[GET] /api/diskspace: 200.OK (18131 ms)
16-8-24 11:49:08.0|Debug|Api|[GET] /api/diskspace: 200.OK (18155 ms)

They took 18 seconds, which is quite slow, which could be slow from having to look up the available drives and get the space for them.

When I am shutting down, I will click the Sonarr tab in FireFox, then System>Shutdown in the Sonarr application. At that moment, nzbget is still running. The next thing I do is close the Sonarr tab in Firefox, and that will almost always result in the nzbget tab being displayed. Then in the nzbget application I click Settings>System>Shutdown>Shutdown. So between the time I click on the Sonarr shutdown button until I click on the last Shutdown button in nzbget is around 4-5 seconds.

As for not seeing a shutdown request in Sonarr, all I can say is “Why not???” :grin:.

And regarding taking 18 seconds, that seems like a long time to me. If I wait long enough, and that can be a looooong time, One of two things will happen. One - the resultant display will show status of four filesystems. 3 of them on /dev/sda and one (/home) on /dev /sdb. The second thing that might happen is I never get a display.

Are your logs always filled with those NZBGet errors? If so it sounds like something else is causing issues because connection refused is coming from something other than Sonarr.

18 seconds to get the disk space is a long time to wait for simple disk space check on a couple disks, for me one Windows that takes under 200ms for 5 disks.

How long is a looooooong time? a few minutes?

Yes, the nzbget errors are only there when Sonarr fails to shutdown properly.

I checked this morning and it took ~20 seconds to get the status display.

However - I think there is indeed something else going on here. Last night I started to time it too, and after over 5 minutes, still no display. To make matters worse, about the only thing that seemed to be working in Sonarr were the icons across the top of the page (Series, Calendar, etc.), but nothing “beneath” those icons. If I clicked on Calendar, for example, I would get a display of the calendar but there was no data filled in. Just a blank calendar. If I clicked on Series, I would get a list of all of the tv shows, but if I clicked on any of them I never got a display. To get Sonarr to shutdown, I had to use the system monitor and “End” the Mono process. But that is not all. To get Sonarr running properly again, I could not just launch it again, but I had to restart FireFox first. So there is something going on somewhere between Sonarr, Mono, and/or Firefox. My guess is that since Sonarr is the only application I have that uses Mono, that I should be looking there. I am also running SABnzbd+, Sickbeard, CouchPotatoServer, and nzbget as different tabs on the same Firefox window, and using a couple more tabs for other browser functions. None of them ever have any issues like this. Just for reference, I am running FireFox 48.0.

I’d start with a mono upgrade, 4.4.2 is currently available. If you still experience issues I’d suggest a downgrade to 3.10, it has been one of the more stable releases.

I have upgraded Mono to version 4.4.2 (Stable 4.4.2.11/f72fe45 Fri Jul 29 09:58:49 UTC 2016), so I’ll see how this goes. Initially, the disk space status took just over 20 seconds, but in hind sight Sonarr was still starting up. Later, it took MUCH less time, like maybe 1 second.

1 Like

I have played around with this some more and the time it takes to display disk status is still up around the 20 second mark. I guess the one second times was just redisplaying existing data. As for the shutdown problem, I don’t think anything has changed with one notable exception. When doing the Sonarr shutdown before the status is updated, I don’t get the Ubuntu crash panel anymore. But the Mono process is still running like before.

Each request fetches the data on it’s own, nothing is cached and reused.

Does it exit on its own after waiting ~20 seconds?

No, it does not. I have given it several minutes and it does not exit. To make matters worse, I have also noticed that if the Mono process does not exit, Ubuntu itself will not do a clean shutdown either. It gets to the point where it displays the last purple screen with the word Ubuntu on it, and hangs there. It doesn’t matter if I “end” or “kill” the Mono process before shutting down, Ubuntu will not shutdown cleanly. It doesn’t seem to hurt anything as I have not had any problems I have seen when rebooting at a later time.

But, on a more positive note, since I wrote my last response I have not had any more problems shutting down Sonarr as long as I wait the 20-25 seconds for the disk status to complete. And as long as Sonarr shuts down, so does Mono, and Ubuntu will shutdown cleanly tool.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.