Scheduled Tasks not running

Hey all,

Sonarr version: 2.0.03154
OS: Windows 8.1

So I’ve got Sonarr setup to send an alert to my phone when it starts a download and another when it completes. At completion, I also have it alerting my HTPC software so that it doesn’t have to wait until the next ‘scan’ interval. The last few days, it hasn’t sending me any completion alerts, hasn’t been clearing completed downloads from my sabNZBd and hasn’t been renaming the files and placing them in the TV Series folder.

The logs don’t seem to indicate any issues at all, but I’ve just changed them from ‘info’ level logging to ‘debug’ level. When I look at the tasks page (System > Tasks) it says that ‘Check For Finished Download’ should run every 1 minute, but last execution was 2 days ago. Next execution is ‘Now’ but it never seems to run. I tried to manually trigger this task, but it hasn’t done anything in about 15 minutes and the 2 arrows have just kept spinning. The logs are also still not showing anything related to this - unfortunately I cleared the logs before thinking about posting here. All other tasks appear to have been run within the set interval time.

The only way I’ve managed to get Sonarr to do it’s post-processing (rename, move to correct folder, delete temp folder) is to use the ‘Manual Import’ option in the ‘Wanted’ setting.
Any idea how to get this automated again?

Update: after several restarts, it seems to be working again. Still unsure of the cause of the issue though.

Version: 2.0.0.3154
OS: Centos 6.6 64-bit
Mono version 3.12.1 pulled via yum from tpokorra

I started having this issue after the latest update. I posted this issue on Reddit and one of the sonarr devs said they are trying to figure out the issue. Other people replied to my post about having this issue but I can’t find a post in these forums about it.

I have to restart Sonarr about once a day to make sure that it looks for finished downloads.

@ron30 @dgcurtis

If/when you see it happen again please zip up the database and PM me a link to download it (dropbox/google drive/etc). Also please enable trace logging and send those over as well, so we can take a look at them.

We’ll need the copy of the DB from before Sonarr is restarted.

I’ve just turned on trace logging. I’ll see if it happens tonight but I only have one show queued up since most of mine have finsihed their seasons. I’ll zip it up if it happens.

Thanks!

I’ve started having the same issue on windows 7, it’s no longer post processing, I have to manually do them

We need logs and a copy of the DB.

Yeah, I’ve just set trace logging and have that for you the next time it doesn’t do them, unfortunately I’ve nothing coming in my calendar for a week. I’ve uploaded my existing debug logs to Dropbox and will pm you the link now

As I said, mine seems to be working now and it has continued to work. PogMoThoin or dgcurtis, if the issue is occurring for you currently, perhaps delete the last episode you downloaded of any show, and have it re-download it for you. That should produce the required log files.

Thanks @PogMoThoin unfortunately I didn’t see anything in the DB, looks like it was cleaned up before you saw it (older than 24 hours).

Could use another copy of the DB and trace logs. Also it would be helpful if there are any errors in the logs (check the log table) with Error occurred while executing task in the text (should be at the start) or any error coming from CommandExecutor.

Ok, I’ve got a few episodes that have downloaded and sonarr hasn’t picked up on. I am zipping up the logs. I checked for errors and there are a lot of these:

15-6-2 00:51:31.3|Trace|Owin|SQLite error (5): database is locked

but some of these may be interesting too:

15-6-2 00:39:31.7|Trace|Owin|SQLite error (517): statement aborts at 28: [UPDATE [Commands] SET [StartedAt]=@StartedAt,[Status]=@Status WHERE ([Id] = @P2)] database is locked
15-6-2 00:39:31.7|Trace|Owin|SQLite error (517): statement aborts at 28: [UPDATE [Commands] SET [StartedAt]=@StartedAt,[Status]=@Status WHERE ([Id] = @P2)] database is locked
15-6-1 22:35:26.6|Trace|Owin|SQLite error (17): statement aborts at 32: [INSERT INTO Logs VALUES(@Message,@Time,@Logger,@Exception,@ExceptionType,@Level)] database schema has changed

I’ll provide a download link once I get them zipped. I’m busy at work at the moment.

Thanks!

Same system here…centos 6 etc. Same symptoms. Thought I was able to correlate the DB locks, specifically the 517s, to the issue but it appears those errors occur for some time without the jobs (finished downloads and downloaded episodes scan) hanging. Restarting fixes the issue for anywhere from a few minutes to several hours. Both hang eventually but not necessarily at the same time. I tried using a fresh DB with only a handful of shows to no avail. Also updated to the latest version of mono.

I can provide trace logs a little later or anything else if needed. Nzbget is my only dl client fwiw.

They may want some more logs and db to be able to help narrow it down. I PM’d a link to @markus101 this morning to my logs/db so hopefully it will help them determine what the issue is.

1 Like

Others on Reddit having the same issue http://www.reddit.com/r/usenet/comments/386fol/sonarr_no_longer_post_processing_downloads_all_of/

Yeah I had started a thread on Reddit about this last week:

I also had the same issue and posted a thread. Reinstall of sonarr seems to have fixed it for now. (Didn’t lose any settings).

We have made a fix in this area (in develop), we’re not 100% certain that it will fix the issue since we weren’t able to reproduce it. It will be available in 2.0.0.2306 or newer if you’re able to switch to develop and test it out it would be greatly appreciated.

Reverted back to the previous Master (3004) and ran for longer than I had previously without the tasks hanging. I went ahead and moved to the latest dev build this morning. I’ll report back after it’s been running stable for awhile or something hangs. Trace logging is turned on just in case!

Thanks for looking into it!

1 Like

I just changed over to the develop branch and still have trace logging on. I’ll post an update tomorrow.

1 Like

Some good news. Tnx to a memory dump a user provided us we’ve been put on the right trail.
markus already committed a fix for the problem on develop, but we weren’t sure yet if that was the cause.

This was a typical Murphy scenario.
Tnx to a tiny bug, if 3 specific things happened at the same time, Sonarr would end up with a stale cached command state, preventing that command from ever running again until the app got restarted.

Once we figured out how those 3 things played a role, it became much easier to get it to reproduce.
So the fix markus applied earlier is now confirmed with a probability of >95%, if it continues to work we’ll cherrypick the fixes to master tomorrow, maybe a bit earlier. merged to master now.

Thank you for your patience.

4 Likes

Great news, thanks