Michael.D.Pine 4 Posted June 16, 2021 Posted June 16, 2021 What is the situation with this, surely this can't be just me ? twice in about 4 days now, the database getting locked, says so in the log files, this has only started happening very recently within the last week, has something changed in a recent update ?
Happy2Play 9780 Posted June 16, 2021 Posted June 16, 2021 (edited) The question will be why is Emby shutting down and not closing the database? Does your install shutdown or get shutdown? Only way to resolve the issue is deleting the shm and wal file with Emby shutdown. But yes the devs are looking into this issue but have not found a reason or able to reproduce that I am aware of. Edited June 16, 2021 by Happy2Play
CBers 7450 Posted June 16, 2021 Posted June 16, 2021 I believe @Spaceboy has/had a similar issue. If you have optimisation enabled on shutdown, that may be causing the issue. 1
Happy2Play 9780 Posted June 16, 2021 Posted June 16, 2021 2 minutes ago, CBers said: I believe @Spaceboy has/had a similar issue. If you have optimisation enabled on shutdown, that may be causing the issue. That is the only thing I can think of but was somewhat dismissed in another topic. But would need users to test disabling OptimizeDbOnShutdown>true</OptimizeDbOnShutdown> in their system.xml, until Luke gets these options in the UI.
pwhodges 2012 Posted June 16, 2021 Posted June 16, 2021 If Windows is shut down, will Emby prevent the completion of the shutdown while the DB optimisation takes place? Paul
Happy2Play 9780 Posted June 16, 2021 Posted June 16, 2021 4 minutes ago, pwhodges said: If Windows is shut down, will Emby prevent the completion of the shutdown while the DB optimisation takes place? Paul I have yet to experience this issue but I am on ssd or nvmie drives and optimization happens rather quickly.
Michael.D.Pine 4 Posted June 16, 2021 Author Posted June 16, 2021 That is all very well and good but my HTPC does NOT get shutdown, I will try and look through the logs but seriously I haven't changed anything and this has just started happening this week. the HTPC stays on I don't turn it off at all, I'm not aware of us having any power outages, I would know.
Michael.D.Pine 4 Posted June 16, 2021 Author Posted June 16, 2021 This PC is also running on an NVme drive again I'm not trying to deflect but I/Me has not changed anything on the HTPC, I know Windows can change things but I would assume mass people would be getting this if that happened to be a Windows issue.
Happy2Play 9780 Posted June 16, 2021 Posted June 16, 2021 (edited) There has to be a shutdown process as the only way for this Busy: database locked to happen is if previous database session does not shutdown properly and the new session can not take control of the database. Or you have multiple instances of Emby launching on your Window system. But yes there are several reports on this issue and all you can do is wait for the devs to come up with a solution, but until then you will have to delete the shm and wal files and monitor your install. Edited June 16, 2021 by Happy2Play
Michael.D.Pine 4 Posted June 16, 2021 Author Posted June 16, 2021 Appreciate the reply, no I do not have multiple instances but you can't on a forum like this say "The only way for ...... to happen is if ...... happens" because clearly it does happen. I don't know everything but I do work in IT and at the end of the day this HTPC is for my wife so I RARELY change it because I do not want to face the wrath that is "My TV IS NOT WORKING, WHY!?" It's very frustrating when stuff like this happens so clearly something is happening, I'll keep and eye open and the next time it happens I'll have a look at the logs and upload them, so you can see if there is anything that sticks out, I'll also check the Windows logs for things happening around that time if I get a chance.
CBers 7450 Posted June 16, 2021 Posted June 16, 2021 (edited) 9 minutes ago, Happy2Play said: you will have to delete the shm and wal files Surely that's not a safe thing to do, as they are temporary files being used by the database itself to store changes before they are applied, aren't they? I'm no database expert, and I know there may be no way around it, but you could end up with an inconsistent database at some point if you're just deleting the files willy-nilly. Edited June 16, 2021 by CBers
Happy2Play 9780 Posted June 16, 2021 Posted June 16, 2021 1 minute ago, CBers said: Surely that's not a safe thing to do, as they are temporary files being used by the database itself to store changes before they are applied, aren't they? I'm know database expert, and I know there may be no way around it, but you could end up with an inconsistent database at some point if you're just deleting the files willy-nilly. Once that database is at that point there is no way around it from my understanding. So the issue of why the database is not closing properly is the underlying issue. I would assume disabling all these new database setting would be the first thing to do, but it does not affect everyone, so there has to be a environmental factor. 1
Carlo 4561 Posted June 16, 2021 Posted June 16, 2021 1 hour ago, Happy2Play said: That is the only thing I can think of but was somewhat dismissed in another topic. But would need users to test disabling OptimizeDbOnShutdown>true</OptimizeDbOnShutdown> in their system.xml, until Luke gets these options in the UI. This set to false on the latest builds by default to try and see if this issue was related to that and it doesn't appear to be the case. 39 minutes ago, Michael.D.Pine said: Appreciate the reply, no I do not have multiple instances but you can't on a forum like this say "The only way for ...... to happen is if ...... happens" because clearly it does happen. I don't know everything but I do work in IT and at the end of the day this HTPC is for my wife so I RARELY change it because I do not want to face the wrath that is "My TV IS NOT WORKING, WHY!?" It's very frustrating when stuff like this happens so clearly something is happening, I'll keep and eye open and the next time it happens I'll have a look at the logs and upload them, so you can see if there is anything that sticks out, I'll also check the Windows logs for things happening around that time if I get a chance. We are sorry for this disruption and know it's a pain. We are trying to find the cause/resolution but it's been very hard to reproduce. Can you tell us do you run as a service or have Emby start automatically at login? Do you ever switch users on the Emby Server once logged in? 34 minutes ago, CBers said: Surely that's not a safe thing to do, as they are temporary files being used by the database itself to store changes before they are applied, aren't they? I'm no database expert, and I know there may be no way around it, but you could end up with an inconsistent database at some point if you're just deleting the files willy-nilly. It's safe to delete these two files when Emby Server is shutdown.
Carlo 4561 Posted June 16, 2021 Posted June 16, 2021 What is really frustrating about this is that I don't recall this happening at all during beta testing and this was a long beta (6 month or so). It's only happening to a small amount of users overall but it's still prevalent that we see it in the forums probably at least once a day. It's possible it's something Luke changed code wise but likely more so, something changed in a library used that is ever so slightly different in the way it shuts down.
Happy2Play 9780 Posted June 16, 2021 Posted June 16, 2021 2 minutes ago, cayars said: What is really frustrating about this is that I don't recall this happening at all during beta testing and this was a long beta (6 month or so). True and I have not been able to make this happen either. Killing the task with force the database shm and wal files to remain, and Emby still launches and functions without locking in all my tests on my systems.
Carlo 4561 Posted June 16, 2021 Posted June 16, 2021 (edited) @Happy2Play you don't use DVR do you? I wonder if possibly a schedule or wake on demand command get's interpreted incorrectly? I've also not tested auto startup for a user then using the machine and logging in/out as other users and back again. I'll try this a few ways today. Edited June 16, 2021 by cayars
Spaceboy 2573 Posted June 16, 2021 Posted June 16, 2021 3 hours ago, Happy2Play said: I have yet to experience this issue but I am on ssd or nvmie drives and optimization happens rather quickly. nvme pcie 4.0 here. dont think its that
Luke 42078 Posted June 16, 2021 Posted June 16, 2021 I may have finally found the cause of this. For those who run the beta server, please see if it happens in 4.7.0.3+. Please note that if it was already locked by an earlier version, it won't correct that. It just will prevent it from happening again hopefully. Thanks. 1
Carlo 4561 Posted June 23, 2021 Posted June 23, 2021 No this fix is not in 4.6.3 as we wanted to test it first in beta. But it's in anything 4.7.0.3 or later (beta). 1
dragun 0 Posted June 23, 2021 Posted June 23, 2021 On 16/06/2021 at 07:14, cayars said: It's safe to delete these two files when Emby Server is shutdown. I am using docker on linux and have been experiencing this for a week or two. Previously rebooting the whole machine would "fix" the issue temporarily. But now even deleting these 2 files will not unlock the Db...No watched status is being updated, LiveTV guide will not refresh and no new content is being scanned into the library. embyserver-dragun-6-23-21.txt
Happy2Play 9780 Posted June 23, 2021 Posted June 23, 2021 2 minutes ago, dragun said: I am using docker on linux and have been experiencing this for a week or two. Previously rebooting the whole machine would "fix" the issue temporarily. But now even deleting these 2 files will not unlock the Db...No watched status is being updated, LiveTV guide will not refresh and no new content is being scanned into the library. embyserver-dragun-6-23-21.txt 14.96 MB · 0 downloads But your log starts locked so the server was not started with a unlock database. But I have not heard what the potential cause is.
dragun 0 Posted June 23, 2021 Posted June 23, 2021 2 minutes ago, Happy2Play said: But your log starts locked so the server was not started with a unlock database. But I have not heard what the potential cause is. Thats my point. Its locked even after a reboot...
Luke 42078 Posted June 23, 2021 Posted June 23, 2021 6 minutes ago, dragun said: Thats my point. Its locked even after a reboot... Hi, please follow the steps here: https://support.emby.media/support/solutions/articles/44002210894-corrupt-database And let us know if this helps. Thanks.
Happy2Play 9780 Posted June 23, 2021 Posted June 23, 2021 11 minutes ago, dragun said: Thats my point. Its locked even after a reboot... Yes if the shm and wal files are not removed on Emby shutdown the database will remain locked and a reboot will not do anything.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now