Error occurred while executing task

Thanks for doing such a great job on NZBDrone. Since a few days I have an error that keeps popping up in the logs.

The Exception is:

System.ApplicationException: Expected query to return 3 rows but returned 1
  at NzbDrone.Core.Datastore.BasicRepository`1[NzbDrone.Core.Tv.Episode].Get (IEnumerable`1 ids) [0x00000] in <filename unknown>:0 
  at NzbDrone.Core.Tv.EpisodeService.GetEpisodes (IEnumerable`1 ids) [0x00000] in <filename unknown>:0 
  at NzbDrone.Core.Parser.ParsingService.Map (NzbDrone.Core.Parser.Model.ParsedEpisodeInfo parsedEpisodeInfo, Int32 seriesId, IEnumerable`1 episodeIds) [0x00000] in <filename unknown>:0 
  at NzbDrone.Core.Download.DownloadTrackingService.GetTrackedDownload (System.String trackingId, Int32 downloadClient, NzbDrone.Core.Download.DownloadClientItem downloadItem, System.Collections.Generic.List`1 grabbedHistory) [0x00000] in <filename unknown>:0 
  at NzbDrone.Core.Download.DownloadTrackingService.UpdateTrackedDownloads (System.Collections.Generic.List`1 grabbedHistory) [0x00000] in <filename unknown>:0 
  at NzbDrone.Core.Download.DownloadTrackingService.ProcessTrackedDownloads () [0x00000] in <filename unknown>:0 
  at NzbDrone.Core.Download.DownloadTrackingService.Execute (NzbDrone.Core.Download.CheckForFinishedDownloadCommand message) [0x00000] in <filename unknown>:0 
  at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommand[CheckForFinishedDownloadCommand] (NzbDrone.Core.Messaging.Commands.Command command) [0x00000] in <filename unknown>:0 

Can this due some file being not able to process in the tv directory? I cannot find how to resolve this issue.

Looks like drone is trying to process something in your SAB/get queue and you’re getting that error when it tries to get the episodes in that file. Trace logging should show what is getting processed before you get that error. Refreshing the affected series, might clear it up. But knowing what it is might help us track if down. Feel free to pastebin any logs and we can take a look.

@markus101 I think it’s because the HistoryItem you’re using refers to episodeids that no longer exist. Dunno how that would happen.

ref: http://forums.nzbdrone.com/t/log-errors-after-torrents-2-0-0-2106-update/2406

I was able to solve this problem after removing all active torrents in my transmission downloader and restarting NZBDrone