Wish Sonarr would touch the parent show folder on changes

I would like to see the logs about that, if at least sonarr calls the script. You should see something like this in debug mode

15-11-24 14:58:38.0|Debug|CustomScriptService|Executing external script: /config/sonarr_rm_syncthing.sh

Sonarr usually runs as the current user that fires the executable in OSX. Anyway you can still check with ps aux | grep Nzb, if is not running as the current user logged that has the script then it will have problems since home folders in OSX are generally 700.

Same error Iā€™ve been gettingā€¦

Message
Unable to send OnDownload notification to: series_touch: ApplicationName='/Users/media/Documents/script.sh', CommandLine='', CurrentDirectory='', Native error= Access denied

Exception
System.ComponentModel.Win32Exception: ApplicationName='/Users/media/Documents/script.sh', CommandLine='', CurrentDirectory='', Native error= Access denied
  at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00352] in /private/tmp/source-mono-mac-4.0.0-bug-33585-hotfix/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/System/System.Diagnostics/Process.cs:1105 
  at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x0008b] in /private/tmp/source-mono-mac-4.0.0-bug-33585-hotfix/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/System/System.Diagnostics/Process.cs:1169 
  at System.Diagnostics.Process.Start () [0x0002c] in /private/tmp/source-mono-mac-4.0.0-bug-33585-hotfix/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/System/System.Diagnostics/Process.cs:1179 
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start ()
  at NzbDrone.Common.Processes.ProcessProvider.Start (System.String path, System.String args, System.Collections.Specialized.StringDictionary environmentVariables, System.Action`1 onOutputDataReceived, System.Action`1 onErrorDataReceived) [0x0012b] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Processes\ProcessProvider.cs:167 
  at NzbDrone.Common.Processes.ProcessProvider.StartAndCapture (System.String path, System.String args, System.Collections.Specialized.StringDictionary environmentVariables) [0x00011] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Processes\ProcessProvider.cs:199 
  at NzbDrone.Core.Notifications.CustomScript.CustomScriptService.ExecuteScript (System.Collections.Specialized.StringDictionary environmentVariables, NzbDrone.Core.Notifications.CustomScript.CustomScriptSettings settings) [0x00016] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Notifications\CustomScript\CustomScriptService.cs:88 
  at NzbDrone.Core.Notifications.CustomScript.CustomScriptService.OnDownload (NzbDrone.Core.Tv.Series series, NzbDrone.Core.MediaFiles.EpisodeFile episodeFile, System.String sourcePath, NzbDrone.Core.Notifications.CustomScript.CustomScriptSettings settings) [0x00220] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Notifications\CustomScript\CustomScriptService.cs:58 
  at NzbDrone.Core.Notifications.CustomScript.CustomScript.OnDownload (NzbDrone.Core.Notifications.DownloadMessage message) [0x00000] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Notifications\CustomScript\CustomScript.cs:27 
  at NzbDrone.Core.Notifications.NotificationService.Handle (NzbDrone.Core.MediaFiles.Events.EpisodeDownloadedEvent message) [0x000c0] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Notifications\NotificationService.cs:132 

Seems like a permission issue to me but I made the directory world executable so, Iā€™m confused.

Oh I should add that Sonarr did import the show into the series folder this time, so that part at least worked.

This seems like a lot of work just have the timestamp on some folders change.

Why not just use the built-in calendar, to see what has aired, and downloaded?

The ICal link works too. I put it into my work calendar once. That was fun.

1 Like

Because the whole point is to be able to see whatā€™s new to watch when Iā€™m browsing my content. The calendar is cute but useless since you canā€™t click anything to watch from the calendar. I like to keep my series folder sorted by Date Modified, which (if the script worked) would keep newly added shows right up at the top and Iā€™d always be able to see what was available right now. The calendar is also useless because it doesnā€™t reflect a show that has been watched & deleted, so againā€¦ you canā€™t look at it and see what you have available to watch right now and whatā€™s most recently added.

Are you using season folders?

I have my own reasons for season folders, but I would think if you disable season folders then the parent folder modified date should updateā€¦?

Does the user running Sonarr have execute permissions on that script?

good point, and yeah that would certainly do the trick. I really like Season folders though so Iā€™d rather continue using them.

I made it world executable so I would imagine so. Also if Sonarr runs as the primary user of the machine, then yes it has 777 permissions.

You could also try setting python as the executable and the arguments to the path to the script (Windows users had success with that).

What about the top folder Documents? Or user folder media? If those are user readable only, sonarr will have access only if is running as user "media"
Home folders in osx are generally 700

Iā€™m afraid I donā€™t know what that meansā€¦?

Documents/ is set to 701

Set to 755

Path = python
Arguments = path/to/script.py

But where would script.py be? I have no such animal. And ā€œpythonā€ isnā€™t a pathā€¦ is it? How would the Mac know what ā€œpythonā€ means?

Also why does the test pass in Sonarr if there is a problem accessing the script?

I meant /Users/media/Documents/script.shā€¦ but its not python, just a shell script.

python is installed on the Mac, its an executable, but I see that youā€™re using a shell script, so never mind!

All Sonarr does is check if it exists, it doesnā€™t try to execute it.

Ok, now whoā€™s the user running sonarr?
I would try a more friendly readable location like /opt/script.sh

Python is included with osx.

No idea, how would I find that out? It doesnā€™t appear in Activity Monitor.

OK Iā€™ll move the script there and see what happens.

Well that was a bust. Sonarr (again) failed to even import the show after downloading. Wish I could figure out why itā€™s so inconsistent with its download handling.

FWIW, hereā€™s what the logs say about it:

EpisodeSearchService	Episode search completed. 1 reports downloaded.	1:54pm
DownloadService	Report sent to UTorrent. Homeland S05E08 INTERNAL HDTV x264-KILLERS[ettv]	1:54pm
DownloadDecisionMaker	Processing 20 releases	1:54pm
NzbSearchService	Searching 1 indexers for [Homeland : S05E08]	1:54pm
DiskScanService	Completed scanning disk for Homeland	1:54pm
DiskScanService	Scanning disk for Homeland	1:54pm
RefreshEpisodeService	Finished episode refresh for series: [247897][Homeland].	1:54pm
RefreshEpisodeService	Starting episode info refresh for: [247897][Homeland]	1:54pm
RefreshSeriesService	Updating Info for Homeland	1:54pm

That doesnā€™t said anything about failed import. Thatā€™s torrent grab sent to the client.

I know, my point is that there is nothing else regarding that episode at all. Sonarr simply silently fails to import it. An hour ago I tested it again, deleting all traces of that episode and downloading fresh from Sonarr. Same thingā€¦ episode downloaded and is sitting in my Completed folder, but Sonarr never even attempts to grab it. No idea why.

This is getting extremely frustrating. Everything worked great for the first couple weeks and then itā€™s like everything fell apart. What else can I do to get to the bottom of this?

Look at the log files, specifically with debug logging enabled, its much more verbose.