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.75k stars 401 forks source link

SQLite Error 5: 'database is locked'. #2750

Closed xp-1000 closed 5 years ago

xp-1000 commented 5 years ago

Describe the bug Hello, I just tried to upgrade from 3.0.4036 to v3.0.4119 and I go this error when I started the new version. It seems similar to 2375 issue.

To Reproduce I tried on a fresh install and the upgrade works, the database is not locked so I am afraid it will be difficult to reproduce.

Expected behavior Ombi start and and can read database

Screenshots not relevant here

Logs (Logs directory where Ombi is located)

janv. 21 22:58:08 domain.tld Ombi[58316]: Application startup exception: Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 5: 'database is locked'.
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.ExecuteSqlCommand(DatabaseFacade databaseFacade, RawSqlString sql, IEnumerable`1 parameters)
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Ombi.Store.Context.OmbiContext.Seed() in C:\projects\requestplex\src\Ombi.Store\Context\OmbiContext.cs:line 91
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Ombi.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMemoryCache cache, IServiceProvider serviceProvider) in C:\projects\requestplex\src\Ombi\Startup.cs:line 221
janv. 21 22:58:08 domain.tld Ombi[58316]: --- End of stack trace from previous location where exception was thrown ---
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
janv. 21 22:58:08 domain.tld Ombi[58316]: Unhandled Exception: Microsoft.Data.Sqlite.SqliteException: SQLite Error 5: 'database is locked'.
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.ExecuteSqlCommand(DatabaseFacade databaseFacade, RawSqlString sql, IEnumerable`1 parameters)
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Ombi.Store.Context.OmbiContext.Seed() in C:\projects\requestplex\src\Ombi.Store\Context\OmbiContext.cs:line 91
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Ombi.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMemoryCache cache, IServiceProvider serviceProvider) in C:\projects\requestplex\src\Ombi\Startup.cs:line 221
janv. 21 22:58:08 domain.tld Ombi[58316]: --- End of stack trace from previous location where exception was thrown ---
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.AspNetCore.Hosting.Internal.WebHost.StartAsync(CancellationToken cancellationToken)
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, String shutdownMessage)
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token)
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host)
janv. 21 22:58:08 domain.tld Ombi[58316]:    at Ombi.Program.Main(String[] args) in C:\projects\requestplex\src\Ombi\Program.cs:line 99
janv. 21 22:58:09 domain.tld systemd[1]: ombi.service: Main process exited, code=dumped, status=6/ABRT

Desktop (please complete the following information):

Ombi Version (please complete the following information):

Additional context Honnestly, I suspect the problem was present BEFORE the upgrade because I cannot connect with my account so it could not be related to the upgrade itself but rahter than a previous crash. I understand I don't provide enough information to do a real debug and I am sorry for that but I cannot give you more. I don't expect you fix an obscure bug in this situation but if you have a workaround to manually unlock the database file I could do more tests. When I stop ombi I can read the database from command line so the file itself seems not corrupted. Sadly, Ombi restarts in loop with the same database locked error.


sqlite3 Ombi.db 
SQLite version 3.26.0 2018-12-01 12:34:55
Enter ".help" for usage hints.
sqlite> .tables
AlbumRequests                NotificationTemplates      
ApplicationConfiguration     NotificationUserId         
AspNetRoleClaims             PlexEpisode                
AspNetRoles                  PlexSeasonsContent         
AspNetUserClaims             PlexServerContent          
AspNetUserLogins             RadarrCache                
AspNetUserRoles              RecentlyAddedLog           
AspNetUserTokens             RequestLog                 
AspNetUsers                  RequestQueue               
Audit                        RequestSubscription        
ChildRequests                SeasonRequests             
CouchPotatoCache             SickRageCache              
EmbyContent                  SickRageEpisodeCache       
EmbyEpisode                  SonarrCache                
EpisodeRequests              SonarrEpisodeCache         
GlobalSettings               Tokens                     
IssueCategory                TvIssues                   
IssueComments                TvRequests                 
Issues                       UserNotificationPreferences
LidarrAlbumCache             UserQualityProfiles        
LidarrArtistCache            Votes                      
MovieIssues                  __EFMigrationsHistory      
MovieRequests    
xp-1000 commented 5 years ago

Hello

I tried to downgrade from 3.0.4119 to 3.0.3945 and it works fine. I will try the upgrade again

