Jump to content

Meta Data base locked


Go to solution Solved by Happy2Play,

Recommended Posts

Posted (edited)

Hello!

My Emby server has been working great for just under a year now until recently...

A few weeks ago I started noticing that Emby is not recognizing that I finished watching a TV show, then also noticed that it won't record that I finished watching a movie either, and when I click the "mark played" button I get this error message "Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown'.

I thought maybe my Emby server install was corrupted so I uninstalled the entire server and recreated all my libraries, users and everything.

After a week I got the same error and message again, I reverted back to a back up from a couple days previous and after a few days the same thing is happening again, this issue also affects all my libraries as well, most of the meta data doesn't load either(cast photos for example).

My server is installed on a Windows 10 PC, I've attached log from the issue.

Edit: I also did try refreshing meta data but this doesn't seem to do anything.

 

Thanks!

 

embyserver-2.txt

Edited by MrHerps
  • Solution
Happy2Play
Posted

The issue appears to be Emby did not shutdown properly so it can't reopen properly.

Busy: database is locked

Please follow the steps here to unlock the db (only that step).

remove-database-locks | Emby Documentation

Posted

First try rebooting the machine because sometimes that will be enough.

Happy2Play
Posted
11 minutes ago, Luke said:

First try rebooting the machine because sometimes that will be enough.

We might want to make that step 1 in the KB.

  • Thanks 1
Posted

Update: 

I found only the "library.db" I couldn't find the other ones described in the article. 

I shut down Emby server, deleted the"library.db" file, I started up Emby, recovered from a previous back up.

Emby is working normally now. 

I think back now and I did restart my entire server the day this issue occurred last.

I'll update if anything changes. 

 Thanks! 

PS is there a way to make Emby server more resilient to unexpected shut down?

 

Posted
19 hours ago, MrHerps said:

 

PS is there a way to make Emby server more resilient to unexpected shut down?

 

Hi, this is something that we're constantly looking at. For best results though I would suggest shutting down the server gracefully rather than force killing it via task manager.

Posted

Hello,

 

I have an additional update!

I had to restart my server a couple times since the last update I gave you, I would go into the Emby server in my web browser, turn the server off using the button in the "manage server" page, I would restart my windows 10 server, and I would get the same problem, the first instance I deleted the library.db file and restored from a previous backup which got the server working normally again.

The second time I got the same problem again after restarting server, this time I checked task manager and found 2 instances of "Emby server" running, I ended one of the 2 instances in task manager, as soon as I did this the errors went away and I could mark videos played with out issue.

I then remembered that I had added Emby Server to "shell:startup" as well as having the "launch on startup" ticked in Emby server itself, I've removed Emby Server from "Shell:startup".

I suspect this should fix this issue completely now.  

  • Agree 1
  • Thanks 1
Posted

Thanks for following up !

brothom
Posted
9 hours ago, MrHerps said:

I then remembered that I had added Emby Server to "shell:startup" as well as having the "launch on startup" ticked in Emby server itself, I've removed Emby Server from "Shell:startup".  

Good to know this can also cause an instance of Emby to be locked out.

@Lukemaybe it's an idea to prevent multiple instances of Emby running on the same system? Maybe a simple alert box stating "Emby is already running" or so.

pwhodges
Posted

I often run two copies - one for use and one for testing.  But if Emby finds while starting that its ports are already taken, it should shut down again immediately, whether or not it gives a warning on the way.

Paul

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...