Error, "Unable to load episode files" when I try to view a series after the upgrade to 4.0.1.929

Is anyone able to assist with fixing the following issue?

Sonarr version (4.0.1.929):
OS: Ubuntu Server 20.04.6 LTS
Debug logs: Added sample below
Description of issue:
Getting the error, “Unable to load episode files” when I try to view a series after the upgrade to 4.0.1.929. This happens on everything I have.

2024-02-04 21:41:48.2|Error|DownloadDecisionMaker|Couldn’t evaluate decision on Test.Home.Movie.S01E01.1080p.x265

[v4.0.1.929] System.Data.DataException: Error parsing column 11 (Languages=[[
1
]] - String)
—> System.Text.Json.JsonException: The JSON value could not be converted to System.Collections.Generic.List1[NzbDrone.Core.Languages.Language]. Path: $[0] | LineNumber: 0 | BytePositionInLine: 2. ---> System.InvalidOperationException: Cannot get the value of a token type 'StartArray' as a number. at System.Text.Json.Utf8JsonReader.TryGetInt32(Int32& value) at System.Text.Json.Utf8JsonReader.GetInt32() at NzbDrone.Core.Datastore.Converters.LanguageIntConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) in ./Sonarr.Core/Datastore/Converters/LanguageIntConverter.cs:line 39 at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.JsonCollectionConverter2.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) --- End of inner exception stack trace --- at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 utf8Json, JsonTypeInfo jsonTypeInfo, Nullable1 actualByteCount)
at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 json, JsonTypeInfo jsonTypeInfo) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options) at Dapper.SqlMapper.TypeHandler1.Dapper.SqlMapper.ITypeHandler.Parse(Type destinationType, Object value) in /_/Dapper/SqlMapper.TypeHandler.cs:line 42
at Dapper.SqlMapper.TypeHandlerCache1.Parse(Object value) in /_/Dapper/SqlMapper.TypeHandlerCache.cs:line 23 at Deserialize455511ce-f617-4bf2-b33f-23b829451cbc(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 Deserialize455511ce-f617-4bf2-b33f-23b829451cbc(IDataReader ) at Dapper.SqlMapper.QueryImpl[T](IDbConnection cnn, CommandDefinition command, Type effectiveType)+MoveNext() at System.Collections.Generic.List1…ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Dapper.SqlMapper.Query[T](IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Boolean buffered, Nullable1 commandTimeout, Nullable1 commandType)
at NzbDrone.Core.Datastore.SqlMapperExtensions.Query[T](IDatabase db, String sql, Object param)
at NzbDrone.Core.Datastore.ColumnMapper1.<>c__DisplayClass8_01.b__0(IDatabase db, T parent)
at NzbDrone.Core.Datastore.LazyLoaded2.LazyLoad() at NzbDrone.Core.DecisionEngine.Specifications.UpgradeDiskSpecification.<>c.<IsSatisfiedBy>b__8_1(Episode c) at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext()
at NzbDrone.Core.DecisionEngine.Specifications.UpgradeDiskSpecification.IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
at NzbDrone.Core.DecisionEngine.DownloadDecisionMaker.EvaluateSpec(IDecisionEngineSpecification spec, RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteriaBase)

Something is definitely corrupt, as that value should be [1], not [[1]]. If it’s happening with every single series then you have a couple options:

  • Remove and re-add all series
  • Fix the issue via SQL editor, something like UPDATE EpisodeFiles SET Languages = '[1]' would reset the language for every file to just English.
2 Likes

THANK YOU!! that fixed my issue and saved me a few hours of removing and re-adding shows. ran the command in sql editor took a few seconds and all my series were fixed. Used SQLiteStudio opened database located in C:\ProgramData\Sonarr\sonarr.db entered in the command markus101 offered (UPDATE EpisodeFiles SET Languages = ‘[1]’) and clicked the run button. Took a few seconds and everything’s fixed.

1 Like

any other fixes, as have same issue, tried downgrade to older version but that didnt fix it either

If you have the same issue, that’s the only fix.

Thanks so much! That simple SQL edit also fixed the “unable to load episode files” issue for me.

Pro tip for anyone else who might be dumb or brand new to SQL editors: all you have to do is execute the command (UPDATE EpisodeFiles SET Languages = ‘[1]’), verify that things were modified and that there weren’t any errors in the status log, and then disconnect from the database. Took me longer than I’d like to admit to realize that you don’t have to save or export a ‘fixed’ DB - it’s already been modified as soon as the command is executed.

@markus101 Thanks, that resolved my issue.