xp-1000 commented 5 years ago

OK I upgraded 1 by 1 version and now it works with 3.0.4119. sorry to inconvenience

xp-1000 commented 5 years ago

Hello, after 2 days the problem appears again without any action (upgrade or other), the service was never restarted (the process pid is the same from 2 days)

xp-1000 commented 5 years ago

come back to 3.0.3988 and it works, I suspect the impacted version was 3.0.4036 (may be related to failed requests queue new feature).

xp-1000 commented 5 years ago

Hello, ok I confirm I tested 3.0.4036 during one day and the locking problem appears again and as for last time the pid of ombi is the same so the process was never restarted. It in my case it impacts 2 last versions 4119 and 4036 but it works with 3988.

danielcbaldwin commented 5 years ago

I am seeing the same issue. On 3.0.4119. Downgrading to 3.0.3945 has everything working again.

tidusjar commented 5 years ago

Anyone have any more logs?

tidusjar commented 5 years ago

This issue with this is the SQLite will lock the whole .db file when a database transaction occurs, it is useless for applications with concurrent transactions. I have been able to work around this by splitting out the databases so we see less locks.

I did create a POC to allow the user to also run MySQL instead of SQLite which would solve this, but that means the user would need to host a MySQL database.

Another option is to split out the databases even more, one logical place would be to remove the Users table and user information e.g. roles from the Ombi.db as that's where the locks seem to be occurring. But due to this being a relational database structure there are a lot of foreign key constrains against the User e.g. a Request object needs to have a valid user. So doing that would require a considerable amount of work as the code also expects the constraint to be enforced.

So I guess we have two options, the second will probably need to be done, split out the databases even more. Then the first option would be a benefit for more technical users to manage the database externally.

xp-1000 commented 5 years ago

Hello,

Sorry I have no more log I sent to you.

I understand your last point but I don't understand in your explanation why this lock bug impacts only versions after 3.0.3988.

How can I switch to mysql ? there is no problem in my case and will allow me to upgrade ombi to last version rather than stay stucked on 3.0.3988

Mfellner77 commented 5 years ago

This issue happens daily - cant even login unless reset service. I would love to try out the MySQL option if it solves this.

Version 3.0.4119
Branch master

More logs :

