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    
infamouswb commented 5 years ago

@gamechld I can confirm the same as well. I rolled back to 3988 on Ubuntu and its been working great.

tidusjar commented 5 years ago

Has anyone tried develop yet since I made some changes that should work. Just need someone to test it?

Mfellner77 commented 5 years ago

alimbocl Tested on Ombi 3.0.4319-develop - and reported the same issue. Is there a newer release that can be tested in non-prod environments?

tidusjar commented 5 years ago

That is the latest develop branch. Can you please upload a log with the error on the develop build?

tidusjar commented 5 years ago

I just went back and check the difference between 3988 and 4036 which was the next master release.

The only thing that changed was we added a new job that runs daily. But I did notice there was a misconfiguration of the job setup that we had a duplicate job that was introduced which is very suspect.

I've removed this in 3.0.4323 so i would be interested in seeing the results of this.

gamechld commented 5 years ago

For Science! I will try 4323-Dev and report back. However, I do caution that the issue was very sporadic for me, sometimes would take several days to present itself. Will keep you all posted.

RCFilm commented 5 years ago

Same Issue.


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.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


RCFilm commented 5 years ago

has anyone found a fix?

RCFilm commented 5 years ago

I changed over to the development build, posted about 11 hours ago. Yet, i was still unable to login with the web interface. my mobile app tokens still work.

Iguana9999phil commented 5 years ago

@RCFilm, fix for now is reverting to build 3988 (132 for docker) Since my last post it still works as it should and no complaints from users that they cannot log-in.

RCFilm commented 5 years ago

@RCFilm, fix for now is reverting to build 3988 (132 for docker) Since my last post it still works as it should and no complaints from users that they cannot log-in.

That did the trick. Thank you. Please post on this thread when fixed for the new releases.

Arindrew commented 5 years ago

I first noticed the problem when one of my clients wasn't able to log in. During troubleshooting, I logged myself out and was subsequently not able to login. So, the problem may not present itself until you log out and try to log back in. It seems currently logged in users are unaffected by this problem - at least in my experience.

Iguana9999phil commented 5 years ago

Exact the same experience as Arindrew. Users told me they had issues with log in while I was still able to access it for a week. Logged out and then the problems started. For now i’ll stay on build 3988 as it works well and none of the added features (if any) in later releases are interesting to me. Between this happening and getting burned by latest Plex release (cannot play media on iOS web, took me a day to figure that out) I’ve disabled pulling latest docker releases as well.

gamechld commented 5 years ago

You guys may not see the issue until you log out and back in, but if you look in the console you will see many errors and yelling about the database being locked if another user has already ran into the issue.

I'd like to try the 3.0.4323-Dev as requested but I'm still a bit shaky on how to navigate the site, can someone tell me where to grab a specific release from the Develop branch?

xp-1000 commented 5 years ago

Hello, Sorry for my late answer I was busy.

I just went back and check the difference between 3988 and 4036 which was the next master release.

The only thing that changed was we added a new job that runs daily. But I did notice there was a misconfiguration of the job setup that we had a duplicate job that was introduced which is very suspect.

I've removed this in 3.0.4323 so i would be interested in seeing the results of this.

It seems to be a very good move because like I said in my previous comment :

https://github.com/tidusjar/Ombi/issues/2750#issuecomment-457562237

In my case, it still works now since this comment with 3988 whereas the problem comes quick enough when I tested newer versions.

I will test 3.0.4323 soon and I will come back here keep you in touch.

tidusjar commented 5 years ago

@gamechld here is the latest dev release as of 19/03/2019 @ 15:16:00 GMT https://ci.appveyor.com/project/tidusjar/requestplex/builds/23154537/artifacts

gamechld commented 5 years ago

@gamechld here is the latest dev release as of 19/03/2019 @ 15:16:00 GMT https://ci.appveyor.com/project/tidusjar/requestplex/builds/23154537/artifacts

Thanks, I'll give it a shot. Sorry, I knew how to get latest develop, but wasn't sure if I should try latest or if there was a way to get 3.0.4323 specifically. I assume latest will still have the change from 4323 you wanted to test. Trying it now, will report back!

gamechld commented 5 years ago

Huh, I ran into a snag with the developer build. My Requests, User Management, and Settings pages wouldn't load. That was with a nuked folder and the 4 .db files copied over.

tidusjar commented 5 years ago

Wouldn't load in what way?

So you were able to login which you couldn't previously due to the locked db?

gamechld commented 5 years ago

Wouldn't load in what way?

So you were able to login which you couldn't previously due to the locked db?

(for master branch) The login issue isn't something that presents immediately. It could be days before the login issue with database lock actually happens. It could be as frequent as 2-3 times a day, to as infrequent as once in 4 days. But on version 3988 it never happened.

