Sonarr version (exact version): 3.0.9.1549
Mono version (if Sonarr is not running on Windows):
OS: Windows 11 22H2
Debug logs:
Description of issue: Keep having to reinstall Sonarr because I am getting a database error and it will not start. Reinstalling Sonarr on top of itself always solves the issue without having to restore the database. It will run for a week or two without issue, but this keeps happening. I’ve had to reinstall it 5 or 6 times now. The database is in the default location on the Windows system drive.
at System.BaseConfigHandler.RunParser(String fileName)
at System.ConfigTreeParser.Parse(String fileName, String configPath, Boolean skipSecurityStuff)
— End of inner exception stack trace —
at System.ConfigTreeParser.Parse(String fileName, String configPath, Boolean skipSecurityStuff)
at System.Security.Cryptography.CryptoConfig.OpenCryptoConfig()
at System.Security.Cryptography.CryptoConfig.InitializeConfigInfo()
at System.Security.Cryptography.CryptoConfig.CreateFromName(String name, Object[] args)
at System.Security.Cryptography.RandomNumberGenerator.Create()
at System.MarvinHash.GenerateSeed()
at System.MarvinHash…cctor()
— End of inner exception stack trace —
at System.Xml.NameTable…ctor()
at System.Xml.XmlTextReaderImpl…ctor(XmlResolver resolver, XmlReaderSettings settings, XmlParserContext context)
at System.Xml.XmlTextReaderImpl…ctor(TextReader input, XmlReaderSettings settings, String baseUriStr, XmlParserContext context)
at System.Xml.XmlReaderSettings.CreateReader(TextReader input, String baseUriString, XmlParserContext inputContext)
at System.Xml.XmlReader.Create(TextReader input, XmlReaderSettings settings, String baseUri)
at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options)
at NzbDrone.Core.Configuration.ConfigFileProvider.LoadConfigFile() in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Configuration\ConfigFileProvider.cs:line 356
at NzbDrone.Core.Configuration.ConfigFileProvider.<>c__DisplayClass55_0.b__0() in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Configuration\ConfigFileProvider.cs:line 254
at NzbDrone.Common.Cache.Cached1.Get(String key, Func
1 function, Nullable1 lifeTime) in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Common\Cache\Cached.cs:line 104 at NzbDrone.Core.Configuration.ConfigFileProvider.GetValue(String key, Object defaultValue, Boolean persist) in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Configuration\ConfigFileProvider.cs:line 252 at NzbDrone.Core.Configuration.ConfigFileProvider.get_LogLevel() in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Configuration\ConfigFileProvider.cs:line 186 at NzbDrone.Core.Instrumentation.ReconfigureLogging.Reconfigure() in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Instrumentation\ReconfigureLogging.cs:line 27 at NzbDrone.Host.Bootstrap.Start(ApplicationModes applicationModes, StartupContext startupContext) in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Host\Bootstrap.cs:line 66 at NzbDrone.Host.Bootstrap.Start(StartupContext startupContext, IUserAlert userAlert, Action
1 startCallback) in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Host\Bootstrap.cs:line 41
at NzbDrone.Console.ConsoleApp.Main(String[] args) in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Console\ConsoleApp.cs:line 42
2023-02-15 09:23:10.9|Info|Bootstrap|Starting Sonarr - C:\ProgramData\Sonarr\bin\Sonarr.exe - Version 3.0.9.1549
2023-02-15 09:23:11.8|Info|Router|Application mode: Interactive
2023-02-15 09:23:12.1|Info|MigrationLogger|*** Checking database for required migrations data source=C:\ProgramData\Sonarr\sonarr.db;cache size=-10000;datetimekind=Utc;journal mode=Wal;pooling=True;version=3 ***
2023-02-15 09:23:13.7|Fatal|WindowsApp|EPIC FAIL
[v3.0.9.1549] NzbDrone.Core.Datastore.CorruptDatabaseException: Database file: C:\ProgramData\Sonarr\sonarr.db is corrupt, restore from backup if available. See: Sonarr FAQ | WikiArr —> System.Data.SQLite.SQLiteException: unable to open database file
at System.Data.SQLite.SQLite3.Open(String strFilename, String vfsName, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, Int32 maxPoolSize, Boolean usePool)
at System.Data.SQLite.SQLiteConnection.Open()
at FluentMigrator.Runner.Processors.GenericProcessorBase.EnsureConnectionIsOpen()
at FluentMigrator.Runner.Processors.SQLite.SQLiteProcessor.Exists(String template, Object[] args)
at FluentMigrator.Runner.Processors.SQLite.SQLiteProcessor.TableExists(String schemaName, String tableName)
at FluentMigrator.Runner.VersionLoader.get_AlreadyCreatedVersionTable()
at FluentMigrator.Runner.VersionLoader.LoadVersionInfo()
at FluentMigrator.Runner.VersionLoader…ctor(IMigrationRunner runner, IAssemblyCollection assemblies, IMigrationConventions conventions)
at FluentMigrator.Runner.MigrationRunner…ctor(IAssemblyCollection assemblies, IRunnerContext runnerContext, IMigrationProcessor processor)
at NzbDrone.Core.Datastore.Migration.Framework.MigrationController.Migrate(String connectionString, MigrationContext migrationContext) in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Datastore\Migration\Framework\MigrationController.cs:line 60
at NzbDrone.Core.Datastore.DbFactory.CreateMain(String connectionString, MigrationContext migrationContext) in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Datastore\DbFactory.cs:line 117
— End of inner exception stack trace —
at NzbDrone.Core.Datastore.DbFactory.CreateMain(String connectionString, MigrationContext migrationContext) in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Datastore\DbFactory.cs:line 128
at NzbDrone.Core.Datastore.DbFactory.Create(MigrationContext migrationContext) in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Datastore\DbFactory.cs:line 82
at NzbDrone.Core.Datastore.DbFactory.Create(MigrationType migrationType) in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Datastore\DbFactory.cs:line 70
at NzbDrone.Core.Datastore.DbFactory.RegisterDatabase(IContainer container) in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Datastore\DbFactory.cs:line 48
at NzbDrone.Host.NzbDroneServiceFactory.Start() in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Host\ApplicationServer.cs:line 60
at NzbDrone.Host.Router.Route(ApplicationModes applicationModes) in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Host\Router.cs:line 56
at NzbDrone.Host.Bootstrap.Start(ApplicationModes applicationModes, StartupContext startupContext) in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Host\Bootstrap.cs:line 78
at NzbDrone.Host.Bootstrap.Start(StartupContext startupContext, IUserAlert userAlert, Action`1 startCallback) in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Host\Bootstrap.cs:line 41
at NzbDrone.WindowsApp.Main(String[] args) in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone\WindowsApp.cs:line 23