Couldn't import episode

After a successful download and file move, I get the following error:

Couldn’t import episode S:\Downloads\ZBDrone\Planet.Earth.S01E01.1080p.From.Pole.to.Pole\Planet.Earth.S01E01.1080p.From.Pole.to.Pole.mkv: Method failed with unexpected error code 87.

The episode makes it to the destination directory and will show up after I “refresh” the show in NzbDrone.

Any thoughts?

If you click the log entry in the table or look at the file log it should have more details, given the current information and the odd error message, I’m not sure what it could be.

System.InvalidOperationException: Method failed with unexpected error code 87.
at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, SafeHandle handle, AccessControlSections includeSections, Object exceptionContext)
at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, AccessControlSections includeSections, Object exceptionContext)
at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, AccessControlSections includeSections)
at System.Security.AccessControl.FileSystemSecurity.Persist(String fullPath)
at System.IO.File.SetAccessControl(String path, FileSecurity fileSecurity)
at NzbDrone.Common.DiskProvider.InheritFolderPermissions(String filename) in m:\buildAgent2_work\bc9a5cca09497250\src\zbDrone.Common\DiskProvider.cs:line 282
at NzbDrone.Core.MediaFiles.MoveEpisodeFiles.MoveFile(EpisodeFile episodeFile, Series series, String destinationFilename) in m:\buildAgent2_work\bc9a5cca09497250\src\zbDrone.Core\MediaFiles\EpisodeFileMovingService.cs:line 103
at NzbDrone.Core.MediaFiles.MoveEpisodeFiles.MoveEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEpisode) in m:\buildAgent2_work\bc9a5cca09497250\src\zbDrone.Core\MediaFiles\EpisodeFileMovingService.cs:line 55
at NzbDrone.Core.MediaFiles.UpgradeMediaFileService.UpgradeEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEpisode) in m:\buildAgent2_work\bc9a5cca09497250\src\zbDrone.Core\MediaFiles\UpgradeMediaFileService.cs:line 55
at NzbDrone.Core.MediaFiles.EpisodeImport.ImportApprovedEpisodes.Import(List`1 decisions, Boolean newDownload) in m:\buildAgent2_work\bc9a5cca09497250\src\zbDrone.Core\MediaFiles\EpisodeImport\ImportApprovedEpisodes.cs:line 72

Nothing? I would really like some help on this.

Something? :slight_smile:

Sorry, forgot to respond after reading it, the full error helps see where its happening, but I need more info to narrow in on the cause.

Is the destination folder a local disk or a network share?
If a share what OS is it running?
Is it a UNC path \\server\share or a mapped network drive?

How do you have NzbDrone running (service, console or tray)?
Is the user running drone either the owner or have full control on the destination folder?
Is it happening on every import? (Pretty sure this is yes, but want to make sure)

Network Share
FreeNas 9.1
Have tried pointing to a mapped drive and a UNC path

Runs in tray
Has full control over the network share
Every import

Ahh k, I think its because of the remote system not supporting the same permissions that a Windows disk was, I know there was a similar issue before, but it looks like this is another one.

Added to Trello: https://trello.com/c/LUKScBkB/478-failed-import-when-target-is-a-share-on-nix

Thanks Markus,

As a test I added a new series and pointed to a local drive and it processed just fine. I think it does have to do with the NAS.

EpisodeService Linking [S:\\TV\\The Big Bang Theory\\Season 7\\The Big Bang Theory - S07E09 - The Thanksgiving Decoupling.mkv] > [[3717]The Thanksgiving Decoupling] 11:10 AM
MoveEpisodeFiles Moving [S:\\Downloads\\Incomplete\\Post\ZBDrone\\The.Big.Bang.Theory.S07E09.720p.HDTV.X264-DIMENSION\\The.Big.Bang.Theory.S07E09.720p.HDTV.X264-DIMENSION.mkv] > [S:\\TV\\The Big Bang Theory\\Season 7\\The Big Bang Theory - S07E09 - The Thanksgiving Decoupling.mkv]

Ok, final bit of help for the ticket.

It will process correctly against a ZFS but not a UFS volume.

Permissions and CIFS shares were set as the same for both.

I imagine the permissions settiing failed on ZFS, but was being caught, I have pushed a fix to develop.

Thanks for the fix Markus. Great job, it works. this is the new output. Is this expected?

EpisodeService Linking [T:\Mad Men\Season 2\Mad Men - S02E08 - A Night to Remember.mkv] > [[4196]A Night to Remember] 9:35 AM
EpisodeFileMovingService Unable to apply folder permissions to: 9:35 AM
EpisodeFileMovingService Moving [S:\\Downloads\\Incomplete\\Post\ZBDrone\\Mad_Men_S02E08_720p_BluRay_DTS_x264-CtrlHD\\Mad.Men.S02E08.720p.BluRay.DTS.x264-CtrlHD.mkv] > [T:\Mad Men\Season 2\Mad Men - S02E08 - A Night to Remember.mkv] 9:34 AM
ImportDecisionMaker Analyzing 1/1 files. 9:34 AM
DiskScanService 1 video files were found in S:\Downloads\Incomplete\Post\ZBDrone\Mad_Men_S02E08_720p_BluRay_DTS_x264-CtrlHD 9:34 AM
DiskScanService Scanning ‘S:\Downloads\Incomplete\Post\ZBDrone\Mad_Men_S02E08_720p_BluRay_DTS_x264-CtrlHD’ for video files

Nope, its just a debug message, its expected in your setup. Glad its working for you.

Thank you so much for your hard work.

I am a software developer myself.

Where can I donate?

Just follow the red heart in the application (top right). Thanks for the support!

1 Like