Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prowlarr failed to start: Error creating main database #1807

Closed
2 tasks done
Snazzie opened this issue Jul 31, 2023 · 3 comments
Closed
2 tasks done

Prowlarr failed to start: Error creating main database #1807

Snazzie opened this issue Jul 31, 2023 · 3 comments
Labels
Area: Database Issue is related to the database Type: Support. (silent) Issue is a support request. Bot WILL NOT auto close and give a message.

Comments

@Snazzie
Copy link

Snazzie commented Jul 31, 2023

Is there an existing issue for this?

  • I have searched the existing open and closed issues

Current Behavior

failing to start

possibly related to #729

Expected Behavior

starts

Steps To Reproduce

  1. boot docker container.

Environment

- OS: unraid/docker
- Prowlarr: 1.7.4.3769
- Docker Install: yes
- Using Reverse Proxy: no
- Browser:

What branch are you running?

Master

Trace Logs?

2023-07-31 15:42:04.2|Debug|ProcessProvider|Found 0 processes with the name: Prowlarr.Console
2023-07-31 15:42:04.3|Debug|ProcessProvider|Found 1 processes with the name: Prowlarr
2023-07-31 15:42:04.3|Debug|ProcessProvider| - [61] Prowlarr
2023-07-31 15:42:04.3|Info|MigrationController|*** Migrating data source=/config/prowlarr/prowlarr.db;cache size=-20000;datetimekind=Utc;journal mode=Wal;pooling=True;version=3 ***
2023-07-31 15:42:06.6|Info|FluentMigrator.Runner.MigrationRunner|34: history_fix_data_titles migrating
2023-07-31 15:42:06.7|Info|NzbDrone.Core.Datastore.Migration.Framework.NzbDroneSQLiteProcessor|Beginning Transaction
2023-07-31 15:42:06.7|Info|history_fix_data_titles|Starting migration of Main DB to 34
2023-07-31 15:42:06.7|Info|FluentMigrator.Runner.MigrationRunner|PerformDBOperation 
2023-07-31 15:42:06.7|Info|NzbDrone.Core.Datastore.Migration.Framework.NzbDroneSQLiteProcessor|Performing DB Operation
2023-07-31 15:42:07.1|Error|FluentMigrator.Runner.MigrationRunner|Specified cast is not valid.

