Sonarr copying incomplete files to Plex

Sonarr version (exact version): 2.0.0.5085
Mono version (if Sonarr is not running on Windows): 5.0.0
OS: unRAID 6.4.0, (Docker)
Debug logs: https://www.dropbox.com/s/122ban846qri6ei/sonarr%20debug.txt?dl=0 https://www.dropbox.com/s/cvgt7ntjonm34ht/sonarr%20access%20incomplete.txt?dl=0
Description of issue:

Hello all! I had been quite happily using Sonarr & Radarr on unRAID for 6 months or so before noticing that downloads were being added to Plex with the the exact same timestamp, 2:00 or 1:59:59. When checking, Deluge has dowloaded the complete file but whats been copied is only a fraction. The second log file demonstrates this but I am unsure on how to proceed:

ā€œ18-2-4 16:49:22.4|Error|DownloadedEpisodesImportService|Import failed, path does not exist or is not accessible by Sonarr: /data/Marvels.Spider-Man.S01E20.Spider.Island.Part.II.720p.DSNY.WEBRip.AAC2.0.x264-TVSmash[rarbg]
18-2-4 16:50:55.7|Error|DownloadedEpisodesImportService|Import failed, path does not exist or is not accessible by Sonarr: /data/Marvels.Spider-Man.S01E20.Spider.Island.Part.II.720p.DSNY.WEBRip.AAC2.0.x264-TVSmash[rarbg]
18-2-4 16:51:00.7|Error|DownloadedEpisodesImportService|Import failed, path does not exist or is not accessible by Sonarr: /data/Marvels.Spider-Man.S01E20.Spider.Island.Part.II.720p.DSNY.WEBRip.AAC2.0.x264-TVSmash[rarbg]
18-2-4 16:52:21.3|Error|DownloadedEpisodesImportService|Import failed, path does not exist or is not accessible by Sonarr: /data/Marvels.Spider-Man.S01E20.Spider.Island.Part.II.720p.DSNY.WEBRip.AAC2.0.x264-TVSmash[rarbg]
18-2-4 16:53:51.3|Error|DownloadedEpisodesImportService|Import failed, path does not exist or is not accessible by Sonarr: /data/Marvels.Spider-Man.S01E20.Spider.Island.Part.II.720p.DSNY.WEBRip.AAC2.0.x264-TVSmash[rarbg]
18-2-4 16:56:58.1|Warn|DiskTransferService|Failed to completely transfer [/data/Marvels.Spider-Man.S01E20.Spider.Island.Part.II.720p.DSNY.WEBRip.AAC2.0.x264-TVSmash[rarbg]/Marvels.Spider-Man.S01E20.Spider.Island.Part.II.720p.DSNY.WEB-DL.AAC2.0.x264-TVSmash.mkv] to [/media/TV Kids - Animation/Marvelā€™s Spider-Man/Marvelā€™s Spider-Man - Season 01/Marvelā€™s Spider-Man - S01E20 - Spider-Island- Part Two.mkv], retrying [1/2].
18-2-4 16:57:01.5|Warn|DiskTransferService|Failed to completely transfer [/data/Marvels.Spider-Man.S01E20.Spider.Island.Part.II.720p.DSNY.WEBRip.AAC2.0.x264-TVSmash[rarbg]/Marvels.Spider-Man.S01E20.Spider.Island.Part.II.720p.DSNY.WEB-DL.AAC2.0.x264-TVSmash.mkv] to [/media/TV Kids - Animation/Marvelā€™s Spider-Man/Marvelā€™s Spider-Man - Season 01/Marvelā€™s Spider-Man - S01E20 - Spider-Island- Part Two.mkv], retrying [2/2].
18-2-4 16:57:05.0|Error|DiskTransferService|Failed to completely transfer [/data/Marvels.Spider-Man.S01E20.Spider.Island.Part.II.720p.DSNY.WEBRip.AAC2.0.x264-TVSmash[rarbg]/Marvels.Spider-Man.S01E20.Spider.Island.Part.II.720p.DSNY.WEB-DL.AAC2.0.x264-TVSmash.mkv] to [/media/TV Kids - Animation/Marvelā€™s Spider-Man/Marvelā€™s Spider-Man - Season 01/Marvelā€™s Spider-Man - S01E20 - Spider-Island- Part Two.mkv], aborting.
18-2-4 16:57:05.0|Warn|ImportApprovedEpisodes|Couldnā€™t import episode /data/Marvels.Spider-Man.S01E20.Spider.Island.Part.II.720p.DSNY.WEBRip.AAC2.0.x264-TVSmash[rarbg]/Marvels.Spider-Man.S01E20.Spider.Island.Part.II.720p.DSNY.WEB-DL.AAC2.0.x264-TVSmash.mkvā€

I realise there may be some permission issue occurring, it isnā€™t apparent to me where I can view permissions on an app/docker/share basis, and this setup was working flawlessly for a long period.

I can take instruction and with the help of Google hopefully learn quite quickly if anyone has the patience to help me work through this?

Thanks in advance

Weā€™re going to need to see Debug logs of the import process.

Is there a way of limiting the debug log to just imports? It should be in here https://www.dropbox.com/s/dzak86eku0xbofz/import.txt?dl=0 but itā€™s a large fileā€¦ Thank you for the reply.

