Cannot import files

Hi,

See below for my logs.
I keep getting import errors on my files.
There’s something odd with sonarr getting media info.
The video fps is somehow doubled?
E.g. it should be 23.976 instead of 2323…976976.

Media info itself is reporting 23.976.

This on OS X 10.9, with the latest develop and mono 3.10.0

Error occurred while executing task NzbDrone.Core.MediaFiles.Commands.DownloadedEpisodesScanCommand: The DataMapper was unable to load the following field: 'MediaInfo' value: '{ "videoCodec": "AVC", "videoBitrate": 5045093, "width": 1280, "height": 720, "audioFormat": "AC-3", "audioBitrate": 384000, "runTime": "00:42:34.0960000", "audioStreamCount": 1, "audioChannels": 6, "audioProfile": "", "videoFps": 2323..976976, "audioLanguages": "English", "subtitles": "", "scanType": "Progressive" }'. Input string '2323..976976' is not a valid decimal. Path 'videoFps', line 12, position 27.

  "videoCodec": "AVC",
  "videoBitrate": 5045093,
  "width": 1280,
  "height": 720,
  "audioFormat": "AC-3",
  "audioBitrate": 384000,
  "runTime": "00:42:34.0960000",
  "audioStreamCount": 1,
  "audioChannels": 6,
  "audioProfile": "",
  "videoFps": 2323..976976,
  "audioLanguages": "English",
  "subtitles": "",
  "scanType": "Progressive"
}'. Input string '2323..976976' is not a valid decimal. Path 'videoFps', line 12, position 27. ---> Newtonsoft.Json.JsonReaderException: Input string '2323..976976' is not a valid decimal. Path 'videoFps', line 12, position 27.
  at Newtonsoft.Json.JsonTextReader.ParseNumber () [0x00000] in <filename unknown>:0 
  at Newtonsoft.Json.JsonTextReader.ParseValue () [0x00000] in <filename unknown>:0 
  at Newtonsoft.Json.JsonTextReader.ReadInternal () [0x00000] in <filename unknown>:0 
  at Newtonsoft.Json.JsonReader.ReadAsDecimalInternal () [0x00000] in <filename unknown>:0 
  at Newtonsoft.Json.JsonTextReader.ReadAsDecimal () [0x00000] in <filename unknown>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonContract contract, Boolean hasConverter) [0x00000] in <filename unknown>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject (System.Object newObject, Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty member, System.String id) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Marr.Data.Mapping.MappingHelper.LoadExistingEntity (Marr.Data.Mapping.ColumnMapCollection mappings, System.Data.Common.DbDataReader reader, System.Object ent, Boolean useAltName) [0x000b1] in m:\BuildAgent\work\6c3239faf2b92630\src\Marr.Data\Mapping\MappingHelper.cs:79 
  at Marr.Data.Mapping.MappingHelper.CreateAndLoadEntity (System.Type entityType, Marr.Data.Mapping.ColumnMapCollection mappings, System.Data.Common.DbDataReader reader, Boolean useAltName) [0x00012] in m:\BuildAgent\work\6c3239faf2b92630\src\Marr.Data\Mapping\MappingHelper.cs:40 
  at Marr.Data.Mapping.MappingHelper.CreateAndLoadEntity[EpisodeFile] (Marr.Data.Mapping.ColumnMapCollection mappings, System.Data.Common.DbDataReader reader, Boolean useAltName) [0x00000] in m:\BuildAgent\work\6c3239faf2b92630\src\Marr.Data\Mapping\MappingHelper.cs:25 
  at Marr.Data.DataMapper.Query[EpisodeFile] (System.String sql, ICollection`1 entityList, Boolean useAltName) [0x0008d] in m:\BuildAgent\work\6c3239faf2b92630\src\Marr.Data\DataMapper.cs:577 
  at Marr.Data.QGen.QueryBuilder`1[NzbDrone.Core.MediaFiles.EpisodeFile].ToList () [0x00052] in m:\BuildAgent\work\6c3239faf2b92630\src\Marr.Data\QGen\QueryBuilder.cs:279 
  at Marr.Data.QGen.SortBuilder`1[NzbDrone.Core.MediaFiles.EpisodeFile].ToList () [0x00000] in m:\BuildAgent\work\6c3239faf2b92630\src\Marr.Data\QGen\SortBuilder.cs:176 
  at NzbDrone.Core.MediaFiles.MediaFileRepository.GetFilesBySeries (Int32 seriesId) [0x0000d] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\MediaFiles\MediaFileRepository.cs:25 
  at NzbDrone.Core.MediaFiles.MediaFileService.GetFilesBySeries (Int32 seriesId) [0x00000] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\MediaFiles\MediaFileService.cs:64 
  at NzbDrone.Core.MediaFiles.MediaFileService.FilterExistingFiles (System.Collections.Generic.List`1 files, NzbDrone.Core.Tv.Series series) [0x0000d] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\MediaFiles\MediaFileService.cs:79 
  at NzbDrone.Core.MediaFiles.EpisodeImport.ImportDecisionMaker.GetImportDecisions (System.Collections.Generic.List`1 videoFiles, NzbDrone.Core.Tv.Series series, NzbDrone.Core.Parser.Model.ParsedEpisodeInfo folderInfo, Boolean sceneSource) [0x00000] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\MediaFiles\EpisodeImport\ImportDecisionMaker.cs:58 
  at NzbDrone.Core.MediaFiles.DownloadedEpisodesImportService.ProcessFolder (System.IO.DirectoryInfo directoryInfo, NzbDrone.Core.Tv.Series series, NzbDrone.Core.Download.DownloadClientItem downloadClientItem) [0x000b7] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\MediaFiles\DownloadedEpisodesImportService.cs:142 
  at NzbDrone.Core.MediaFiles.DownloadedEpisodesImportService.ProcessFolder (System.IO.DirectoryInfo directoryInfo, NzbDrone.Core.Download.DownloadClientItem downloadClientItem) [0x00048] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\MediaFiles\DownloadedEpisodesImportService.cs:106 
  at NzbDrone.Core.MediaFiles.DownloadedEpisodesImportService.ProcessRootFolder (System.IO.DirectoryInfo directoryInfo) [0x00024] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\MediaFiles\DownloadedEpisodesImportService.cs:58 
  at NzbDrone.Core.MediaFiles.DownloadedEpisodesCommandService.ProcessDroneFactoryFolder () [0x0004f] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\MediaFiles\DownloadedEpisodesCommandService.cs:54 
  at NzbDrone.Core.MediaFiles.DownloadedEpisodesCommandService.Execute (NzbDrone.Core.MediaFiles.Commands.DownloadedEpisodesScanCommand message) [0x00017] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\MediaFiles\DownloadedEpisodesCommandService.cs:97 
  at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommand[DownloadedEpisodesScanCommand] (NzbDrone.Core.Messaging.Commands.Command command) [0x00099] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Messaging\Commands\CommandExecutor.cs:131`` `

How long have you been running mono 3.10?

We saw this before with mono 3.4, but haven’t seen it since 3.6 was released.

The problem has been persistent for months now.
Maybe there are some compiler options that makes mono different on linux than on OS X? I will checkout compiling from source to see if it makes a difference (I also did upgrade to 3.12.0 to make sure that maybe it was resolved)

I did try to solve it, but I wasn’t familiar with debugging/compiling with mono.
I’ll look into it again.

The problem occurred in mono 3.4, which corrupted your database. Updating to a mono 3.12 won’t fix it coz your db is already corrupt.
Only thing you can do is either manually repair the db via a sqlite editor, or start with a clean db.

(Just for the record, we’re talking about a critical bug in mono 3.4, corrupting any application that does string processing on multiple threads)

Aw ok, I see.

Is it a relatively easy fix?
What do I need to do?

The database itself is 26MB.

Would it just be easier to just use a clean db? Or is it to change a single line somewhere in the db?

That entirely depends on your technical expertise. To fix the errors you need to use a sqlite editor to fix those mangled json fields. Yes, that will require some work.
Easier is to start with a clean db, but that means you’ll have to configure everything again.