shinken-monitoring / mod-livestatus

Shinken module for presenting data with a MK/Livestatus comptabile interface
GNU Affero General Public License v3.0
15 stars 20 forks source link

Database is locked #72

Open diogouchoas opened 8 years ago

diogouchoas commented 8 years ago

My livestatus module suddenly began to crash from time to time. The error messages that precede this problema are the following. Already tried unlocking the sqlite database, but the problem seems to keep happening anyway.

[1472150360] ERROR: [broker-master] [livestatus] Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/Shinken-2.4.3-py2.7.egg/shinken/basemodule.py", line 164, in start_module
    self._main()
  File "/usr/local/lib/python2.7/dist-packages/Shinken-2.4.3-py2.7.egg/shinken/basemodule.py", line 296, in _main
    self.main()
  File "/var/lib/shinken/modules/livestatus/module.py", line 242, in main
    self.do_main()
  File "/var/lib/shinken/modules/livestatus/module.py", line 281, in do_main
    self.main_thread_run()
  File "/var/lib/shinken/modules/livestatus/module.py", line 406, in main_thread_run
    self.db.commit_and_rotate_log_db()
  File "/var/lib/shinken/modules/logstore-sqlite/module.py", line 230, in commit_and_rotate_log_db
    self.commit()
  File "/var/lib/shinken/modules/logstore-sqlite/module.py", line 472, in commit
    self.dbconn.commit()
OperationalError: database is locked
dgilm commented 6 years ago

Try with this PR:

https://github.com/shinken-monitoring/mod-logstore-sqlite/pull/15

setting the journal_mode of sqlite to wal