HA 39.1 Database Problems

Hi everybody,

getting some Database Problems since upgraded to 39.1:

17-03-01 18:05:56 ERROR (Thread-9) [homeassistant.components.recorder] Error during query: (sqlite3.OperationalError) database is locked 17-03-01 18:06:02 ERROR (Thread-9) [homeassistant.components.recorder] Error during query: (sqlite3.OperationalError) database is locked

Help from someone?

Thx in Advance…

Maybe a corrupt db or a session that stuck?

Try this:

$ sqlite3 NAMEOFDATABASE.db "pragma integrity_check;"

1 Like

Just move to mySQL, that will solve all problems about database locked…
Ps: if you search about “database locked” on this forum, you will find many topics… and solutions

Well, yes; I would suggest that too. You’ll get better performance and you can keep longer logs.

But it’s also good to do that from a place of stability. Better to know what is going on than just move on to another db and have the issue follow you, which it has in some cases if you look at the issues on Github.

1 Like

Hi @Peter_Konig i had the same problem, fixed it by installing mySQL

have a look at this link for help on installing : https://github.com/sjorsjes/home-assistant#install-mysql-db

Hi rpitera,

doesn’t work, Command not found… :frowning:

Crap. I thought that was part of the standard sqlLite libs but maybe it isn’t. I don’t use SQLlite anymore so I am at loss; the only thing I can think of is renaming the db and letting HA recreate it.

That should at least fix the lock issue and as long as you don’t delete the old db someone in here may have an idea of how to fix it.