Files/Folders leftover after download and move process occurs

I’m regularly running into an issue where randomly sonarr will leave behind files/folders even after it has moved the video file over to the proper television series location. It does not always happen, it seems to be somewhat random. Sometimes the folder contains samples and that’s all that is leftover, but I’ve since fixed that by having SABNZBD remove samples. However, this issue still regularly occurs. I’ll see the show/file in the series folder, but the “Completed” folder and video file are still sitting there and don’t get removed.

I’ve turned on debug logging and tried to see if I could find anything out of place but I don’t see it complaining about being unable to delete the folder/files after copying.

-Ubuntu Server v14.04
-Sonarr v2.0.0.3594
-File Storage… unRAID v6.1.3, connected to ubuntu server via cifs share.

This issue has been occurring randomly throughout recent versions of sonarr, unraid, and ubuntu. So I don’t necessarily think it’s version specific.

Any ideas? Thanks.

Does SAB download straight to the NAS?

Could you hastebin the trace logs from an import? Or if thats to big zip them up and put them on dropbox or similar and let us know which release.

SAB downloads to the local disk on the ubuntu server it’s installed on. Once the download finishes, SAB unpacks the download onto a folder on the NAS.

I enabled trace logging and had a show downloading this evening and ran into the problem again. The Leftovers S02E10.

The folder was left in the completed section, but it got moved to the proper season folder. So everything worked fine except for the cleanup portion. Found this in the trace logs:

15-12-6 21:56:08.5|Debug|DiskTransferService|Rolling back incomplete file move [/media/tower/Storage/Completed/_tv/The.Leftovers.S02E10.720p.HDTV.x264-KILLERS/The.Leftovers.S02E10.720p.HDTV.x264-KILLERS.mkv] to [/media/tower/TV/The Leftovers/The Leftovers - Season 2/The Leftovers - S02E10 - HDTV-720p.mkv].
15-12-6 21:56:11.5|Error|DiskTransferService|Failed to properly rollback the file move [/media/tower/Storage/Completed/_tv/The.Leftovers.S02E10.720p.HDTV.x264-KILLERS/The.Leftovers.S02E10.720p.HDTV.x264-KILLERS.mkv] to [/media/tower/TV/The Leftovers/The Leftovers - Season 2/The Leftovers - S02E10 - HDTV-720p.mkv], incomplete file may be left in target path.
15-12-6 21:56:11.5|Warn|ImportApprovedEpisodes|Couldn’t import episode /media/tower/Storage/Completed/_tv/The.Leftovers.S02E10.720p.HDTV.x264-KILLERS/The.Leftovers.S02E10.720p.HDTV.x264-KILLERS.mkv

System.IO.IOException: File move incomplete, data loss may have occurred. [/media/tower/TV/The Leftovers/The Leftovers - Season 2/The Leftovers - S02E10 - HDTV-720p.mkv] was 1934753792 bytes long instead of the expected 1934828856.
at NzbDrone.Common.Disk.DiskTransferService.TryMoveFileVerified (System.String sourcePath, System.String targetPath, Int64 originalSize) [0x00000] in :0

Also spotted this:

15-12-6 21:53:47.6|Debug|EpisodeFileMovingService|Moving episode file: /media/tower/Storage/Completed/_tv/The.Leftovers.S02E10.720p.HDTV.x264-KILLERS/The.Leftovers.S02E10.720p.HDTV.x264-KILLERS.mkv to /media/tower/TV/The Leftovers/The Leftovers - Season 2/The Leftovers - S02E10 - HDTV-720p.mkv
15-12-6 21:53:47.6|Debug|DiskTransferService|Move [/media/tower/Storage/Completed/_tv/The.Leftovers.S02E10.720p.HDTV.x264-KILLERS/The.Leftovers.S02E10.720p.HDTV.x264-KILLERS.mkv] > [/media/tower/TV/The Leftovers/The Leftovers - Season 2/The Leftovers - S02E10 - HDTV-720p.mkv]
15-12-6 21:53:47.6|Trace|DiskTransferService|Attempting to move hardlinked backup.
15-12-6 21:53:47.6|Debug|DiskProvider|Hardlink ‘/media/tower/Storage/Completed/_tv/The.Leftovers.S02E10.720p.HDTV.x264-KILLERS/The.Leftovers.S02E10.720p.HDTV.x264-KILLERS.mkv’ to ‘/media/tower/Storage/Completed/_tv/The.Leftovers.S02E10.720p.HDTV.x264-KILLERS/The.Leftovers.S02E10.720p.HDTV.x264-KILLERS.mkv.backup~’ failed.

System.InvalidOperationException: Operation not supported —> Mono.Unix.UnixIOException: Operation not supported [EOPNOTSUPP].
— End of inner exception stack trace —
at Mono.Unix.UnixMarshal.ThrowExceptionForLastError () [0x00000] in :0
at Mono.Unix.UnixMarshal.ThrowExceptionForLastErrorIf (Int32 retval) [0x00000] in :0
at Mono.Unix.UnixFileSystemInfo.CreateLink (System.String path) [0x00000] in :0
at NzbDrone.Mono.DiskProvider.TryCreateHardLink (System.String source, System.String destination) [0x00000] in :0

15-12-6 21:53:47.6|Trace|DiskTransferService|Hardlink move failed, reverting to move.

FYI, “/media/tower/Storage” is a network share, connected to ubuntu via cifs.

Here’s a link to the full log file:

Are you able to use NFS with unRAID? I ask because there is fairly well known issue (at least to our community) with mono moving files to a CIFS/SMB share that we try to deal with, but its not always successful as you’re seeing here. NFS doesn’t exhibit the same issue so its the best alternative in this case.

I am able to use NFS with unRAID. I will switch that over and see how things go over the next few days.

Thanks!

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