Ombi-app / Ombi

Want a Movie or TV Show on Plex/Emby/Jellyfin? Use Ombi!
http://ombi.io
GNU General Public License v2.0
3.72k stars 395 forks source link

Database is Locked #2214

Closed SlothCroissant closed 6 years ago

SlothCroissant commented 6 years ago

Ombi build Version:

Ombi 3.0.3268-master

Update Branch:

master - linuxserver/ombi

Media Sever:

Plex

Operating System:

Docker running in UnRAID

Ombi Applicable Logs (from /logs/ directory or the Admin page):

info: Ombi.Schedule.Jobs.Ombi.RefreshMetadata[0]
      The show Slumdog Millionaire has TheMovieDbId but not ImdbId, searching for ImdbId

Application startup exception: Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 5: 'database is locked'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.ExecuteSqlCommand(DatabaseFacade databaseFacade, RawSqlString sql, IEnumerable`1 parameters)
   at Ombi.Store.Context.OmbiContext.Seed() in C:\projects\requestplex\src\Ombi.Store\Context\OmbiContext.cs:line 107
   at Ombi.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMemoryCache cache, IServiceProvider serviceProvider) in C:\projects\requestplex\src\Ombi\Startup.cs:line 206
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()

Unhandled Exception: Microsoft.Data.Sqlite.SqliteException: SQLite Error 5: 'database is locked'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.ExecuteSqlCommand(DatabaseFacade databaseFacade, RawSqlString sql, IEnumerable`1 parameters)
   at Ombi.Store.Context.OmbiContext.Seed() in C:\projects\requestplex\src\Ombi.Store\Context\OmbiContext.cs:line 107
   at Ombi.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMemoryCache cache, IServiceProvider serviceProvider) in C:\projects\requestplex\src\Ombi\Startup.cs:line 206
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
   at Ombi.Program.Main(String[] args) in C:\projects\requestplex\src\Ombi\Program.cs:line 94
Hello, welcome to Ombi
Valid options are:
Ombi 3.0.3268-master
Copyright (C) 2018 Ombi

  --host       (Default: http://*:5000) Set to a semicolon-separated (;) list
               of URL prefixes to which the server should respond. For example,
               http://localhost:123. Use "*" to indicate that the server should
               listen for requests on any IP address or hostname using the
               specified port and protocol (for example, http://*:5000). The
               protocol (http:// or https://) must be included with each URL.
               Supported formats vary between servers.

  --storage    Storage path, where we save the logs and database

  --baseurl    The base URL for reverse proxy scenarios

  --help       Display this help screen.

  --version    Display version information.

We are running on
/opt/ombi

Problem Description:

Updated the docker image (by removing and re-adding it via UnRIAD), and it now crash cycles - it'll run through the startup, start scanning movies, then say that the "database is locked". I've tried to remove and re-add the docker container (keeping the volume with DB, logs, etc), and the issue reproduces.

Reproduction Steps:

For me, just starting Ombi causes it to startup loop indefinitely.

anojht commented 6 years ago

Are you still having this issue on the latest Ombi?

SlothCroissant commented 6 years ago

Apologies for the dupe - I sorta forgot I filed this :)

Yep, as of this morning, on v3.0.3293, the issue occurred again. I went ahead and changed from linuxserver/ombi to rogueosb/ombi as docker container source, so I'm going to see if the issue occurs again, as they are slightly different.

I was on rogueosb for over a year back when we had PlexRequests and into Ombi, and then switched to linuxserver recently, so I think it could be related? idk, but i'll try this out for a while and report back if the issue occurs yet again.

I'll close this for now, and re-open if needed later. Thanks!