Sonarr / Sonarr

Smart PVR for newsgroup and bittorrent users.
https://sonarr.tv
GNU General Public License v3.0
10.84k stars 1.42k forks source link

Import Fails: System.NullReferenceException: Object reference not set to an instance of an object #2880

Closed abhishekjain14 closed 5 years ago

abhishekjain14 commented 5 years ago

Describe the bug The above error occurs when trying to manually import certain episodes of a TV show, interestingly even when I use different files for said episode.

Logs

19-1-7 03:23:58.8|Debug|VideoFileInfoReader|Getting media info from /downloads/mahabharat/Mahabharat Episode 1-WhC0lAXqnZs.mp4
19-1-7 03:23:58.8|Trace|MediaInfo|Read file offset 0-16384 (16384 bytes)
19-1-7 03:23:58.8|Trace|MediaInfo|Read file offset 126644762-128689075 (2044313 bytes)
19-1-7 03:23:58.8|Trace|MediaInfo|Read file offset 48-16432 (16384 bytes)
19-1-7 03:23:58.8|Trace|MediaInfo|Read file offset 128689075-128689075 (0 bytes)
19-1-7 03:23:58.8|Trace|MediaInfo|Read a total of 2077081 bytes (1.6%)
19-1-7 03:23:58.8|Debug|AggregateQuality|Using quality:  v1
19-1-7 03:23:58.8|Warn|ImportApprovedEpisodes|Couldn't import episode /downloads/mahabharat/Mahabharat Episode 1-WhC0lAXqnZs.mp4

[v2.0.0.5252] System.NullReferenceException: Object reference not set to an instance of an object
  at NzbDrone.Core.Organizer.FileNameBuilder.AddQualityTokens (System.Collections.Generic.Dictionary`2[TKey,TValue] tokenHandlers, NzbDrone.Core.Tv.Series series, NzbDrone.Core.MediaFiles.EpisodeFile episodeFile) [0x00006] in C:\BuildAgent\work\5d7581516c0ee5b3\src\NzbDrone.Core\Organizer\FileNameBuilder.cs:480 
  at NzbDrone.Core.Organizer.FileNameBuilder.BuildFileName (System.Collections.Generic.List`1[T] episodes, NzbDrone.Core.Tv.Series series, NzbDrone.Core.MediaFiles.EpisodeFile episodeFile, NzbDrone.Core.Organizer.NamingConfig namingConfig) [0x00164] in C:\BuildAgent\work\5d7581516c0ee5b3\src\NzbDrone.Core\Organizer\FileNameBuilder.cs:135 
  at NzbDrone.Core.MediaFiles.EpisodeFileMovingService.MoveEpisodeFile (NzbDrone.Core.MediaFiles.EpisodeFile episodeFile, NzbDrone.Core.Parser.Model.LocalEpisode localEpisode) [0x00000] in C:\BuildAgent\work\5d7581516c0ee5b3\src\NzbDrone.Core\MediaFiles\EpisodeFileMovingService.cs:74 
  at NzbDrone.Core.MediaFiles.UpgradeMediaFileService.UpgradeEpisodeFile (NzbDrone.Core.MediaFiles.EpisodeFile episodeFile, NzbDrone.Core.Parser.Model.LocalEpisode localEpisode, System.Boolean copyOnly) [0x0017c] in C:\BuildAgent\work\5d7581516c0ee5b3\src\NzbDrone.Core\MediaFiles\UpgradeMediaFileService.cs:76 
  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) [0x00272] in C:\BuildAgent\work\5d7581516c0ee5b3\src\NzbDrone.Core\MediaFiles\EpisodeImport\ImportApprovedEpisodes.cs:107 

19-1-7 03:23:58.8|Trace|ManualImportService|Manually imported 1 files

System Information

Additional context Add any other context about the problem here.

markus101 commented 5 years ago

Based on the error it looks like one of two things:

The latter should be fixed on restart.

markus101 commented 5 years ago

I haven't been able to reproduce this issue, though the two possibilities above are possible they're not cases we'd guard against here.