Series Refresh not working 100%

Sonarr version (exact version): 4.0.14.2939
Mono version (if Sonarr is not running on Windows):
OS: Linuxserver.io 4.0.14.2939-ls281 docker on Ubuntu 22.04.05 LTS running on a VM with 4 cores of an AMD 3900x 8gb ram
Debug logs: Coming Soon
Description of issue:
Hello,

I am digging into some odd behavior I have been seeing with my one sonarr containers. It appears that sometimes it does not refresh the metadata for some of my series. As I am writing this I am guessing this is more than likely a me issue how I am trying to use sonarr and/or a config issue.

Originally I had one instance that handled all my anime and tv. I was fine with sonarr doing its thing for tv but my anime I wanted to handle collecting the files myself and only use sonarr to manage renaming and give a visual for missing files. I had started noticing issues where it would be 3 days after an episode would air and sonarr would still not have the episode in the meta, so I would refresh the series and the new episode would show up and this would be the case after the Refresh Series scheduled task would run. I started questioning if this might be related to the DB being messed up as I do get errors on refresh and have had to recover/repair the db multiple times over the years and had to do some bad things to get v4 to work.

After considering the fact that the DB might be screwed I started a second sonarr instance and moved all my standard shows over to it manually which was fun for 532 shows. But once I started thinking about moving the 1680 anime I questioned life itself and thought about trying to see why this is happening. As part of that I was noticing that when the Series Refresh job runs on its own it takes 30sec but if I manually run it it takes 30min and actually refreshes what was missed in the scheduled run. While writing this I realize that this has to do with basically all the anime being set to unmonitored since I do not want sonarr to search indexers for them. This has me guessing that the scheduled run only processes monitored to reduce overall load on sonarr and calls to thetvdb.

If my theory is correct I am guessing that removing indexers from the anime instance and setting the series I care about to monitored would resolve this issue. Has anyone else run into this issue and/or have ideas on how to handle this better?

Below are a few sample errors I see all the time in the logs on my anime instance. If it is recommended to just rebuild the DB is there a faster way to import my library in to the new DB as the “Library Import” feature requires me to check each and every series to ensure the correct match is found (yes I need to clean up folder names to resolve this)? I had thought about using the api and getting all my series with their tvdb id and location and then using that to add the series to the new instance with the api.

—> System.Text.Json.JsonException: ‘w’ is an invalid escapable character within a JSON string. The string should be correctly escaped. Path: $.rawStreamData | LineNumber: 1 | BytePositionInLine: 125875.

[v4.0.14.2939] System.Data.DataException: Error parsing column 12 (AirDateUtc=0 - Int64)
—> System.FormatException: String ‘2019-04
19 14:00:00Z’ was not recognized as a valid DateTime.

No, monitored or not doesn’t make a difference, but ended shows are only refreshed every 30 days via the scheduled update, if you run it manually everything will be checked.

Just the errors isn’t enough to debug those issues, but once you identify the series afftected you can probably update the relevant tables to fix the data.

here is the logs from this morning.

An example would be The Gorilla God’s Go-To Girl s01e06, looking at the tvdb it was updated May 11th, as of this morning 8:03 am when the refresh happened this was not refreshed. when I ran the refresh and scan directly on the series it grabbed the new data. Also The Unaware Atelier Meister s01e07,
Yandere Dark Elf: She Chased Me All the Way From Another World s01e06 seem to be in the same state.

https://www.thetvdb.com/series/gorilla-no-kami-kara-kago-sareta-reijou-wa-ouritsu-kishidan-de-kawaigarareru/episodes/11061764

Whichever series comes after Bungo and Alchemist -Gears of Judgement- seems to be broken to the point that Sonarr fails to refresh all series.

2025-05-12 08:03:01.8|Info|RefreshSeriesService|Skipping refresh of series: Bungo and Alchemist -Gears of Judgement-
...
2025-05-12 08:03:01.8|Error|CommandExecutor|Error occurred while executing task RefreshSeries

[v4.0.14.2939] System.Data.DataException: Error parsing column 12 (AirDateUtc=0 - Int64)
 ---> System.FormatException: String '2019-04
19 14:00:00Z' was not recognized as a valid DateTime.
   at System.DateTimeParse.ParseExactMultiple(ReadOnlySpan`1 s, String[] formats, DateTimeFormatInfo dtfi, 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 Deserializef6e4397d-64f1-478d-be32-a92a76391757(IDataReader )
   --- End of inner exception stack trace ---
   at Dapper.SqlMapper.ThrowDataException(Exception ex, Int32 index, IDataReader reader, Object value) in /_/Dapper/SqlMapper.cs:line 3706
   at Deserializef6e4397d-64f1-478d-be32-a92a76391757(IDataReader )
   at Dapper.SqlMapper.QueryImpl[T](IDbConnection cnn, CommandDefinition command, Type effectiveType)+MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Dapper.SqlMapper.Query[T](IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Boolean buffered, Nullable`1 commandTimeout, Nullable`1 commandType)
   at NzbDrone.Core.Datastore.SqlMapperExtensions.Query[T](IDatabase db, String sql, Object param)
   at NzbDrone.Core.Datastore.BasicRepository`1.Query(SqlBuilder builder)
   at NzbDrone.Core.Tv.EpisodeRepository.GetEpisodes(Int32 seriesId)
   at NzbDrone.Core.Tv.EpisodeService.GetEpisodeBySeries(Int32 seriesId)
   at NzbDrone.Core.Tv.ShouldRefreshSeries.ShouldRefresh(Series series)
   at NzbDrone.Core.Tv.RefreshSeriesService.Execute(RefreshSeriesCommand message)
   at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommand[TCommand](TCommand command, CommandModel commandModel)
   at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommands()

The easiest solution would be to remove and then re-add that series (whatever it is), you’ll likely see a similar error if you try to go to the details screen for it.

If you want a more surgical solution you can open the DB in your editor of choice, find the affected episode and fix the date for the affected episode after locating it.

Thanks for that. Looks like I had another 30 in that state. I think I have them all fixed, but I am still really considering rebuilding the db do some not nice things in the db to move from 3 to 4, so this is either caused by that or was stuff that broke over the years