[v1.7.4.3769] System.InvalidCastException: Specified cast is not valid.
   at System.Data.SQLite.SQLiteDataReader.VerifyType(Int32 i, DbType typ)
   at System.Data.SQLite.SQLiteDataReader.GetString(Int32 i)
   at NzbDrone.Core.Datastore.Migration.history_fix_data_titles.MigrateHistoryDataTitle(IDbConnection conn, IDbTransaction tran) in ./Prowlarr.Core/Datastore/Migration/034_history_fix_data_titles.cs:line 33
   at FluentMigrator.Runner.Processors.SQLite.SQLiteProcessor.Process(PerformDBOperationExpression expression)
   at FluentMigrator.Expressions.PerformDBOperationExpression.ExecuteWith(IMigrationProcessor processor)
   at FluentMigrator.Runner.MigrationRunner.<>c__DisplayClass80_0.<ExecuteExpressions>b__1()
   at FluentMigrator.Runner.StopWatch.Time(Action action)
   at FluentMigrator.Runner.MigrationRunner.ExecuteExpressions(ICollection`1 expressions)


2023-07-31 15:42:07.2|Info|NzbDrone.Core.Datastore.Migration.Framework.NzbDroneSQLiteProcessor|Rolling back transaction
2023-07-31 15:42:07.2|Fatal|Microsoft.AspNetCore.Hosting.Diagnostics|Application startup exception

[v1.7.4.3769] NzbDrone.Common.Exceptions.ProwlarrStartupException: Prowlarr failed to start: Error creating main database
 ---> System.InvalidCastException: Specified cast is not valid.
   at System.Data.SQLite.SQLiteDataReader.VerifyType(Int32 i, DbType typ)
   at System.Data.SQLite.SQLiteDataReader.GetString(Int32 i)
   at NzbDrone.Core.Datastore.Migration.history_fix_data_titles.MigrateHistoryDataTitle(IDbConnection conn, IDbTransaction tran) in ./Prowlarr.Core/Datastore/Migration/034_history_fix_data_titles.cs:line 33
   at FluentMigrator.Runner.Processors.SQLite.SQLiteProcessor.Process(PerformDBOperationExpression expression)
   at FluentMigrator.Expressions.PerformDBOperationExpression.ExecuteWith(IMigrationProcessor processor)
   at FluentMigrator.Runner.MigrationRunner.<>c__DisplayClass80_0.<ExecuteExpressions>b__1()
   at FluentMigrator.Runner.StopWatch.Time(Action action)
   at FluentMigrator.Runner.MigrationRunner.ExecuteExpressions(ICollection`1 expressions)
   at FluentMigrator.Runner.MigrationRunner.ExecuteMigration(IMigration migration, Action`2 getExpressions)
   at FluentMigrator.Runner.MigrationRunner.ApplyMigrationUp(IMigrationInfo migrationInfo, Boolean useTransaction)
   at FluentMigrator.Runner.MigrationRunner.MigrateUp(Int64 targetVersion, Boolean useAutomaticTransactionManagement)
   at FluentMigrator.Runner.MigrationRunner.MigrateUp(Boolean useAutomaticTransactionManagement)
   at FluentMigrator.Runner.MigrationRunner.MigrateUp()
   at NzbDrone.Core.Datastore.Migration.Framework.MigrationController.Migrate(String connectionString, MigrationContext migrationContext) in ./Prowlarr.Core/Datastore/Migration/Framework/MigrationController.cs:line 79
   at NzbDrone.Core.Datastore.DbFactory.CreateMain(String connectionString, MigrationContext migrationContext) in ./Prowlarr.Core/Datastore/DbFactory.cs:line 115
   --- End of inner exception stack trace ---
   at NzbDrone.Core.Datastore.DbFactory.CreateMain(String connectionString, MigrationContext migrationContext) in ./Prowlarr.Core/Datastore/DbFactory.cs:line 161
   at NzbDrone.Core.Datastore.DbFactory.Create(MigrationContext migrationContext) in ./Prowlarr.Core/Datastore/DbFactory.cs:line 70
   at NzbDrone.Core.Datastore.DbFactory.Create(MigrationType migrationType) in ./Prowlarr.Core/Datastore/DbFactory.cs:line 58
   at NzbDrone.Core.Datastore.Extensions.CompositionExtensions.<>c.<AddDatabase>b__0_0(IDbFactory f) in ./Prowlarr.Core/Datastore/Extensions/CompositionExtensions.cs:line 10
   at DryIoc.Registrator.ToFuncWithObjParams[D1,TService](Func`2 f, Object d1) in /_/src/DryIoc/Container.cs:line 7977
   at DryIoc.Interpreter.TryInterpretFuncInvoke(IResolverContext r, MethodCallExpression e, IParameterProvider paramExprs, Object paramValues, ParentLambdaArgs parentArgs, Object& result) in /_/src/DryIoc/Container.cs:line 3680
   at DryIoc.Interpreter.TryInterpretMethodCall(IResolverContext r, MethodCallExpression callExpr, IParameterProvider paramExprs, Object paramValues, ParentLambdaArgs parentArgs, Object& result) in /_/src/DryIoc/Container.cs:line 3478
   at DryIoc.Interpreter.TryInterpret(IResolverContext r, Expression expr, IParameterProvider paramExprs, Object paramValues, ParentLambdaArgs parentArgs, Object& result) in /_/src/DryIoc/Container.cs:line 3129
   at DryIoc.Interpreter.TryInterpretSingletonAndUnwrapContainerException(IResolverContext r, Expression expr, ImMapEntry`1 itemRef, Object& result) in /_/src/DryIoc/Container.cs:line 3058
   at DryIoc.Factory.ApplyReuse(Expression serviceExpr, Request request) in /_/src/DryIoc/Container.cs:line 11017
   at DryIoc.Factory.GetExpressionOrDefault(Request request) in /_/src/DryIoc/Container.cs:line 10936
   at DryIoc.Container.ResolveAndCacheKeyed(Int32 serviceTypeHash, Type serviceType, Object serviceKey, IfUnresolved ifUnresolved, Object scopeName, Type requiredServiceType, Request preResolveParent, Object[] args) in /_/src/DryIoc/Container.cs:line 535
   at DryIoc.Container.DryIoc.IResolver.Resolve(Type serviceType, Object serviceKey, IfUnresolved ifUnresolved, Type requiredServiceType, Request preResolveParent, Object[] args) in /_/src/DryIoc/Container.cs:line 463
   at DryIoc.Interpreter.TryInterpretMethodCall(IResolverContext r, MethodCallExpression callExpr, IParameterProvider paramExprs, Object paramValues, ParentLambdaArgs parentArgs, Object& result) in /_/src/DryIoc/Container.cs:line 3614
   at DryIoc.Interpreter.TryInterpret(IResolverContext r, Expression expr, IParameterProvider paramExprs, Object paramValues, ParentLambdaArgs parentArgs, Object& result) in /_/src/DryIoc/Container.cs:line 3141
   at DryIoc.Interpreter.TryInterpretNestedLambdaBodyAndUnwrapException(IResolverContext r, Expression bodyExpr, IParameterProvider paramExprs, Object paramValues, ParentLambdaArgs parentArgs) in /_/src/DryIoc/Container.cs:line 3424
   at DryIoc.Interpreter.<>c__DisplayClass5_0.<TryInterpretNestedLambda>b__0() in /_/src/DryIoc/Container.cs:line 3323
   at DryIoc.Interpreter.<>c__DisplayClass9_0`1.<ConvertFunc>b__0() in /_/src/DryIoc/Container.cs:line 3434
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at NzbDrone.Host.Startup.Configure(IApplicationBuilder app, IStartupContext startupContext, Lazy`1 mainDatabaseFactory, Lazy`1 logDatabaseFactory, DatabaseTarget dbTarget, ISingleInstancePolicy singleInstancePolicy, InitializeLogger initializeLogger, ReconfigureLogging reconfigureLogging, IAppFolderFactory appFolderFactory, IProvidePidFile pidFileProvider, IConfigFileProvider configFileProvider, IRuntimeInfo runtimeInfo, IFirewallAdapter firewallAdapter, IEventAggregator eventAggregator, ProwlarrErrorPipeline errorHandler) in ./Prowlarr.Host/Startup.cs:line 235
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass15_0.<UseStartup>b__1(IApplicationBuilder app)
   at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)