(on testing developer branch) Upon a fresh install with copied .db files, I can login but cannot access those 3 sections (My Requests, User Management, and Settings). It occurs to me, that I didn't try from different browsers, maybe it was a browser issue. Checking now.

edit: Ok, I'm running developer now, 4324. Don't know what my issue was yesterday, even though I clean installed it 3 times. But it's working now, must've been my web browser screwing up. I will keep everyone posted if I run into the database locked issue. Might be a few days.

tidusjar commented 5 years ago

Can you upload a log? How long have you tried waiting?

On Wed, 20 Mar 2019, 5:23 pm gamechld, notifications@github.com wrote:

Wouldn't load in what way?

So you were able to login which you couldn't previously due to the locked db?

(for master branch) The login issue isn't something that presents immediately. It could be days before the login issue with database lock actually happens. It could be as frequent as 2-3 times a day, to as infrequent as once in 4 days. But on version 3988 it never happened.

(on testing developer branch) Upon a fresh install with copied .db files, I can login but cannot access those 3 sections (My Requests, User Management, and Settings).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tidusjar/Ombi/issues/2750#issuecomment-474942667, or mute the thread https://github.com/notifications/unsubscribe-auth/AGVaLE1w6eA-b7eAkQ-r_GV3txHnG9Qgks5vYm6VgaJpZM4aLmgw .

gamechld commented 5 years ago

I just booted up the developer build today, so I'll let it run for a few days, hopefully the issue will already be resolved and I won't have anything to show. If it runs for a week solid without the problem then it's probably been fixed.

hacktek commented 5 years ago

This is happening to me as well. Trying to log in yields

2019-03-20 17:19:48.703 -06: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

I've tried a few things (restarting, rebuilding container, dereferencing db) and nothing seems to work. The only thing that appears to work is removing the DB's, restarting and going through the initial process and then restoring a DB backup after.

gamechld commented 5 years ago

@hacktek Ah that's interesting. I'm just running it out of a folder on Windows, and I can recover from the error just by closing it and opening it again. What version are you running? If you want to revert to stable, try 3.0.3988. If you want to help test the fixes, grab the developer release.

hacktek commented 5 years ago

I'll try and see which version it is if I can actually log in. I've found that my method seemed to work but only because I was already logged in. If I do it from an incognito window it doesn't seem to properly restore to a working state. I think this certainly needs a DB switch.

If this matters, I have the Mellow Discord request bot connected to Ombi but I don't believe that's the issue because the bot doesn't contact Ombi unless someone tries to request something.

hacktek commented 5 years ago

So I'm running version 3.0.4256.

I'm able to return it to a working state by doing the following...

1/ Run this script which stops the container, deletes the DBs and restarts the container.

!/bin/sh

printf "Stopping container..." echo "\n" docker stop ombi

