Sonarr version (exact version):
Sonarr Ver. 2.0.0.5134 develop
OS:
Windows 10 Pro Version 1709 OS Build 16299.192
Debug logs:
https://drive.google.com/drive/folders/1zxqG-WgMxIlc8NkPJi3ML9QU5xYfWvoM?usp=sharing
Description of issue:
Im using mdhiggins/sickbeard_mp4_automator to standardise my library so downloads go through that before passing back to Sonarr, but everytime it passes it back it just makes Sonarr hang until I restart the service.
Can anyone help me?
18-2-2 11:38:40.0|Debug|pythonw.exe|2018-02-02 11:38:40 - SonarrPostConversion - INFO - queued
That’s repeated constantly, which means the custom script never terminates so Sonarr can never process the next download. The script needs to terminate after running, not sit waiting for something to be queued.
So is the script causing sonarr to hang?
This is the same issue as reported here -> [Ubuntu] Check for finished download task stuck
I also experience this on windows right now.
So what exactly is causing this? Who do we need to get in touch with to have this resolved? It is very problematic as sonarr is useless with the most popular post processing script right now
The script is. As I said in my last response in your thread, the script needs to exit when it’s done
Whomever wrote the script, maybe it’s already an option for the script, I don’t know, but it’s not Sonarr causing the script to keep looping waiting for more work.
Set the Drone Factory Interval’ to 0 to disable it, and disable ‘Completed Download Handling’ in Sonarr settings. The script will trigger a specific path re-scan, allowing the mp4 conversion to be completed before Sonarr starts moving stuff around. This step is optional if you do not desire any processing between the downloading by whichever downloader you choose (NZB or Torrent), but is required if you wish to convert the file to an MP4 before it is handed back to Sonarr.
Would that stop the loop?
No it will not.
@markus101 i realise drone factory is deprecated, but can we still reliable use this to resolve this issue?.
Im thinking that we could just disable passing script to sonarr after download, then run post process on a completed download folder and use drone factory to scan it at intervals for completed post processed files.
It wont be great, but atleast itll work, somewhat?
The script is waiting for Sonarr to finish its processing to go from queued to completed. It’s looping continuously.
It triggers a rescan then waits for it to finish before proceeding to the next step. I could add a timeout so this doesn’t freeze things indefinitely but this queue process should happen asynchronously so it is actually a problem with a Sonarr because the script isn’t actually freezing it’s just persistently waiting for the RescanSeries function to complete
I’m not sure why the RescanSeries option is taking so long but I would check the Sonarr logs and maybe clarify this with the Sonarr message boards. It’s working fine on my end using Sonarr
Something weird is going on here
It does seem likely that there is an issue with sonarr. I mean sure the script does loop, but while the script loops i still see basic sonarr tasks not running at all, like checking for completed downloads doesnt run since 6 hours
This should run even though my post process script is waiting for something no? I seems likely that in fact, a sonarr task is hanging and thus the script is waiting
That scan doesn’t take hours to complete, it should complete within a few minutes even if it’s trying to import hundreds of episodes.
It’s not running because it’s already running (and the script is blocking Sonarr from completing that task). There are multiple threads that run tasks, so a rescan while check for completed downloads is executing will work. ((Trace logs)) should show the task/command starting and finishing, I’m not sure if ((debug logs)) will offhand.
Okay, hopefully script author will respond soon. There must be more then just me and OP using sonarr with this script, and we cant be the only ones experiencing this problem. Ill check logs when im at work in the morning.
Im posting a set of logs aswell @markus101
debug = https://docs.google.com/document/d/1n3UbwPyLdhQNt8CLHAWgvtiwWmEGaM1Srf1e-FG7MJA/edit?usp=sharing
trace 1 = https://docs.google.com/document/d/1BLQHcKdlK0RFsZFHHNXLPVqswzK0X-sPSkZa1CtAOmc/edit?usp=sharing
Trace 2 = https://docs.google.com/document/d/1kTwjjqQSUj5cov-quIHbGIydsTFYnmZ2MmJj1nAs4sM/edit?usp=sharing
The author of the script is not very quick at responding it seems, is there anything we can do in sonarr to rectify this problem?
Is completed download handling enabled in Sonarr?
Or is a post processing script triggering the import in Sonarr?
Why convert after Sonarr imports instead of before?
At best that forces Sonarr to remove the old reference and import the new one, but at worst it thinks the file has a specific size and media info, which would cause issues if you wanted to include media info in the filename later.
What it looks like here is Sonarr is told to scan a folder to import the file(s), which leads to it being imported and the custom script executing, which ends up triggering another command to rescan the series folder. If request came in to import a file, that repeats the same process then you’ve now tied up two job threads executing imports and finally if a 3rd import was started, or a scheduled task like RSS Sync or the normal refresh process started, all job threads would be blocked until one finishes, but because the import is blocked by the custom script that is blocked by another task the tasks deadlock and it fails until Sonarr is restarted.
Script author amended the script to terminate after a number of attempts, working great now!
Please close this thread 
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.