2023-07-31 15:42:07.5|Fatal|ConsoleApp|EPIC FAIL!

[v1.7.4.3769] NzbDrone.Common.Exceptions.ProwlarrStartupException: Prowlarr failed to start: Error creating main database
 ---> System.InvalidCastException: Specified cast is not valid.
   at System.Data.SQLite.SQLiteDataReader.VerifyType(Int32 i, DbType typ)
   at System.Data.SQLite.SQLiteDataReader.GetString(Int32 i)
   at NzbDrone.Core.Datastore.Migration.history_fix_data_titles.MigrateHistoryDataTitle(IDbConnection conn, IDbTransaction tran) in ./Prowlarr.Core/Datastore/Migration/034_history_fix_data_titles.cs:line 33
   at FluentMigrator.Runner.Processors.SQLite.SQLiteProcessor.Process(PerformDBOperationExpression expression)
   at FluentMigrator.Expressions.PerformDBOperationExpression.ExecuteWith(IMigrationProcessor processor)
   at FluentMigrator.Runner.MigrationRunner.<>c__DisplayClass80_0.<ExecuteExpressions>b__1()
   at FluentMigrator.Runner.StopWatch.Time(Action action)
   at FluentMigrator.Runner.MigrationRunner.ExecuteExpressions(ICollection`1 expressions)
   at FluentMigrator.Runner.MigrationRunner.ExecuteMigration(IMigration migration, Action`2 getExpressions)
   at FluentMigrator.Runner.MigrationRunner.ApplyMigrationUp(IMigrationInfo migrationInfo, Boolean useTransaction)
   at FluentMigrator.Runner.MigrationRunner.MigrateUp(Int64 targetVersion, Boolean useAutomaticTransactionManagement)
   at FluentMigrator.Runner.MigrationRunner.MigrateUp(Boolean useAutomaticTransactionManagement)
   at FluentMigrator.Runner.MigrationRunner.MigrateUp()
   at NzbDrone.Core.Datastore.Migration.Framework.MigrationController.Migrate(String connectionString, MigrationContext migrationContext) in ./Prowlarr.Core/Datastore/Migration/Framework/MigrationController.cs:line 79
   at NzbDrone.Core.Datastore.DbFactory.CreateMain(String connectionString, MigrationContext migrationContext) in ./Prowlarr.Core/Datastore/DbFactory.cs:line 115
   --- End of inner exception stack trace ---
   at NzbDrone.Core.Datastore.DbFactory.CreateMain(String connectionString, MigrationContext migrationContext) in ./Prowlarr.Core/Datastore/DbFactory.cs:line 161
   at NzbDrone.Core.Datastore.DbFactory.Create(MigrationContext migrationContext) in ./Prowlarr.Core/Datastore/DbFactory.cs:line 70
   at NzbDrone.Core.Datastore.DbFactory.Create(MigrationType migrationType) in ./Prowlarr.Core/Datastore/DbFactory.cs:line 58
   at NzbDrone.Core.Datastore.Extensions.CompositionExtensions.<>c.<AddDatabase>b__0_0(IDbFactory f) in ./Prowlarr.Core/Datastore/Extensions/CompositionExtensions.cs:line 10
   at DryIoc.Registrator.ToFuncWithObjParams[D1,TService](Func`2 f, Object d1) in /_/src/DryIoc/Container.cs:line 7977
   at DryIoc.Interpreter.TryInterpretFuncInvoke(IResolverContext r, MethodCallExpression e, IParameterProvider paramExprs, Object paramValues, ParentLambdaArgs parentArgs, Object& result) in /_/src/DryIoc/Container.cs:line 3680
   at DryIoc.Interpreter.TryInterpretMethodCall(IResolverContext r, MethodCallExpression callExpr, IParameterProvider paramExprs, Object paramValues, ParentLambdaArgs parentArgs, Object& result) in /_/src/DryIoc/Container.cs:line 3478
   at DryIoc.Interpreter.TryInterpret(IResolverContext r, Expression expr, IParameterProvider paramExprs, Object paramValues, ParentLambdaArgs parentArgs, Object& result) in /_/src/DryIoc/Container.cs:line 3129
   at DryIoc.Interpreter.TryInterpretSingletonAndUnwrapContainerException(IResolverContext r, Expression expr, ImMapEntry`1 itemRef, Object& result) in /_/src/DryIoc/Container.cs:line 3058
   at DryIoc.Factory.ApplyReuse(Expression serviceExpr, Request request) in /_/src/DryIoc/Container.cs:line 11017
   at DryIoc.Factory.GetExpressionOrDefault(Request request) in /_/src/DryIoc/Container.cs:line 10936
   at DryIoc.Container.ResolveAndCacheKeyed(Int32 serviceTypeHash, Type serviceType, Object serviceKey, IfUnresolved ifUnresolved, Object scopeName, Type requiredServiceType, Request preResolveParent, Object[] args) in /_/src/DryIoc/Container.cs:line 535
   at DryIoc.Container.DryIoc.IResolver.Resolve(Type serviceType, Object serviceKey, IfUnresolved ifUnresolved, Type requiredServiceType, Request preResolveParent, Object[] args) in /_/src/DryIoc/Container.cs:line 463
   at DryIoc.Interpreter.TryInterpretMethodCall(IResolverContext r, MethodCallExpression callExpr, IParameterProvider paramExprs, Object paramValues, ParentLambdaArgs parentArgs, Object& result) in /_/src/DryIoc/Container.cs:line 3614
   at DryIoc.Interpreter.TryInterpret(IResolverContext r, Expression expr, IParameterProvider paramExprs, Object paramValues, ParentLambdaArgs parentArgs, Object& result) in /_/src/DryIoc/Container.cs:line 3141
   at DryIoc.Interpreter.TryInterpretNestedLambdaBodyAndUnwrapException(IResolverContext r, Expression bodyExpr, IParameterProvider paramExprs, Object paramValues, ParentLambdaArgs parentArgs) in /_/src/DryIoc/Container.cs:line 3424
   at DryIoc.Interpreter.<>c__DisplayClass5_0.<TryInterpretNestedLambda>b__0() in /_/src/DryIoc/Container.cs:line 3323
   at DryIoc.Interpreter.<>c__DisplayClass9_0`1.<ConvertFunc>b__0() in /_/src/DryIoc/Container.cs:line 3434
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at NzbDrone.Host.Startup.Configure(IApplicationBuilder app, IStartupContext startupContext, Lazy`1 mainDatabaseFactory, Lazy`1 logDatabaseFactory, DatabaseTarget dbTarget, ISingleInstancePolicy singleInstancePolicy, InitializeLogger initializeLogger, ReconfigureLogging reconfigureLogging, IAppFolderFactory appFolderFactory, IProvidePidFile pidFileProvider, IConfigFileProvider configFileProvider, IRuntimeInfo runtimeInfo, IFirewallAdapter firewallAdapter, IEventAggregator eventAggregator, ProwlarrErrorPipeline errorHandler) in ./Prowlarr.Host/Startup.cs:line 235
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass15_0.<UseStartup>b__1(IApplicationBuilder app)
   at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
   at NzbDrone.Host.Bootstrap.Start(String[] args, Action`1 trayCallback) in ./Prowlarr.Host/Bootstrap.cs:line 79
   at NzbDrone.Console.ConsoleApp.Main(String[] args) in ./Prowlarr.Console/ConsoleApp.cs:line 43

