Can't import this episode: Path is too long. Path:

Couldn't import episode /downloads/completednzb/[HorribleSubs] Saiki Kusuo no Psi-nan - 19 [1080p]/[HorribleSubs] Saiki Kusuo no Psi-nan - 19 [1080p].mkv

System.IO.PathTooLongException: Path is too long. Path: 
   at System.IO.File.Move (System.String sourceFileName, System.String destFileName) [0x00116] in <77c9551943624fd18301ba6f78a841e5:0 
   at NzbDrone.Common.Disk.DiskProviderBase.MoveFile (System.String source, System.String destination, System.Boolean overwrite) [0x000e3] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Common\Disk\DiskProviderBase.cs:222 
   at NzbDrone.Common.Disk.DiskTransferService.TryMoveFileTransactional (System.String sourcePath, System.String targetPath, System.Int64 originalSize, NzbDrone.Common.Disk.DiskTransferVerificationMode verificationMode) [0x0008f] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Common\Disk\DiskTransferService.cs:489 
   at NzbDrone.Common.Disk.DiskTransferService.TransferFile (System.String sourcePath, System.String targetPath, NzbDrone.Common.Disk.TransferMode mode, System.Boolean overwrite, NzbDrone.Common.Disk.DiskTransferVerificationMode verificationMode) [0x003ce] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Common\Disk\DiskTransferService.cs:311 
   at NzbDrone.Common.Disk.DiskTransferService.TransferFile (System.String sourcePath, System.String targetPath, NzbDrone.Common.Disk.TransferMode mode, System.Boolean overwrite, System.Boolean verified) [0x0000e] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Common\Disk\DiskTransferService.cs:195 
   at NzbDrone.Core.MediaFiles.EpisodeFileMovingService.TransferFile (NzbDrone.Core.MediaFiles.EpisodeFile episodeFile, NzbDrone.Core.Tv.Series series, System.Collections.Generic.List`1[T] episodes, System.String destinationFilePath, NzbDrone.Common.Disk.TransferMode mode) [0x0012c] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\MediaFiles\EpisodeFileMovingService.cs:118 
   at NzbDrone.Core.MediaFiles.EpisodeFileMovingService.MoveEpisodeFile (NzbDrone.Core.MediaFiles.EpisodeFile episodeFile, NzbDrone.Core.Parser.Model.LocalEpisode localEpisode) [0x0005e] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\MediaFiles\EpisodeFileMovingService.cs:80 
   at NzbDrone.Core.MediaFiles.UpgradeMediaFileService.UpgradeEpisodeFile (NzbDrone.Core.MediaFiles.EpisodeFile episodeFile, NzbDrone.Core.Parser.Model.LocalEpisode localEpisode, System.Boolean copyOnly) [0x00144] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\MediaFiles\UpgradeMediaFileService.cs:66 
   at NzbDrone.Core.MediaFiles.EpisodeImport.ImportApprovedEpisodes.Import (System.Collections.Generic.List`1[T] decisions, System.Boolean newDownload, NzbDrone.Core.Download.DownloadClientItem downloadClientItem, NzbDrone.Core.MediaFiles.EpisodeImport.ImportMode importMode) [0x00277] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\MediaFiles\EpisodeImport\ImportApprovedEpisodes.cs:107

Probably due to the ridiculously large episode title.

Either move it manually or change your renaming settings to not add the episode title and import it should work around it.

Hi there,

as I am a big fan of your work, I switched to sonar (and radarr and nzbget). But this “Path too long” thing (248 chars path, 260 path including filename) is really bugging me, for as far as I know I can’t really do much about the path and filenames that get created by unpacking in NZBget. And there is not only a couple of files that can’t be imported because of the path length. Manually shortening the path…well it’s a way we all try to omit :wink:

IMHO there is a way out of this situation, for Microsoft has (finally!) torn down the MAX_PATH limit on a broader scale - not only within NTFS or forcing the use of the “\?” prefix. With Windows 10 / Server 2016 onwards we can opt-in to longer paths and ridiculous very long filenames using a registry key. For developers, there might be one or two more things to consider:

https://msdn.microsoft.com/en-us/library/aa365247(VS.85)#maxpath

https://blogs.msdn.microsoft.com/jeremykuhne/2016/07/30/net-4-6-2-and-long-paths-on-windows-10/

So would you consider to turn this on in sonar and only log the “Path too long” error in case a file/directory access throws the appropriate error (for they can be on different - in the meaning of long-path-capable - filesystems).

This might also help you handle this in the long term.

Kind regards
SoL

I +1 SoL, we need this because the names are scene conventions.

Hello dear Sonarr developers,

would somebody of you mind to give an update on the topic. At the moment it seems to me, that there isn’t much work involved to get long paths working. But I might be mislead.

Anyway, an update wouldn’t leave us in the dark. Can we expect long path support sooner, later or never?

Kind regards!

The biggest question I have is whether mono supports it, it looks like it should, but it’s an unknown. With a wide variety of mono versions available, it could cause issues for some, so we won’t push it right now.

Should be able to add this in v3 (barring any issues). Windows 10/Server 2016 users will need to make the change outlined in the article you linked, other Windows users are SOL and support for linux/macOS users is unknown.

1 Like

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