2019-02-14 09:54:46.129 -07:00 [Error] Something bad happened, ErrorMiddleware caught this 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.Data.Sqlite.SqliteConnectionExtensions.ExecuteNonQuery(SqliteConnection connection, String commandText) at Microsoft.Data.Sqlite.SqliteTransaction.Commit() at Microsoft.EntityFrameworkCore.Storage.RelationalTransaction.Commit() at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(DbContext _, ValueTuple2 parameters, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IReadOnlyList1 entriesToSave, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore9.UpdateAsync(TUser user, CancellationToken cancellationToken) at Microsoft.AspNetCore.Identity.UserManager1.UpdateUserAsync(TUser user) at Ombi.Controllers.TokenController.CreateToken(Boolean rememberMe, OmbiUser user) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 127 at Ombi.Controllers.TokenController.GetToken(UserAuthModel model) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 72 at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.InvokeCore(HttpContext context) at Ombi.ApiKeyMiddlewear.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ApiKeyMiddlewear.cs:line 50 at Ombi.ErrorHandlingMiddleware.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ErrorHandlingMiddlewear.cs:line 24

JSKershaw commented 5 years ago

Here's my log: Let me know if you need anything else.

--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 fail: Ombi.Api.Api[1000] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://192.168.0.24:8989/sonarr/api/series/ fail: Ombi.Api.Api[1000] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://192.168.0.24:8989/sonarr/api/series/ fail: Ombi.Api.Api[1000] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://192.168.0.24:8989/sonarr/api/series/0 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, IReadOnlyDictionary2 parameterValues) at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary2 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 91 at Ombi.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMemoryCache cache, IServiceProvider serviceProvider) in C:\projects\requestplex\src\Ombi\Startup.cs:line 221 --- End of stack trace from previous location where exception was thrown --- 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, IReadOnlyDictionary2 parameterValues) at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary2 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 91 at Ombi.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMemoryCache cache, IServiceProvider serviceProvider) in C:\projects\requestplex\src\Ombi\Startup.cs:line 221 --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app) at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication() at Microsoft.AspNetCore.Hosting.Internal.WebHost.StartAsync(CancellationToken cancellationToken) at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, String shutdownMessage) at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token) at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host) at Ombi.Program.Main(String[] args) in C:\projects\requestplex\src\Ombi\Program.cs:line 99 Hello, welcome to Ombi Valid options are: Ombi 3.0.4119-master Copyright (C) 2019 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 fail: Ombi.Api.Api[1000] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://192.168.0.24:8989/sonarr/api/series/ fail: Ombi.Api.Api[1000] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://192.168.0.24:8989/sonarr/api/series/ fail: Ombi.Api.Api[1000] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://192.168.0.24:8989/sonarr/api/series/0 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, IReadOnlyDictionary2 parameterValues) at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary2 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 91 at Ombi.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMemoryCache cache, IServiceProvider serviceProvider) in C:\projects\requestplex\src\Ombi\Startup.cs:line 221 --- End of stack trace from previous location where exception was thrown --- 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, IReadOnlyDictionary2 parameterValues) at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary2 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 91 at Ombi.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMemoryCache cache, IServiceProvider serviceProvider) in C:\projects\requestplex\src\Ombi\Startup.cs:line 221 --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app) at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication() at Microsoft.AspNetCore.Hosting.Internal.WebHost.StartAsync(CancellationToken cancellationToken) at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, String shutdownMessage) at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token) at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host) at Ombi.Program.Main(String[] args) in C:\projects\requestplex\src\Ombi\Program.cs:line 99 Hello, welcome to Ombi Valid options are: Ombi 3.0.4119-master Copyright (C) 2019 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 fail: Ombi.Api.Api[1000] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://192.168.0.24:8989/sonarr/api/series/ fail: Ombi.Api.Api[1000] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://192.168.0.24:8989/sonarr/api/series/ fail: Ombi.Api.Api[1000] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://192.168.0.24:8989/sonarr/api/series/0`

clambert11 commented 5 years ago

Any ideas what I can do to get my Docker instance running with these new updates? I downloaded the latest linuxserver container but that didn't do anything for me. Do I need to switch to a development version?

tidusjar commented 5 years ago

Yes you will need to use the lsiodev container

clambert11 commented 5 years ago

Currently running 4256. I'm logged in but it's telling me the database is locked when adding a movie. Just wanted to report it. https://pastebin.com/wuZumupp

Daedilus commented 5 years ago

I've tried running a bunch of different versions and they are all telling me the database is locked. I don't really want to start from scratch as I had a lot of notification configs that I was using and having to go recreate them would be very difficult.

We are running on

i
Hosting environment: Production
Content root path: /opt/ombi
Now listening on: http://[::]:3579
Application started. Press Ctrl+C to shut down.
fail: Ombi.ErrorHandlingMiddleware[0]
Something bad happened, ErrorMiddleware caught this
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.Data.Sqlite.SqliteConnectionExtensions.ExecuteNonQuery(SqliteConnection connection, String commandText)
at Microsoft.Data.Sqlite.SqliteTransaction.Commit()
at Microsoft.EntityFrameworkCore.Storage.RelationalTransaction.Commit()
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(DbContext _, ValueTuple`2 parameters, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IReadOnlyList`1 entriesToSave, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore`9.UpdateAsync(TUser user, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Identity.UserManager`1.UpdateUserAsync(TUser user)
at Ombi.Controllers.TokenController.CreateToken(Boolean rememberMe, OmbiUser user) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 127
at Ombi.Controllers.TokenController.OAuth(Int32 pinId) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 194
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)

at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext)
at Ombi.ApiKeyMiddlewear.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ApiKeyMiddlewear.cs:line 51
at Ombi.ErrorHandlingMiddleware.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ErrorHandlingMiddlewear.cs:line 24
Iguana9999phil commented 5 years ago

Same issue here, logs same as deadilus. Redid Ombi yesterday and was working fine. Removed all .db files and started over, connected ombi to Plex and than put original database back added some new users, tested a local admin user and all was working. Today can’t login and again database locked. Was on docker develop, tried older versions but nothing works.

Edit: made a identical ombi instance yesterday for 4K request, this one also got the same issue. Not even in production yet so nothing was changed in that database.

tidusjar commented 5 years ago

Can someone with the current issue please create me a user to login and then send me their databases please with the login info to tidusjar@gmail.com and reference this issue. Databases needed is Ombi.db OmbiSettings and ombiexternal

