The DataMapper was unable to load the following field: 'LastInfoSync' value: ''. String was not recognized as a valid DateTime

Sonarr version: 3.0.6.1342 (Windows 11)

After returning from vacation, PC was in hung state. After reboot Sonarr has the below error when opening the UI

The DataMapper was unable to load the following field: ‘LastInfoSync’ value: ‘’. String was not recognized as a valid DateTime

Log entry
2022-02-12 13:18:18.7|Fatal|SonarrErrorPipeline|Request Failed. GET /api/v3/series

[v3.0.6.1342] Marr.Data.DataMappingException: The DataMapper was unable to load the following field: ‘LastInfoSync’ value: ‘’. String was not recognized as a valid DateTime. —> System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.ParseExactMultiple(String s, String[] formats, DateTimeFormatInfo dtfi, DateTimeStyles style)
at System.DateTime.ParseExact(String s, String[] formats, IFormatProvider provider, DateTimeStyles style)
at System.Data.SQLite.SQLiteConvert.ToDateTime(String dateText, SQLiteDateFormats format, DateTimeKind kind, String formatString)
at System.Data.SQLite.SQLite3.GetDateTime(SQLiteStatement stmt, Int32 index)
at System.Data.SQLite.SQLite3.GetValue(SQLiteStatement stmt, SQLiteConnectionFlags flags, Int32 index, SQLiteType typ)
at System.Data.SQLite.SQLiteDataReader.GetValue(Int32 i)
at Marr.Data.Mapping.MappingHelper.LoadExistingEntity(ColumnMapCollection mappings, DbDataReader reader, Object ent, Boolean useAltName) in M:\BuildAgent\work\63739567f01dbcc2\src\Marr.Data\Mapping\MappingHelper.cs:line 53
— End of inner exception stack trace —
at Marr.Data.Mapping.MappingHelper.LoadExistingEntity(ColumnMapCollection mappings, DbDataReader reader, Object ent, Boolean useAltName) in M:\BuildAgent\work\63739567f01dbcc2\src\Marr.Data\Mapping\MappingHelper.cs:line 79
at Marr.Data.Mapping.MappingHelper.CreateAndLoadEntity[T](ColumnMapCollection mappings, DbDataReader reader, Boolean useAltName) in M:\BuildAgent\work\63739567f01dbcc2\src\Marr.Data\Mapping\MappingHelper.cs:line 25
at Marr.Data.DataMapper.Query[T](String sql, ICollection1 entityList, Boolean useAltName) in M:\BuildAgent\work\63739567f01dbcc2\src\Marr.Data\DataMapper.cs:line 577 at Marr.Data.QGen.QueryBuilder1.ToList() in M:\BuildAgent\work\63739567f01dbcc2\src\Marr.Data\QGen\QueryBuilder.cs:line 279
at NzbDrone.Core.Datastore.BasicRepository1.All() in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Datastore\BasicRepository.cs:line 61 at NzbDrone.Core.Tv.SeriesService.GetAllSeries() in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Tv\SeriesService.cs:line 158 at Sonarr.Api.V3.Series.SeriesModule.AllSeries() in M:\BuildAgent\work\63739567f01dbcc2\src\Sonarr.Api.V3\Series\SeriesModule.cs:line 117 at Sonarr.Http.REST.RestModule1.<set_GetResourceAll>b__33_0(Object options) in M:\BuildAgent\work\63739567f01dbcc2\src\Sonarr.Http\REST\RestModule.cs:line 124
at Nancy.NancyModule.<>c__DisplayClass14_01.<Get>b__0(Object args) at Nancy.NancyModule.<>c__DisplayClass16_01.b__0(Object args, CancellationToken ct)
at Nancy.Routing.Route`1.d__7.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nancy.Routing.DefaultRouteInvoker.d__2.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nancy.Routing.DefaultRequestDispatcher.d__5.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nancy.NancyEngine.d__22.MoveNext()

.

Looks like the DB is partially corrupt, restoring from a backup is easiest, https://wiki.servarr.com/en/sonarr/faq#how-do-i-backup-and-restore-sonarr but might result in some info lost depending on how old it is.

You could also open the SQlite DB in any tool capable of reading it and update the series there:

UPDATE Series SET LastInfoSync = '2022-01-01 00:00:00'

then start Sonarr back up and refresh all series.

Restored Database and this has fixed the issue.

Many thanks for the help

1 Like

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