No way to filter it. Iā€™m not seeing Failed to completely transfer in that log either.

Sorry, I thought that log had caught it, seems thereā€™s only the inaccessible error. Iā€™m trying to download something and import it now to capture in the log but itā€™s late here (London) so probably wont be posted until tomorrow.

ok, this should included it

What file system are you using on unRAID?
Are /data and /media both local to the unRAID server? Are they on the same volume?

Typically weā€™ve seen cutoff files when Sonarr is copying to an SMB share (only when running under mono), in which case we recommend using NFS for shares.

My cache drives are a pool of 2 SSDs formatted as BTRFS, the array is 5 data 2 parity formatted as XFS. So /data and /media are both mapped to separate shares on my unRAID array, /data is cache only /media is cache then array, and yes the shares are set up as SMB. I use macOS mainly, can this read NFS or can I run SMB and NFS? How do I tell sonarr to use NFS shares?

Having SMB shares enabled on them doesnā€™t matter it only matters if Sonarr is forced to copy to/from an SMB share directly, if both /data and /media are local then it wonā€™t matter.

Is Use Hardlinks instead of Copy enabled in Sonarr?
If enabled, try disabling it and see if the result changes.

Is that time significant on unRAID? IIRC there is a time of the day it copies from the cache to the array, is that it?

Sorry, when I said ā€˜time stampā€™ I meant to say that that is the length Plex is interpreting the incomplete files at.

Iā€™ve tried it with and without ā€˜hardlinksā€™.

OK, so I nuked the entire site from orbit and started again, backed up media, erased array, setup as new and put Plex, deluge and sonarr back onā€¦

And it worked :slight_smile:

For a week :frowning:

After importing tens of completed files into Plex, Iā€™m back to only having partial transfers.

Any and all help appreciated.

Important info I neglected to mention regarding my post processing:

  • Sonarr sends torrent to Deluge

  • Deluge downloads to /mnt/user/downloads/Incomplete

  • Deluge moves completed torrent file to /mnt/user/downloads/Processing

  • Handbrake in a Docker watches /mnt/user/downloads/Processing then converts them putting the finished file in /mnt/user/downloads/Completed

  • Sonarr monitors /mnt/user/downloads/Completed for completed files, this was working fine and importing whole episodes, but now is importing incomplete files

Does the file show up in /mnt/user/downloads/Completed before the conversion is complete? If it does, Sonarr may try to import it.

Thatā€™s what I was thinking, but that wouldnā€™t explain why I t was working and now isnā€™t, nor why the same setup works for radarrā€¦

I was thinking about a script or another link that would move the completed file from handbrake to /mnt/usr/downloads/Import for example, but donā€™t have the chops to create it.

A feature request for sonarr download handling? Only import if file size remains constant for 5 min?

OK, so what does this mean?

Import failed, path does not exist or is not accessible by Sonarr: /data/substitute file name

[/data/substitute filename has a runtime of 0, is it a valid video file?

first it says it doesnā€™t have access, then that itā€™s not long enough to be a video file, then imports it incomplete anyway, as the file is still being written?

It means exactly what it describes.

  1. When it first looks itā€™s not there
  2. It looks and sees a file, but itā€™s not a valid video file
  3. It looks sees the file, itā€™s a ā€œvalidā€ video file because media info gets a result, Sonarr imports it

  1. Happens because the file isnā€™t yet converting
  2. Itā€™s converting, but not well formed yet
  3. Itā€™s converting, but not yet done, but Sonarr sees itā€™s viable for import

Convert then move to where Sonarr expects to find the file, thatā€™s the only viable option currently.

Possibly in the future, but no short term plans for such a thing.

Thanks for the nudge in the right direction, I found and modified an unRAID mover script, which seems to work:

#!/bin/bash

if [ -f /var/run/mymover.pid ]; then
if ps h cat /var/run/mymover.pid | grep mymover.sh ; then
echo "mymover already running, sorry."
exit 0
fi
fi

echo $$ >/var/run/mymover.pid

echo ā€œMoving files from $1 to $2ā€
(cd ā€œ/mnt/user/downloads/Complete/ā€; find -depth -print ( ! -exec fuser -s ā€˜{}ā€™ ; -exec rsync -i -qdIWRpEAXogt --numeric-ids --inplace --remove-source-files {} ā€œ/mnt/user/downloads/Import/ā€ ; ))

Prune empty directories from source dir

find ā€œ/mnt/user/downloads/Complete/ā€ -type d -empty -prune -exec rmdir --ignore-fail-on-non-empty {} ;

Prune empty directories from destination dir

find ā€œ/mnt/user/downloads/Import/ā€ -type d -empty -prune -exec rmdir --ignore-fail-on-non-empty {} ;

sync

rm /var/run/mymover.pid

echo ā€œMoving all done.ā€

Sonarr will also remove the torrent file once my ratio is reached, how would I create a Sonarr script to remove the transcoded file from /data/ after import?

Kinda forgot this isnā€™t the unRAID forum, that mover script runs every hour, it wonā€™t move anything being currently written, then thereā€™s another script that runs that removes anything from the transcoded directory more than 1 day old. Will see how that runs :slight_smile:

1 Like

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