tidusjar commented 5 years ago

Can someone please try out build 3.0.4286 (latest dev) https://ci.appveyor.com/project/tidusjar/requestplex/builds/22640365/artifacts

Unfortunately this is not an easy fix and there is going to be a lot of incremental changes to fix this.

Iguana9999phil commented 5 years ago

I’m on the docker dev branch, is that one auto updated? It says 3.0.4287-ls9 So guess so Edit: guess not as it says 3.0.4275 Develop in the about screen. I’m unable to create a user, would a VPS with ombi and the affected db’s be handy for you for debugging etc instead of sending the database via mail?

SCRPD commented 5 years ago

I might also have this problem, but I cannot login.

It loops "Authenticating Loading.... Please Wait"

build_version Linuxserver.io version:- v3.0.4256-pkg-46432ad1-dev-fab689a096cd9ee84c108a5aadc978e02e3a6e26 Build-date:- 2019-02-22T20:47:26+00:00
com.docker.compose.config-hash 032e81e3085090d5eacb332623b5b284400b8a0910fef2770c32205b7edba74b
com.docker.compose.container-number 1
com.docker.compose.oneoff False
com.docker.compose.project opt
com.docker.compose.service ombi
com.docker.compose.version 1.21.2

Chrome console:

Failed to load resource: the server responded with a status of 500 ()
app.js:1530 e {headers: t, status: 500, statusText: "OK", url: "https://ombi.domain.com/api/v1/token/1846591516", ok: false, …}

Contents of that error:

error: {error: "SQLite Error 5: 'database is locked'."}
headers: t {normalizedNames: Map(0), lazyUpdate: null, lazyInit: ƒ}
message: "Http failure response for https://ombi.domain.com/api/v1/token/1846591516: 500 OK"
name: "HttpErrorResponse"
ok: false
status: 500
statusText: "OK"
url: "https://ombi.domain.com/api/v1/token/1846591516"
__proto__: Object

Ombi Log: https://pastebin.com/CUV8QXKe

Orgv2 log: February 25, 2019 9:44 PM | SYSTEM | IP ADDRESS | OMBI Connect Function - Error: cURL error 28: Operation timed out after 10000 milliseconds with 0 bytes received

Since database & settings integrity isn't important for me (Literally takes 4 minutes to setup ombi) I just deleted it and reinstalled with the linuxserver/ombi:latest docker container & fixed my problems. Figured I should post this info here if it might help.

tidusjar commented 5 years ago

@SCRPD Do you still have the old DB that was causing the issue?

That's the one that seems to be the most common where the user cannot log in due to the DB being locked.

SCRPD commented 5 years ago

@tidusjar I have a backup of that DB. I can send you that info after work today.

SCRPD commented 5 years ago

@tidusjar

Sent you an email.

tidusjar commented 5 years ago

I've just pushed some changes to develop that hopefully will help.

Can someone please try the latest develop and let me know?

clambert11 commented 5 years ago

So I tried updating Docker container linuxserver/ombi:devlopment and it still seems to be on 4287. I used to be on lsiodev/ombi-preview:latest (mentioned to use above in the thread) but when that container didn't seem to be updating Rox said to switch to linuxserver/ombi:devlopment. What container should I actually be using for development? My database isn't currently locked, so I'm probably not going to be of much help at the moment but I do want to assure I'm using the proper container.

bobnvic commented 5 years ago

I've just pushed some changes to develop that hopefully will help.

Can someone please try the latest develop and let me know?