Trace Logs have been provided as applicable. Reports may be closed if the required logs are not provided.

  • I have read and followed the steps in the wiki link above and provided the required trace logs - the logs contain trace - that are relevant and show this issue.
@Snazzie Snazzie added Status: Needs Triage New Issue needing triage Type: Bug Issue is a bug labels Jul 31, 2023
@bakerboy448 bakerboy448 added the Status: Logs Needed Logs are needed to proceed with this issue label Jul 31, 2023
@github-actions
Copy link

👋 @Snazzie, in order to help you further we'll need to see logs. You'll need to enable trace logging and replicate the problem that you encountered. Guidance on how to enable trace logging can be found in our troubleshooting guide.

@Snazzie
Copy link
Author

Snazzie commented Aug 1, 2023

i enabled trace

@mynameisbogdan
Copy link
Contributor

This happens when your database is corrupted.

See #1757 (comment) for steps to fix it.

@Snazzie Snazzie closed this as completed Aug 1, 2023
@bakerboy448 bakerboy448 added Type: Support. (silent) Issue is a support request. Bot WILL NOT auto close and give a message. Area: Database Issue is related to the database and removed Type: Bug Issue is a bug Status: Needs Triage New Issue needing triage Status: Logs Needed Logs are needed to proceed with this issue labels Aug 19, 2023
@mynameisbogdan mynameisbogdan closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: Database Issue is related to the database Type: Support. (silent) Issue is a support request. Bot WILL NOT auto close and give a message.
Projects
None yet
Development

No branches or pull requests

3 participants