Sonarr Failing to Import if seeding is met

Sonarr version (exact version): 2.0.0.4949
Mono version (if Sonarr is not running on Windows): 4.6.1
OS: Ubuntu 16.04
((Debug logs)): https://drive.google.com/open?id=0B94OvyHliPFVdzJBWVYzc2s5dms
(Make sure debug logging is enabled in settings and post the full log to hastebin/pastebin/dropbox/google drive or something similar, do not post them directly here)
Description of issue: After transmission has finished downloading a torrent Sonnar will not auto import if the seeding is already finished in Transmission. If the file is still seeding it will import without issue. Each time a torrent has fully seeded before the download is finished Sonnar will not import properly. The logs will always show Couldn’t import episode - System.IO.IOException: Destination already exists. The issue is the file never existed before and should import properly. It seems that for some reason if a file is already fully seeded that it will actually import the file but seems to think it failed resulting in me having to manually go into Activity, manual import episode, refresh the series then delete the file. The notification to Emby will also not happed due to Sonnar never thinking it auto imported.

I can confrim each time this only happens when the seeding ratio is met before the file finishes downloading.

Sonnar is running on the same machine as Transmission (Transmission 2.84 (14307))(Virtual Machine 1 - Ubuntu 16.04)
Seed ratio can be 1.0 or 2.0 (does not really matter either will have the problem if the ratio is met before download is finished)
The file are stored on different machine (Virtual Machine 2 - Windows 2012 R2 SMB Share - Share is mounted in Ubuntu via fstab on boot and a keepalive file is used to make sure connection does not drop via crontab)
Different virtual machine is running Emby Media Server (Virtual Machine 3 - Ubuntu 16.04)
All virtual machine are running in Windows 2012 R2 Hypervisor
All downloads are done through RSS from Sonnar to Transmission

fstab entrys
//10.10.0.3/TorDownloads$ /media/tordownloads cifs credentials=/home/jweber/.smbcredentials,vers=3.0,_netdev,uid=debian-transmission,gid=media,iocharset=utf8,noserverino,sec=ntlm 0 0
//10.10.0.3/Media/TV\040Shows /media/tv-shows cifs credentials=/home/jweber/.smbcredentials,vers=3.0,_netdev,uid=sonarr,gid=media,iocharset=utf8,noserverino,sec=ntlm 0 0

Transmission download directory
/media/tordownloads/completed/sonarr

Download Clients Settings
Transmission
Category – sonarr
Directory – blank

Sonnar Media Management settings

Rename Episodes - Yes
Replace Illegal Characters - Yes

Create empty series folders – No

Skip Free Space Check – No
Use Hardlinks instead of Copy – No
Import Extra Files – No

Set Permissions – No

Sonnar Download Clients Settings

Completed Download Handling
Enable – Yes
Remove – Yes

Failed Download Handling
Redownload – Yes
Remove – Yes

Drone Factory Options
Off

Remote Path Mappings
None

Anyone have an idea? I do not know where to start looking. The debug logs do not really tell me where the process is failing or why.

I cannot figure out why Sonarr thinks the file already exists only when the seeding ratio is met before the download finishes.

I notice there is a Boolean of Overwrite on the transfer service. Can that somehow be set to true so it will just overwrite.

Probably not the best way to deal with it but I dont know what else to do.

Ok so I have turned on Trace level and have a little more info. I am not sure if this is a permission issue or something else. It appears that even though I have hardlinking disabled it still tries to hardlink a backup copy and fails. Then Sonarr does a copy and succeeds but then cannot delete the original file.

New Trace file link https://drive.google.com/open?id=0B94OvyHliPFVSndFaTR4NkNJeGM

Trace|DiskTransferService|Attempting to move hardlinked backup.
System.InvalidOperationException: Operation not permitted —> Mono.Unix.UnixIOException: Operation not permitted [EPERM].
Trace|DiskTransferService|Hardlink move failed, reverting to copy.
Trace|DiskTransferService|Copy succeeded, deleting source.
System.UnauthorizedAccessException: Access to the path “/media/tordownloads/completed/sonarr/Lethal.Weapon.S02E04.HDTV.x264-LOL[rarbg]/lethal.weapon.204.hdtv-lol.mkv” is denied.

After that is just keeps failing to import

Does Sonarr have write access to the source file?

The issue with the file already existing sounds like Sonarr doesn’t track that the file was already copied due to the failure and then fails when retrying.

Do you have a log file with the full exception from the original failure deleting the file?

It should have full access as far as I know, or at least there is no other file access issues that I see. If the file is not fully seeded when the torrent is done downloading it transfers, imports and then will delete the torrent after seeding is finished. It has no issues and everything works as designed.

That would leave me to think there no access issues.

The Windows SMB user has full read and write access to the movie, tv show, and torrent folders

On Ubuntu the fstab is mounted using the windows SMB users credentials.

The mount for Ubuntu has set user as sonarr and group media

drwxr-xr-x 2 debian-transmission media 0 Aug 15 21:30 tordownloads
drwxr-xr-x 2 sonarr media 16384 Oct 24 23:22 tv-shows

I have also tried to set the Hard Linking vs Copy and same results. On Hard Linking I do have trouble sometimes with the file actually being imported even through manual import mode so I tend to leave the setting as copy.

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