FHEM Forum

FHEM => Automatisierung => Thema gestartet von: jack_uf am 04 Januar 2018, 20:12:23

Titel: database is locked
Beitrag von: jack_uf am 04 Januar 2018, 20:12:23
Hallo

Ich habe heute mein FHEM mit Update aktualisiert. Anschliessend ist mir aufgefallen, dass nicht mehr alle SVG Plot dargestellt werden und, dass es sehr lange dauert bis einzelne Plot aufgebaut werden. Im Log habe ich dann folgenden Eintrag gefunden:

Error table history - DBD::SQLite::st execute_array failed: database is locked [err was 5 now 2000000000]
executing 2 generated 2 errors at ./FHEM/93_DbLog.pm line 1520.

Ich habe dann das File 93_DbLog.pm  ca. von Anfang Dezember wiederhergestellt und FHEM neu gestartet. Jetzt scheint wieder alles zu funktionieren.

Hat jemand eine Idee woran es liegen könnte? Welche Informationen kann ich liefern um den Fehler einfacher zu finden?

Besten Dank

jack_uf
Titel: Antw:database is locked
Beitrag von: DS_Starter am 04 Januar 2018, 21:27:43
Ich gehe davon aus, dass das update zu einem ungünstigen Moment ausgeführt wurde.
Dieser "database is locked " Zustand kann z.B, auftreten wenn:

Zitat
    Here are other reasons for getting an SQLITE_LOCKED error:

       * Trying to CREATE or DROP a table or index while a SELECT statement is still pending.
       * Trying to write to a table while a SELECT is active on that same table.
       * Trying to do two SELECT on the same table at the same time in a multithread application, if sqlite is not set to do so.
       * fcntl(3,F_SETLK call on DB file fails. This could be caused by an NFS locking issue, for example. One solution for this issue, is to mv the DB away, and copy it back so that it has a new Inode value

siehe auch:  http://www.sqlite.org/cvstrac/wiki?p=DatabaseIsLocked&t=1292363538

Führe das update einfach noch einmal aus. Du könntest vorher ein "set ... reopen 60" in DbLog absetzen um die DB temporär zu schließen.

Grüße
Heiko