Sonnar issue with mono?

Sonarr version (exact version): 2.0.0.5321
Mono version (if Sonarr is not running on Windows):5.20.1.19
OS: Centos 7
Debug logs:

19-5-13 15:33:57.5|Info|Database|Vacuuming Log database 19-5-13 15:33:57.6|Info|Database|Log database compressed 19-5-13 15:34:18.9|Info|SceneMappingService|Updating Scene mappings 19-5-13 15:34:21.8|Info|RefreshSeriesService|Updating Info for Supergirl 19-5-13 15:34:21.9|Error|RefreshSeriesService|Couldn't refresh info for [295759][Supergirl] [v2.0.0.5321] System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct. at System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) [0x00105] in <47d423fd1d4342b9832b2fe1f5d431eb>:0 at System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) [0x00000] in <47d423fd1d4342b9832b2fe1f5d431eb>:0 at Marr.Data.Reflection.SimpleReflectionStrategy.GetMember (System.Type entityType, System.String name) [0x0000d] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.Reflection.SimpleReflectionStrategy.GetFieldValue (System.Object entity, System.String fieldName) [0x00006] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.WhereBuilder`1[T].GetRightValue (System.Linq.Expressions.Expression rightExpression) [0x00082] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.WhereBuilder`1[T].VisitMemberAccess (System.Linq.Expressions.MemberExpression expression) [0x00065] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.ExpressionVisitor.Visit (System.Linq.Expressions.Expression expression) [0x00109] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.WhereBuilder`1[T].VisitBinary (System.Linq.Expressions.BinaryExpression expression) [0x0004b] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.ExpressionVisitor.Visit (System.Linq.Expressions.Expression expression) [0x000e2] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.ExpressionVisitor.VisitLamda (System.Linq.Expressions.LambdaExpression lambdaExpression) [0x00007] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.ExpressionVisitor.Visit (System.Linq.Expressions.Expression expression) [0x000c8] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.WhereBuilder`1[T]..ctor (System.Data.Common.DbCommand command, Marr.Data.QGen.Dialects.Dialect dialect, System.Linq.Expressions.Expression filter, Marr.Data.QGen.TableCollection tables, System.Boolean useAltName, System.Boolean tablePrefix) [0x0006f] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.UpdateQueryBuilder`1[T].BuildQuery () [0x00066] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.UpdateQueryBuilder`1[T].Execute () [0x00008] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.DataMapper.Update[T] (T entity, System.Linq.Expressions.Expression`1[TDelegate] filter) [0x00012] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at NzbDrone.Core.Datastore.BasicRepository`1[TModel].Update (TModel model) [0x000ac] in <137b3ec2c1e744469c5f7b6367a60114>:0 at NzbDrone.Core.Tv.SeriesService.UpdateSeries (NzbDrone.Core.Tv.Series series, System.Boolean updateEpisodesToMatchSeason) [0x000a9] in <137b3ec2c1e744469c5f7b6367a60114>:0 at NzbDrone.Core.Tv.RefreshSeriesService.RefreshSeriesInfo (NzbDrone.Core.Tv.Series series) [0x00213] in <137b3ec2c1e744469c5f7b6367a60114>:0 at NzbDrone.Core.Tv.RefreshSeriesService.Execute (NzbDrone.Core.Tv.Commands.RefreshSeriesCommand message) [0x00043] in <137b3ec2c1e744469c5f7b6367a60114>:0 19-5-13 15:34:22.0|Info|DiskScanService|Scanning disk for Supergirl 19-5-13 15:34:22.7|Info|DiskScanService|Completed scanning disk for Supergirl 19-5-13 15:34:22.9|Info|ExistingMetadataImporter|Found 0 existing metadata files 19-5-13 15:34:23.0|Info|ExistingSubtitleImporter|Found 0 existing subtitle files 19-5-13 15:34:23.0|Info|ExistingOtherExtraImporter|Found 0 existing other extra files 19-5-13 15:34:23.0|Info|ExistingExtraFileService|Found 0 extra files 19-5-13 15:34:23.2|Error|CommandExecutor|Error occurred while executing task RefreshSeries [v2.0.0.5321] System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct. at System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) [0x00105] in <47d423fd1d4342b9832b2fe1f5d431eb>:0 at System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) [0x00000] in <47d423fd1d4342b9832b2fe1f5d431eb>:0 at Marr.Data.Reflection.SimpleReflectionStrategy.GetMember (System.Type entityType, System.String name) [0x0000d] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.Reflection.SimpleReflectionStrategy.GetFieldValue (System.Object entity, System.String fieldName) [0x00006] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.WhereBuilder`1[T].GetRightValue (System.Linq.Expressions.Expression rightExpression) [0x00082] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.WhereBuilder`1[T].VisitMemberAccess (System.Linq.Expressions.MemberExpression expression) [0x00065] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.ExpressionVisitor.Visit (System.Linq.Expressions.Expression expression) [0x00109] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.WhereBuilder`1[T].VisitBinary (System.Linq.Expressions.BinaryExpression expression) [0x0004b] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.ExpressionVisitor.Visit (System.Linq.Expressions.Expression expression) [0x000e2] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.ExpressionVisitor.VisitLamda (System.Linq.Expressions.LambdaExpression lambdaExpression) [0x00007] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.ExpressionVisitor.Visit (System.Linq.Expressions.Expression expression) [0x000c8] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.WhereBuilder`1[T]..ctor (System.Data.Common.DbCommand command, Marr.Data.QGen.Dialects.Dialect dialect, System.Linq.Expressions.Expression filter, Marr.Data.QGen.TableCollection tables, System.Boolean useAltName, System.Boolean tablePrefix) [0x0006f] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.UpdateQueryBuilder`1[T].BuildQuery () [0x00066] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.QGen.UpdateQueryBuilder`1[T].Execute () [0x00008] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at Marr.Data.DataMapper.Update[T] (T entity, System.Linq.Expressions.Expression`1[TDelegate] filter) [0x00012] in <ac88d4c7d40646cb868971dc91f05a9e>:0 at NzbDrone.Core.Datastore.BasicRepository`1[TModel].Update (TModel model) [0x000ac] in <137b3ec2c1e744469c5f7b6367a60114>:0 at NzbDrone.Core.Tv.SeriesService.UpdateSeries (NzbDrone.Core.Tv.Series series, System.Boolean updateEpisodesToMatchSeason) [0x000a9] in <137b3ec2c1e744469c5f7b6367a60114>:0 at NzbDrone.Core.Tv.RefreshSeriesService.RefreshSeriesInfo (NzbDrone.Core.Tv.Series series) [0x00213] in <137b3ec2c1e744469c5f7b6367a60114>:0 at NzbDrone.Core.Tv.RefreshSeriesService.Execute (NzbDrone.Core.Tv.Commands.RefreshSeriesCommand message) [0x00072] in <137b3ec2c1e744469c5f7b6367a60114>:0 at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommand[TCommand] (TCommand command, NzbDrone.Core.Messaging.Commands.CommandModel commandModel) [0x000f6] in <137b3ec2c1e744469c5f7b6367a60114>:0 at (wrapper dynamic-method) System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,NzbDrone.Core.Messaging.Commands.CommandExecutor,object,NzbDrone.Core.Messaging.Commands.CommandModel) at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1, T2 arg2) [0x0008b] in <0875c9f497904fb9bb2a658e3c91a6eb>:0 at (wrapper dynamic-method) System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,NzbDrone.Core.Messaging.Commands.CommandExecutor,object,NzbDrone.Core.Messaging.Commands.CommandModel) at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommands () [0x0008c] in <137b3ec2c1e744469c5f7b6367a60114>:0