printf "Deleting databases..." echo "\n" rm /opt/appdata/ombi/*.db

printf "Starting fresh container..." echo "\n" docker start ombi

2/ Open the web interface and do the wizard.

3/ Run this script to restore OmbiSettings.db and OmbiExternal.db only.

!/bin/sh

printf "Determining latest backup..." echo "\n" BACKUP=$(borgmatic --list | tail -1 | awk '{print $1}')

printf "Restoring latest backup..." echo "\n" borgmatic --extract --archive "$BACKUP" --restore-path opt/appdata/ombi --verbosity 1

printf "Copying databases..." echo "\n" cp ~/opt/appdata/ombi/OmbiSettings.db /opt/appdata/ombi/OmbiSettings.db cp ~/opt/appdata/ombi/OmbiExternal.db /opt/appdata/ombi/OmbiExternal.db

If I restore Ombi.db I can't log back in. This also breaks the Discord bot because the API key changes. I also don't know what else could be breaking by not restoring Ombi.db.

Also, if I do it all at once (without doing the wizard in between steps 1 and 2) I can't log in either, it says the username and password are wrong.

gamechld commented 5 years ago

@hacktek Try reverting to 3.0.3988 for now. Restore your .db files into a clean 3988 install, I think that'll get you back on your feet.

5drH64gDnDJb commented 5 years ago

Tried Build: 3.0.4334, still having the same issues, reverting back to 3.0.3988

log-20190321.txt

hacktek commented 5 years ago

@hacktek Try reverting to 3.0.3988 for now. Restore your .db files into a clean 3988 install, I think that'll get you back on your feet.

I'll have to look into how to do that. I'm using the linuxserver.io docker container and they seem to only have the latest dev and stable versions only.

tidusjar commented 5 years ago

Ok @5drH64gDnDJb can you try 3.0.4336 since i've made another change from the info in your logs

hacktek commented 5 years ago

OK I was able to roll back by replacing the ombi files with the ones from 3.0.3988 within the container and commiting. Restoring the DBs seems to have worked.

5drH64gDnDJb commented 5 years ago

Ok @5drH64gDnDJb can you try 3.0.4336 since i've made another change from the info in your logs

trying it now, I'll let you know, If I have the issue, it should show up anywhere from an hour to 24 hours

Edit: So far so good, eight hours have gone by and no issues!

gamechld commented 5 years ago

Should I continue testing 4324, or do you want me to update to latest as well?

gamechld commented 5 years ago

@tidusjar Dev-4324 failed :(

info: Ombi.Schedule.Jobs.Plex.PlexContentSync[0] Starting Plex Content Cacher info: Ombi.Schedule.Jobs.Plex.PlexContentSync[0] Starting to cache the content on server VikFlix info: Ombi.Schedule.Jobs.Plex.PlexContentSync[0] Starting Plex Content Cacher info: Ombi.Schedule.Jobs.Plex.PlexContentSync[0] Starting to cache the content on server VikFlix infofail: Ombi.Schedule.Jobs.Plex.PlexContentSync[0] Starting Plex Content Cacher : 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 Ombi.Store.Repository.BaseRepository2.b15_0() in C:\projects\requestplex\src\Ombi.Store\Repository\BaseRepository.cs:line 86 at Ombi.Helpers.GlobalMutex.Lock[T](Func1 func) in C:\projects\requestplex\src\Ombi.Helpers\GlobalMutex.cs:line 29 at Ombi.Store.Repository.BaseRepository2.InternalSaveChanges() in C:\projects\requestplex\src\Ombi.Store\Repository\BaseRepository.cs:line 86 at Ombi.Store.Repository.BaseRepository2.Add(T content) in C:\projects\requestplex\src\Ombi.Store\Repository\BaseRepository.cs:line 51 at Ombi.Core.Engine.MovieRequestEngine.AddMovieRequest(MovieRequests model, String movieName) in C:\projects\requestplex\src\Ombi.Core\Engine\MovieRequestEngine.cs:line 480 at Ombi.Core.Engine.MovieRequestEngine.RequestMovie(MovieRequestViewModel model) in C:\projects\requestplex\src\Ombi.Core\Engine\MovieRequestEngine.cs:line 105 at Ombi.Controllers.RequestController.RequestMovie(MovieRequestViewModel movie) in C:\projects\requestplex\src\Ombi\Controllers\RequestController.cs:line 89 at lambda_method(Closure , Object ) at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.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.ValidateUserAccessToken(HttpContext context, RequestDelegate next, String key) in C:\projects\requestplex\src\Ombi\ApiKeyMiddlewear.cs:line 83 at Ombi.ApiKeyMiddlewear.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ApiKeyMiddlewear.cs:line 47 at Ombi.ErrorHandlingMiddleware.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ErrorHandlingMiddlewear.cs:line 24 infofail: Ombi.Schedule.Jobs.Plex.PlexContentSync[0] Starting to cache the content on server VikFlix : 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 Ombi.Store.Repository.BaseRepository2.b__15_0() in C:\projects\requestplex\src\Ombi.Store\Repository\BaseRepository.cs:line 86 at Ombi.Helpers.GlobalMutex.Lock[T](Func1 func) in C:\projects\requestplex\src\Ombi.Helpers\GlobalMutex.cs:line 29 at Ombi.Store.Repository.BaseRepository2.InternalSaveChanges() in C:\projects\requestplex\src\Ombi.Store\Repository\BaseRepository.cs:line 86 at Ombi.Store.Repository.BaseRepository2.Add(T content) in C:\projects\requestplex\src\Ombi.Store\Repository\BaseRepository.cs:line 51 at Ombi.Core.Engine.MovieRequestEngine.AddMovieRequest(MovieRequests model, String movieName) in C:\projects\requestplex\src\Ombi.Core\Engine\MovieRequestEngine.cs:line 480 at Ombi.Core.Engine.MovieRequestEngine.RequestMovie(MovieRequestViewModel model) in C:\projects\requestplex\src\Ombi.Core\Engine\MovieRequestEngine.cs:line 105 at Ombi.Controllers.RequestController.RequestMovie(MovieRequestViewModel movie) in C:\projects\requestplex\src\Ombi\Controllers\RequestController.cs:line 89 at lambda_method(Closure , Object ) at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.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.ValidateUserAccessToken(HttpContext context, RequestDelegate next, String key) in C:\projects\requestplex\src\Ombi\ApiKeyMiddlewear.cs:line 83 at Ombi.ApiKeyMiddlewear.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ApiKeyMiddlewear.cs:line 47 at Ombi.ErrorHandlingMiddleware.Invoke(HttpContext context) in C:\projects\requestplex\src\Ombi\ErrorHandlingMiddlewear.cs:line 24 failfail: Ombi.Api.Api[1000] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://192.168.1.160:8989/api/series/ : 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.UserManager`1.UpdateUserAsync(TUser user) at Ombi.Controllers.TokenController.<>cDisplayClass7_0.<b1>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](Func1 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 failfail: Ombi.Api.Api[1000] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://192.168.1.160:8989/api/series/ : 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.UserManager`1.UpdateUserAsync(TUser user) at Ombi.Controllers.TokenController.<>c__DisplayClass7_0.<b1>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](Func1 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

5drH64gDnDJb commented 5 years ago

Ok @5drH64gDnDJb can you try 3.0.4336 since i've made another change from the info in your logs

I'm going to say you fixed the issue in this version, I should of ran into a problem by now.

gamechld commented 5 years ago

@5drH64gDnDJb Can you post an update in a few days? I'll give that a shot if you are stable for a few days.

5drH64gDnDJb commented 5 years ago

@5drH64gDnDJb Can you post an update in a few days? I'll give that a shot if you are stable for a few days.

will do!

5drH64gDnDJb commented 5 years ago

Looks like I spoke too soon, issue is now a little different, I'm getting the database lock but I am able to log in, but if I try to request something, it does nothing. I currently have a script that tries to login and if it fails it alerts, but I didnt have a process to try to request something.

log-20190322.txt

tidusjar commented 5 years ago

Ok thanks for that feedback.

I've just kicked off another build with more changes. It removed the job that was added in the build when the dB started locking up.

Sorry.to.keep asking you guys to test this, but I'm unable to recreate it!

rickatnight11 commented 5 years ago

@tidusjar, does it make sense to log additional information when that exception gets thrown, such as other in-flight database transactions/threads?

5drH64gDnDJb commented 5 years ago

Ok thanks for that feedback.

I've just kicked off another build with more changes. It removed the job that was added in the build when the dB started locking up.

Sorry.to.keep asking you guys to test this, but I'm unable to recreate it!

np, I'll update once it's available, I'll also send the logs to my splunk instance so I can alert off the database lock.

Edit: I have update too 3.0.4340, I'll begin testing, thanks for the quick update.

xp-1000 commented 5 years ago

Hello,

I am testing 3.0.4340 for few hours now and it works.

I do not still have authentification problems with database locked. Everything seem to work.

I still have database lock error only on one thing : when I save settings for notifications (I tested discord and gotify and both are affected, I don't know for other services.

2019-03-23 02:38:25.934 +01: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 _, 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 Ombi.Store.Repository.NotificationTemplatesRepository.UpdateRange(IEnumerable`1 templates) in C:\projects\requestplex\src\Ombi.Store\Repository\NotificationTemplatesRepository.cs:line 59
   at Ombi.Controllers.SettingsController.DiscordNotificationSettings(DiscordNotificationsViewModel model) in C:\projects\requestplex\src\Ombi\Controllers\SettingsController.cs:line 725
   at lambda_method(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.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

Thanks for your work, I will come back tell you If I have more information.

EDIT: updating user details also causes database lock error.

5drH64gDnDJb commented 5 years ago

Version: 3.0.4340, here is the error log

log-20190322.txt

gamechld commented 5 years ago

Is there a log file, or do you just paste from the console window?

columbusgeek commented 5 years ago

Not sure if this is helpful or not, but I've had the problem for a few days as well. I tried recreating the container, and a few times even deleted it. I learned that I also had to go in and delete /opt/ombi before it was fully purged. Only then was I able to finally create a login.

Granted, I had to redo all my settings but I don't have anything mission critical.

Hopefully, this might be useful to anybody who is following along but doesn't want to use the dev code and has no problem with starting over.

tidusjar commented 5 years ago

@5drH64gDnDJb Can you please run the latest dev build, but the log, can you include events before the DB started to get locked? Because that's the information I'm trying to find, what is causing the lock :)

5drH64gDnDJb commented 5 years ago

@5drH64gDnDJb Can you please run the latest dev build, but the log, can you include events before the DB started to get locked? Because that's the information I'm trying to find, what is causing the lock :)

Will do, I cleared out the current logs so I dont mix up the old logs with this new dev version, I'll upload all the logs if see the lock.

gamechld commented 5 years ago

@tidusjar Are there log files in the windows version? Or is copying the output from the console window the correct method?

5drH64gDnDJb commented 5 years ago

@tidusjar Are there log files in the windows version? Or is copying the output from the console window the correct method?

Should be under your main folder Ombi > Logs (folder)

tidusjar commented 5 years ago

Also another build is available that I'm feeling confident about