I updated my linuxserver docker container to development and tried logging in. Same locking issue. Here are the logs. `Hello, welcome to Ombi Valid options are: Ombi 3.0.4287-develop Copyright (C) 2019 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

--demo Demo mode, you will never need to use this, fuck that fruit company...

--help Display this help screen.

--version Display version information.

We are running on /opt/ombi Hosting environment: Production Content root path: /opt/ombi Now listening on: http://[::]:3579 Application started. Press Ctrl+C to shut down. fail: Ombi.Api.Api[1000] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://192.168.1.104:8989/api/series/ fail: Ombi.Api.Api[1000] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://192.168.1.104:8989/api/series/ fail: Ombi.Api.Api[1000] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://192.168.1.104:8989/api/series/0 fail: Ombi.ErrorHandlingMiddleware[0] Something bad happened, ErrorMiddleware caught this 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.Data.Sqlite.SqliteConnectionExtensions.ExecuteNonQuery(SqliteConnection connection, String commandText) at Microsoft.Data.Sqlite.SqliteTransaction.Commit() at Microsoft.EntityFrameworkCore.Storage.RelationalTransaction.Commit() at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(DbContext _, ValueTuple2 parameters, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IReadOnlyList1 entriesToSave, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore9.UpdateAsync(TUser user, CancellationToken cancellationToken) at Microsoft.AspNetCore.Identity.UserManager1.UpdateUserAsync(TUser user) at Ombi.Controllers.TokenController.CreateToken(Boolean rememberMe, OmbiUser user) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 127 at Ombi.Controllers.TokenController.GetToken(UserAuthModel model) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 72 at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.InvokeCore(HttpContext context) at Ombi.ApiKeyMiddlewear.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ApiKeyMiddlewear.cs:line 51 at Ombi.ErrorHandlingMiddleware.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ErrorHandlingMiddlewear.cs:line 24 `

bobnvic commented 5 years ago

So I tried updating Docker container linuxserver/ombi:devlopment and it still seems to be on 4287. I used to be on lsiodev/ombi-preview:latest (mentioned to use above in the thread) but when that container didn't seem to be updating Rox said to switch to linuxserver/ombi:devlopment. What container should I actually be using for development? My database isn't currently locked, so I'm probably not going to be of much help at the moment but I do want to assure I'm using the proper container.

If you copy/pasted the linuxserver/ombi:devlopment part, then you probably want to check your spelling. Should be linuxserver/ombi:development. It worked for me.

Iguana9999phil commented 5 years ago

Was this the first time you’ve pushed changes? My docker is on develop and restarts every 4 hours, since a couple of days iGu-AnaCloud started to work again and haven’t have issues yet. Can add users and everything seems fine.

tidusjar commented 5 years ago

I have pushed a few different incremental changes but this was quite a big change. It looks like the builds have not been working due to some dependency changes in the pipeline that I didn't notice.

But i've now fixed that and develop builds should be running successfully

clambert11 commented 5 years ago

Nice! Thanks Jamie. Everything seems good now. I honestly haven't had an issue myself with the db locking in a couple weeks but will definitely update here if anything happens again. Thanks for all the help!

tidusjar commented 5 years ago

My recent update will fix the issue, but it's not the fix I want going forward 😡

Iguana9999phil commented 5 years ago

Just to be sure, develop branch for docker is linuxserver/ombi:development? I’m on that and since today its having the same issues again.

clambert11 commented 5 years ago

Yeah, that's right. What version are you on? It should be 3.0.4032 as of today. I'm sure if you are still having problems he'd like a copy of your db and maybe your logs.

Iguana9999phil commented 5 years ago

You mean 3.0.4302-develop I hope ;-) Anyway seems docker didn’t pull the latest develop image needed to do it manually. Running 3.04302-develop now and sadly still the same issue.