Description of issue:

When rescanning disk this happens.

Permissions are the same as they were since a few years ago.

All of the sudden this happens.

Before this situation i’ve detected that Sonarr Does “hang” a lot when requesting pages, sometimes over a minute.

Also it does re-download episodes where cutoff was meet already, most of the times it does download the same episode multiple times.

Changed done recently, moved from Torrent to NZB

Please upload the debug log elsewhere and link it here as requested, the format of that block is impossible to read properly.

Sonarr.txt -> https://pastebin.com/uAZpQhpe

Not sure what the issue is with that particular error, that code hasn’t changed in a long time.

Did it only start happening after upgrading to mono 5.20? Downgrading to 5.18 would be a good first step.

You should also run mono with the --debug switch to include line numbers in exceptions (though I don’t think that give us much help here).

been on mono 5.20 for a while now issues, it started today :frowning:

however it handles everything perfectly. only disk rescan fails wich is strange.

It’s failing to update the DB, but I’ve never seen that before and that hasn’t changed in months. Not sure what else to try.

Ok.

I will follow this situation.

I will backup the DB and finish updating my library, once that is done i will reinstall from scratch and try either a blank DB ou restoring my own.

In theory if its a DB issue restoring will cause the same issue.

However if it was an issue with DB it would not write the new episodes correctly, so its even more strange.

does sonarrs code try to sort out concurrency issues or just barf out the error? there is this https://docs.microsoft.com/en-us/ef/core/saving/concurrency

there was a mention somewhere else of upgrading EF Core to the latest version (didnt state a specific version) to resolve it as well but that was for another piece of software so not sure if that would be helpful (or not)

seems more like an underlying db bug than a sonarr issue as it would be hard for two refresh processes (if that somehow happened) to run at exactly the same time, and then stay in sync, for the db writes to always hit a concurrency error, they should get out of sync very quickly and no longer have an issue with writing to the db at the same time. the logs show a couple of doubled up refreshes but theyre two seconds apart so shouldnt be an issue.

the above is just guesswork, it could be complete unrelated garbage

Is there a more stable Mono verison we should revert back to? I’m noticing Sonarr is incredibly slow since upgrade Mono to the latest version. Radarr has been slow too.

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