MetadataService failed while processing [MediaCoversUpdatedEvent]

Hi Markus,

As requested, here’s the full log. This happens on the latest version, when refreshing the series info:

System.InvalidOperationException: Sequence contains more than one matching element at System.Linq.Enumerable.Single[MetadataFile] (IEnumerable1 source, System.Func2 predicate, Fallback fallback) [0x00000] in <filename unknown>:0 at System.Linq.Enumerable.SingleOrDefault[MetadataFile] (IEnumerable1 source, System.Func2 predicate) [0x00000] in <filename unknown>:0 at NzbDrone.Core.Metadata.Consumers.Xbmc.XbmcMetadata+<WriteSeasonImages>d__1b.MoveNext () [0x00000] in <filename unknown>:0 at System.Collections.Generic.List1[NzbDrone.Core.Metadata.Files.MetadataFile].AddEnumerable (IEnumerable1 enumerable) [0x00000] in <filename unknown>:0 at System.Collections.Generic.List1[NzbDrone.Core.Metadata.Files.MetadataFile].AddRange (IEnumerable1 collection) [0x00000] in <filename unknown>:0 at NzbDrone.Core.Metadata.Consumers.Xbmc.XbmcMetadata.OnSeriesUpdated (NzbDrone.Core.Tv.Series series, System.Collections.Generic.List1 existingMetadataFiles, System.Collections.Generic.List1 episodeFiles) [0x00000] in <filename unknown>:0 at NzbDrone.Core.Metadata.MetadataService.Handle (NzbDrone.Core.MediaCover.MediaCoversUpdatedEvent message) [0x00000] in <filename unknown>:0 at NzbDrone.Core.Messaging.Events.EventAggregator.PublishEvent[MediaCoversUpdatedEvent] (NzbDrone.Core.MediaCover.MediaCoversUpdatedEvent event) [0x00000] in <filename unknown>:0

Sorry could you run drone with mono --debug /path/to/NzbDrone.exe, line numbers will be important.

Hmm, I thought I already was…

Tried it several times and that’s the only log I get, both via the interface and the file. Definitely started with the debug command…

Ok, I realised I hadn’t enabled debug in the Settings of the interface (that’s what I get for doing this at 7am), so I’ve done that now. Still, there’s nothing new in the Table section of the interface, and I think there’s another error with the file logs. I have three in there now, and when trying to switch between them (to find the latest one), it gives me:

app.js: 57630 Uncaught TypeError: Cannot call method 'show' of undefined.

I tried deleting the logs to start fresh, and that gives:

app.js: 57649 Uncaught TypeError: Cannot call method 'close' of undefined.

I was able to use the Download button to view the latest log, but after kicking off a series refresh, which shows the initial error in the interface log, there’s no mention of it in the file. On trying to download one of the other files it takes me to a page with just:

{
“message”: “NotFound”
}

Refresh the UI, those are all UI errors, usually timing issues.

Yep, you’re quite right. Ok, so mono running with the debug flag, debug set in drone settings. Series refresh for HIMYM gives this in the file log:

http://pastebin.com/k8W49ZDh

Still not seeing the line numbers, doesn’t seem like mono is running with --debug

Yep. Not sure what else to try though :). Definitely ran it with debug (and a message in the file log mentions mono running in “soft debug”, so not sure if that’s correct).;

Could you zip and PM me your db?

Sure, give me 15 mins

Ok, sent it through, let me know if you need anything else

Just interested if this was solved for @simonk83 in any way. I’m experiencing the same errors. I’m on latest stable build on synology.

here is the log:

Message
MetadataService failed while processing [MediaCoversUpdatedEvent]: Sequence contains more than one matching element

Exception
System.InvalidOperationException: Sequence contains more than one matching element
  at System.Linq.Enumerable.Single[MetadataFile] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback) [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable.SingleOrDefault[MetadataFile] (IEnumerable`1 source, System.Func`2 predicate) [0x00000] in <filename unknown>:0 
  at NzbDrone.Core.Metadata.MetadataService.ProcessEpisodeMetadata (IMetadata consumer, NzbDrone.Core.Tv.Series series, NzbDrone.Core.MediaFiles.EpisodeFile episodeFile, System.Collections.Generic.List`1 existingMetadataFiles) [0x00000] in <filename unknown>:0 
  at NzbDrone.Core.Metadata.MetadataService.Handle (NzbDrone.Core.MediaCover.MediaCoversUpdatedEvent message) [0x00000] in <filename unknown>:0 
  at NzbDrone.Core.Messaging.Events.EventAggregator.PublishEvent[MediaCoversUpdatedEvent] (NzbDrone.Core.MediaCover.MediaCoversUpdatedEvent event) [0x00000] in <filename unknown>:0

@EvtK it is not the same issue, though the error message would be the same.

Try restarting drone and letting it run its cleanup on metadata files, it looks like you have two metadata files for the same episode causing issues.

@markus101 thanks for checking in. Is this cleanup on metadata files something I can start myself?

I did a search for *.xml on my tv folder. I noticed an episode existing in 2 qualities. I deleted one. Could this be part of the problem?

Drone should remove dupes on startup, or when the series is refreshed. The issue is two files on disk caused 2 files to be entered into drone’s DB, which resulted in this error on the next scan.

The develop branch has some fixes for metadata, but I’m not sure if it would fix this specific case.

checking in to report that, for the moment, the errors are gone, after I have finally found that duplicate *.xml file :smile:

thanks!