Sonarr's leaving behind empty directories

Sonarr version: 3.0.6.1342
Mono version:
OS: Symology DSM 7.x
Debug logs: https://gist.github.com/adefaria/484b473266b9d6dc2978f608773e3533
Description of issue:

After Sonarr downloads the episode it moves the video to the right place but an empty directory remains under the complete directory.

Some more information. I tested downloading a new episode of Penn & Teller’s Fool Us. I turned on debug logging and searched for Penn in all of sonarr.txt, sonarr.debug.txt and sonarr.trace.txt. Here are relevant snippets. Log files available upon request. I’m not sure if I did that gist link thing correctly above but that was a previous set of logs. If I did that correctly I can make another gist with these logs.

A couple of observations - previously I saw something like “Invalid cross-device link” in the log. I didn’t think I was trying to do any kind of hardlinking. In any event, the only thing I could find in Sonarr’s settings for hardlinks I toggled off. Additionally, we’ll see that Sonarr seems to be using Season folders even though I toggle that off too.

From sonarr.debug.txt I see:

2022-03-02 19:12:15.9|Debug|EpisodeFileMovingService|Moving episode file: /downloads/complete/Penn and Teller Fool/Season 8/Penn and Teller Fool - S08E13.mkv to /series/Penn & Teller - Fool Us/Penn & Teller - Fool Us S08E13 - Penn on Fire.mkv
2022-03-02 19:12:15.9|Debug|DiskTransferService|Move [/downloads/complete/Penn and Teller Fool/Season 8/Penn and Teller Fool - S08E13.mkv] > [/series/Penn & Teller - Fool Us/Penn & Teller - Fool Us S08E13 - Penn on Fire.mkv]
2022-03-02 19:12:30.1|Debug|DiskProvider|Setting permissions: 755 on /series/Penn & Teller - Fool Us/Penn & Teller - Fool Us S08E13 - Penn on Fire.mkv
2022-03-02 19:12:31.4|Debug|EpisodeService|Linking [Penn & Teller - Fool Us S08E13 - Penn on Fire.mkv] > [[22259]Penn on Fire]

So it seems to find and download the episode. Notice it seems to inject “Season 8” in there when again, I toggled off the Use Season Folder. Oddly it says setting permissions to 755 where the file ends up as 644. And it says “Linking” but I don’ know what [[22259]Penn on Fire] is supposed to mean. Plus I toggled off the hardlinking thing…

From sonarr.trace.txt I see:

2022-03-02 19:12:31.7|Debug|CompletedDownloadService|All episodes were imported for Penn.and.Teller.Fool.Us.S08E13.1080p.WEB.h264-KOGi
2022-03-02 19:12:31.8|Debug|DownloadEventHub|[Penn.and.Teller.Fool.Us.S08E13.1080p.WEB.h264-KOGi] Marking download as imported from Nzbget
2022-03-02 19:12:31.8|Debug|PlexServerService|Getting metadata from Plex host: 192.168.0.251 for series: [239851][Penn & Teller: Fool Us]
2022-03-02 19:12:31.8|Debug|DownloadEventHub|[Penn.and.Teller.Fool.Us.S08E13.1080p.WEB.h264-KOGi] Removing download from Nzbget history
2022-03-02 19:12:31.8|Trace|Nzbget|[Penn.and.Teller.Fool.Us.S08E13.1080p.WEB.h264-KOGi] File or folder '/downloads/complete/Penn and Teller Fool/Season 8' doesn't exist, skipping cleanup.

Sonarr seems to skip cleanup because the directory “Season 8” doesn’t exist.

I watched the download and the /downloads/complete/Penn and Teller Fool/Season 8 directory does exist with the episode in the directory briefly until Sonarr performs the move. It then deletes the Season 8 folder and apparently stopped cleaning up any further.

What do I have configured wrong that causes this skipping of the cleanup?

Nobody has anything to add?

is a per series setting.

And it says “Linking” but I don’ know what [[22259]Penn on Fire] is supposed to mean. Plus I toggled off the hardlinking thing…

Nothing to do with hardlinks nor does the log indicate it’s hardlinking. It’s linking the episode file to the episode

Sonarr seems to skip cleanup because the directory “Season 8” doesn’t exist.

Not a Sonarr problem nor anything to do with Sonarr. Remove Completed downloads appears to be on and it’s nzbget that is failing to remove the folder.

The log even tells you nzbget says it can’t be removed

2022-03-02 19:12:31.8|Trace|Nzbget|[Penn.and.Teller.Fool.Us.S08E13.1080p.WEB.h264-KOGi] File or folder ‘/downloads/complete/Penn and Teller Fool/Season 8’ doesn’t exist, skipping cleanup.

NZBGet is also no longer actively maintained and you should switch to Sabnzbd instead.

It appears based on the fairly clean download directories you have videosort or other sorting enabled in nzbget which is not supported and always causes problems.

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