For completion the latest entry in the logs: 2019-03-08 17:01:59.417 +08:00 [Error] Something bad happened, ErrorMiddleware caught this 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.Data.Sqlite.SqliteConnectionExtensions.ExecuteNonQuery(SqliteConnection connection, String commandText) at Microsoft.Data.Sqlite.SqliteTransaction.Commit() at Microsoft.EntityFrameworkCore.Storage.RelationalTransaction.Commit() at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(DbContext _, ValueTuple2 parameters, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IReadOnlyList1 entriesToSave, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore9.UpdateAsync(TUser user, CancellationToken cancellationToken) at Microsoft.AspNetCore.Identity.UserManager1.UpdateUserAsync(TUser user) at Ombi.Controllers.TokenController.CreateToken(Boolean rememberMe, OmbiUser user) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 127 at Ombi.Controllers.TokenController.GetToken(UserAuthModel model) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 72 at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.InvokeCore(HttpContext context) at Ombi.ApiKeyMiddlewear.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ApiKeyMiddlewear.cs:line 51 at Ombi.ErrorHandlingMiddleware.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ErrorHandlingMiddlewear.cs:line 24

Arindrew commented 5 years ago

I was running Ombi 3.0.4119-master when I initially opened my ticket with the issue in this thread. I just checked it out again today for the hell of it and its now working and I can login just fine. Current version is Ombi 3.0.4256-master. I guess it updated itself?

Iguana9999phil commented 5 years ago

Still can’t login, any updates or tips on how to export the info in the db? Can’t login so can’t add a user to send the database.

alimbocl commented 5 years ago

Just wanted to add I am also experiencing this issue. Tried updating to Ombi 3.0.4302-develop but issues persist (can't login). Will watch this thread.

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.Data.Sqlite.SqliteConnectionExtensions.ExecuteNonQuery(SqliteConnection connection, String commandText) at Microsoft.Data.Sqlite.SqliteTransaction.Commit() at Microsoft.EntityFrameworkCore.Storage.RelationalTransaction.Commit() at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(DbContext , ValueTuple2 parameters, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IReadOnlyList1 entriesToSave, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore9.UpdateAsync(TUser user, CancellationToken cancellationToken) at Microsoft.AspNetCore.Identity.UserManager1.UpdateUserAsync(TUser user) at Ombi.Controllers.TokenController.CreateToken(Boolean rememberMe, OmbiUser user) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 127 at Ombi.Controllers.TokenController.GetToken(UserAuthModel model) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 72 at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.InvokeCore(HttpContext context) at Ombi.ApiKeyMiddlewear.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ApiKeyMiddlewear.cs:line 51 at Ombi.ErrorHandlingMiddleware.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ErrorHandlingMiddlewear.cs:line 24 fail: Ombi.ErrorHandlingMiddleware[0] Something bad happened, ErrorMiddleware caught this 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.Data.Sqlite.SqliteConnectionExtensions.ExecuteNonQuery(SqliteConnection connection, String commandText) at Microsoft.Data.Sqlite.SqliteTransaction.Commit() at Microsoft.EntityFrameworkCore.Storage.RelationalTransaction.Commit() at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(DbContext , ValueTuple2 parameters, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IReadOnlyList1 entriesToSave, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore9.UpdateAsync(TUser user, CancellationToken cancellationToken) at Microsoft.AspNetCore.Identity.UserManager1.UpdateUserAsync(TUser user) at Ombi.Controllers.TokenController.CreateToken(Boolean rememberMe, OmbiUser user) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 127 at Ombi.Controllers.TokenController.GetToken(UserAuthModel model) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 72 at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.InvokeCore(HttpContext context) at Ombi.ApiKeyMiddlewear.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ApiKeyMiddlewear.cs:line 51 at Ombi.ErrorHandlingMiddleware.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ErrorHandlingMiddlewear.cs:line 24 fail: Ombi.ErrorHandlingMiddleware[0] Something bad happened, ErrorMiddleware caught this 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.Data.Sqlite.SqliteConnectionExtensions.ExecuteNonQuery(SqliteConnection connection, String commandText) at Microsoft.Data.Sqlite.SqliteTransaction.Commit() at Microsoft.EntityFrameworkCore.Storage.RelationalTransaction.Commit() at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(DbContext , ValueTuple2 parameters, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IReadOnlyList1 entriesToSave, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore9.UpdateAsync(TUser user, CancellationToken cancellationToken) at Microsoft.AspNetCore.Identity.UserManager1.UpdateUserAsync(TUser user) at Ombi.Controllers.TokenController.CreateToken(Boolean rememberMe, OmbiUser user) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 127 at Ombi.Controllers.TokenController.GetToken(UserAuthModel model) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 72 at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.InvokeCore(HttpContext context) at Ombi.ApiKeyMiddlewear.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ApiKeyMiddlewear.cs:line 51 at Ombi.ErrorHandlingMiddleware.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ErrorHandlingMiddlewear.cs:line 24 fail: Ombi.ErrorHandlingMiddleware[0] Something bad happened, ErrorMiddleware caught this 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.Data.Sqlite.SqliteConnectionExtensions.ExecuteNonQuery(SqliteConnection connection, String commandText) at Microsoft.Data.Sqlite.SqliteTransaction.Commit() at Microsoft.EntityFrameworkCore.Storage.RelationalTransaction.Commit() at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(DbContext , ValueTuple2 parameters, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IReadOnlyList1 entriesToSave, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore9.UpdateAsync(TUser user, CancellationToken cancellationToken) at Microsoft.AspNetCore.Identity.UserManager1.UpdateUserAsync(TUser user) at Ombi.Controllers.TokenController.CreateToken(Boolean rememberMe, OmbiUser user) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 127 at Ombi.Controllers.TokenController.GetToken(UserAuthModel model) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 72 at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.InvokeCore(HttpContext context) at Ombi.ApiKeyMiddlewear.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ApiKeyMiddlewear.cs:line 51 at Ombi.ErrorHandlingMiddleware.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ErrorHandlingMiddlewear.cs:line 24

jjbrunton commented 5 years ago

Currently experiencing this on the latest linuxserver docker.

tidusjar commented 5 years ago

Just pushed another build to dev with more changes that should improve/fix this, it looks like I made a change a few days ago but in the v4 branch and not dev... 🤦‍♂️

Iguana9999phil commented 5 years ago

Does it take a while for the new build to show up in the docker images? Pulled the latest earlier today and checked after reading your post its still the latest. I’ll try it tomorrow am (my time)

tidusjar commented 5 years ago

Yeah it takes around 20 minutes for the build atleast. I'm not sure how long it will take for the docker image.

The build itself has now finished so try now? I'm pretty sure that the lsiodev/ombi-preview container updates on a docker restart.

alimbocl commented 5 years ago

Still happening on Ombi 3.0.4319-develop. This happens during login after passing credentials. This basically hangs the login process and cannot get into the app.

fail: Ombi.ErrorHandlingMiddleware[0] Something bad happened, ErrorMiddleware caught this 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.Data.Sqlite.SqliteConnectionExtensions.ExecuteNonQuery(SqliteConnection connection, String commandText) at Microsoft.Data.Sqlite.SqliteTransaction.Commit() at Microsoft.EntityFrameworkCore.Storage.RelationalTransaction.Commit() at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(DbContext _, ValueTuple2 parameters, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IReadOnlyList1 entriesToSave, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore9.UpdateAsync(TUser user, CancellationToken cancellationToken) at Microsoft.AspNetCore.Identity.UserManager1.UpdateUserAsync(TUser user) at Ombi.Controllers.TokenController.<>c__DisplayClass7_0.<b__1>d.MoveNext() in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 153 --- End of stack trace from previous location where exception was thrown --- at Ombi.Helpers.GlobalMutex.Lock[T](Func`1 func) at Ombi.Controllers.TokenController.CreateToken(Boolean rememberMe, OmbiUser user) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 153 at Ombi.Controllers.TokenController.GetToken(UserAuthModel model) in C:\projects\requestplex\src\Ombi\Controllers\TokenController.cs:line 72 at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.InvokeCore(HttpContext context) at Ombi.ApiKeyMiddlewear.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ApiKeyMiddlewear.cs:line 51 at Ombi.ErrorHandlingMiddleware.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ErrorHandlingMiddlewear.cs:line 24

Mfellner77 commented 5 years ago

Nuts. Does anyone know the build# that was stable before this started happening? I would like to roll back to that until this resolved?

Iguana9999phil commented 5 years ago

yup just updated and still the same, cleared browser cache and cookies to be sure. I’ve tested previous build but the also had that issue for me.

Arindrew commented 5 years ago

I initially installed Ombi on Feb 25th with the latest version (via a tar.gz). Whatever version was the latest on that date worked. I still have the .gz too, just not sure where to look for the version. Maybe someone else can confirm a newer release works...

Sent from ProtonMail Mobile

On Thu, Mar 14, 2019 at 7:07 PM, Mfellner77 notifications@github.com wrote:

Nuts. Does anyone know the build# that was stable before this started happening? I would like to roll back to that until this resolved?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

Mfellner77 commented 5 years ago

This version is running stable for me.

Version 3.0.3988 
Branch master
Iguana9999phil commented 5 years ago

Thanks! Installed it and is working for me. For docker users it’s linuxserver/ombi:132 release.

cliff85 commented 5 years ago

Thanks @Iguana9999phil I'll stick to this release until this is resolved. First time i've been able to login, in awhile :)

Iguana9999phil commented 5 years ago

@cliff85 same here finally can add the latest users. This older release feels faster too, maybe it’s fast enough for pruning all the already available media manually 😉

gamechld commented 5 years ago

I'm not a programmer, but I have reverted to the 3.0.3988 release as well, so far so good. However is does make me think the problem cannot be with needing to split the database more. Something must have changed between 3988 and Current that is impacting the login mechanics. I just have no idea what it could be.