question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Database is locked error

See original GitHub issue

Describe the bug Log fills up with DB is locked messages.

Version of frigate Latest RC4

Config file Include your full config file wrapped in triple back ticks.

mqtt:
  host: 10.200.200.65
  user: frigate
  password: password

clips:
  max_seconds: 300
  retain:
    default: 10

detectors:
  coral_pci:
    type: edgetpu
    device: pci

ffmpeg:
  global_args: -hide_banner -loglevel info

ffmpeg:
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p

cameras:
  driveway:
    ffmpeg:
      inputs:
        - path: rtsp://admin:{FRIGATE_RTSP_PASSWORD}@10.200.200.13:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - rtmp
            - detect
        - path: rtsp://admin:{FRIGATE_RTSP_PASSWORD}@10.200.200.13:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - clips
    height: 480
    width: 704
    fps: 5
    motion:    
      mask: 0,129,0,0,703,0,703,272,336,184
    clips:
      enabled: True
      pre_capture: 5
      objects:
        - person

Logs

{"log":" * Starting nginx nginx\n","stream":"stdout","time":"2021-01-23T02:12:53.732146412Z"}
{"log":"   ...done.\n","stream":"stdout","time":"2021-01-23T02:12:53.74357568Z"}
{"log":"frigate.app                    INFO    : Creating directory: /media/frigate/recordings\n","stream":"stderr","time":"2021-01-23T02:12:55.051526507Z"}
{"log":"Starting migrations\n","stream":"stderr","time":"2021-01-23T02:12:55.054440674Z"}
{"log":"peewee_migrate                 INFO    : Starting migrations\n","stream":"stderr","time":"2021-01-23T02:12:55.054573162Z"}
{"log":"There is nothing to migrate\n","stream":"stderr","time":"2021-01-23T02:12:55.061515173Z"}
{"log":"peewee_migrate                 INFO    : There is nothing to migrate\n","stream":"stderr","time":"2021-01-23T02:12:55.061580823Z"}
{"log":"detector.coral_pci             INFO    : Starting detection process: 34\n","stream":"stderr","time":"2021-01-23T02:12:55.078965046Z"}
{"log":"frigate.app                    INFO    : Camera processor started for driveway: 37\n","stream":"stderr","time":"2021-01-23T02:12:55.101531088Z"}
{"log":"frigate.edgetpu                INFO    : Attempting to load TPU as pci\n","stream":"stderr","time":"2021-01-23T02:12:55.106900361Z"}
{"log":"frigate.edgetpu                INFO    : TPU found\n","stream":"stderr","time":"2021-01-23T02:12:55.107053591Z"}
{"log":"frigate.app                    INFO    : Capture process started for driveway: 39\n","stream":"stderr","time":"2021-01-23T02:12:55.107309766Z"}
{"log":"frigate.mqtt                   INFO    : MQTT connected\n","stream":"stderr","time":"2021-01-23T02:12:55.180809409Z"}
{"log":"frigate.http                   ERROR   : Exception on /events/1611429856.134063-qb13qs/thumbnail.jpg [GET]\n","stream":"stderr","time":"2021-01-23T19:25:37.771726918Z"}
{"log":"Traceback (most recent call last):\n","stream":"stderr","time":"2021-01-23T19:25:37.771773013Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 3129, in execute_sql\n","stream":"stderr","time":"2021-01-23T19:25:37.771782581Z"}
{"log":"    cursor.execute(sql, params or ())\n","stream":"stderr","time":"2021-01-23T19:25:37.771789774Z"}
{"log":"sqlite3.OperationalError: database is locked\n","stream":"stderr","time":"2021-01-23T19:25:37.771798784Z"}
{"log":"\n","stream":"stderr","time":"2021-01-23T19:25:37.771805419Z"}
{"log":"During handling of the above exception, another exception occurred:\n","stream":"stderr","time":"2021-01-23T19:25:37.771811704Z"}
{"log":"\n","stream":"stderr","time":"2021-01-23T19:25:37.771818199Z"}
{"log":"Traceback (most recent call last):\n","stream":"stderr","time":"2021-01-23T19:25:37.771827069Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/flask/app.py\", line 2447, in wsgi_app\n","stream":"stderr","time":"2021-01-23T19:25:37.771833914Z"}
{"log":"    response = self.full_dispatch_request()\n","stream":"stderr","time":"2021-01-23T19:25:37.771840688Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/flask/app.py\", line 1952, in full_dispatch_request\n","stream":"stderr","time":"2021-01-23T19:25:37.771847393Z"}
{"log":"    rv = self.handle_user_exception(e)\n","stream":"stderr","time":"2021-01-23T19:25:37.771854028Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/flask/app.py\", line 1821, in handle_user_exception\n","stream":"stderr","time":"2021-01-23T19:25:37.771860942Z"}
{"log":"    reraise(exc_type, exc_value, tb)\n","stream":"stderr","time":"2021-01-23T19:25:37.771867647Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/flask/_compat.py\", line 39, in reraise\n","stream":"stderr","time":"2021-01-23T19:25:37.771874421Z"}
{"log":"    raise value\n","stream":"stderr","time":"2021-01-23T19:25:37.771881335Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/flask/app.py\", line 1950, in full_dispatch_request\n","stream":"stderr","time":"2021-01-23T19:25:37.77189663Z"}
{"log":"    rv = self.dispatch_request()\n","stream":"stderr","time":"2021-01-23T19:25:37.771903964Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/flask/app.py\", line 1936, in dispatch_request\n","stream":"stderr","time":"2021-01-23T19:25:37.771910249Z"}
{"log":"    return self.view_functions[rule.endpoint](**req.view_args)\n","stream":"stderr","time":"2021-01-23T19:25:37.771929316Z"}
{"log":"  File \"/opt/frigate/frigate/http.py\", line 97, in event_thumbnail\n","stream":"stderr","time":"2021-01-23T19:25:37.771935811Z"}
{"log":"    event = Event.get(Event.id == id)\n","stream":"stderr","time":"2021-01-23T19:25:37.771941398Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 6430, in get\n","stream":"stderr","time":"2021-01-23T19:25:37.771946846Z"}
{"log":"    return sq.get()\n","stream":"stderr","time":"2021-01-23T19:25:37.771952712Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 6860, in get\n","stream":"stderr","time":"2021-01-23T19:25:37.771958579Z"}
{"log":"    return clone.execute(database)[0]\n","stream":"stderr","time":"2021-01-23T19:25:37.771964236Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 1898, in inner\n","stream":"stderr","time":"2021-01-23T19:25:37.771969684Z"}
{"log":"    return method(self, database, *args, **kwargs)\n","stream":"stderr","time":"2021-01-23T19:25:37.771975341Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 1969, in execute\n","stream":"stderr","time":"2021-01-23T19:25:37.771980718Z"}
{"log":"    return self._execute(database)\n","stream":"stderr","time":"2021-01-23T19:25:37.771986445Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 2141, in _execute\n","stream":"stderr","time":"2021-01-23T19:25:37.771991753Z"}
{"log":"    cursor = database.execute(self)\n","stream":"stderr","time":"2021-01-23T19:25:37.77199741Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 3142, in execute\n","stream":"stderr","time":"2021-01-23T19:25:37.772002858Z"}
{"log":"    return self.execute_sql(sql, params, commit=commit)\n","stream":"stderr","time":"2021-01-23T19:25:37.772008724Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 3136, in execute_sql\n","stream":"stderr","time":"2021-01-23T19:25:37.772015429Z"}
{"log":"    self.commit()\n","stream":"stderr","time":"2021-01-23T19:25:37.772042457Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 2902, in __exit__\n","stream":"stderr","time":"2021-01-23T19:25:37.772087295Z"}
{"log":"    reraise(new_type, new_type(exc_value, *exc_args), traceback)\n","stream":"stderr","time":"2021-01-23T19:25:37.772096723Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 185, in reraise\n","stream":"stderr","time":"2021-01-23T19:25:37.772102381Z"}
{"log":"    raise value.with_traceback(tb)\n","stream":"stderr","time":"2021-01-23T19:25:37.772107968Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 3129, in execute_sql\n","stream":"stderr","time":"2021-01-23T19:25:37.772113276Z"}
{"log":"    cursor.execute(sql, params or ())\n","stream":"stderr","time":"2021-01-23T19:25:37.772119072Z"}
{"log":"peewee.OperationalError: database is locked\n","stream":"stderr","time":"2021-01-23T19:25:37.77212445Z"}
{"log":"frigate.http                   ERROR   : Exception on /events/1611429907.723563-4j4r6i/thumbnail.jpg [GET]\n","stream":"stderr","time":"2021-01-23T19:25:38.06801146Z"}
{"log":"Traceback (most recent call last):\n","stream":"stderr","time":"2021-01-23T19:25:38.068078158Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 3129, in execute_sql\n","stream":"stderr","time":"2021-01-23T19:25:38.068093313Z"}
{"log":"    cursor.execute(sql, params or ())\n","stream":"stderr","time":"2021-01-23T19:25:38.068113288Z"}
{"log":"sqlite3.OperationalError: database is locked\n","stream":"stderr","time":"2021-01-23T19:25:38.068126487Z"}
{"log":"\n","stream":"stderr","time":"2021-01-23T19:25:38.068135916Z"}
{"log":"During handling of the above exception, another exception occurred:\n","stream":"stderr","time":"2021-01-23T19:25:38.068144716Z"}
{"log":"\n","stream":"stderr","time":"2021-01-23T19:25:38.068154284Z"}
{"log":"Traceback (most recent call last):\n","stream":"stderr","time":"2021-01-23T19:25:38.06819123Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/flask/app.py\", line 2447, in wsgi_app\n","stream":"stderr","time":"2021-01-23T19:25:38.068202753Z"}
{"log":"    response = self.full_dispatch_request()\n","stream":"stderr","time":"2021-01-23T19:25:38.068212601Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/flask/app.py\", line 1952, in full_dispatch_request\n","stream":"stderr","time":"2021-01-23T19:25:38.068221261Z"}
{"log":"    rv = self.handle_user_exception(e)\n","stream":"stderr","time":"2021-01-23T19:25:38.068230201Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/flask/app.py\", line 1821, in handle_user_exception\n","stream":"stderr","time":"2021-01-23T19:25:38.068240467Z"}
{"log":"    reraise(exc_type, exc_value, tb)\n","stream":"stderr","time":"2021-01-23T19:25:38.068249127Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/flask/_compat.py\", line 39, in reraise\n","stream":"stderr","time":"2021-01-23T19:25:38.068257578Z"}
{"log":"    raise value\n","stream":"stderr","time":"2021-01-23T19:25:38.068268753Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/flask/app.py\", line 1950, in full_dispatch_request\n","stream":"stderr","time":"2021-01-23T19:25:38.068277203Z"}
{"log":"    rv = self.dispatch_request()\n","stream":"stderr","time":"2021-01-23T19:25:38.068286003Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/flask/app.py\", line 1936, in dispatch_request\n","stream":"stderr","time":"2021-01-23T19:25:38.068294174Z"}
{"log":"    return self.view_functions[rule.endpoint](**req.view_args)\n","stream":"stderr","time":"2021-01-23T19:25:38.068302695Z"}
{"log":"  File \"/opt/frigate/frigate/http.py\", line 97, in event_thumbnail\n","stream":"stderr","time":"2021-01-23T19:25:38.068310936Z"}
{"log":"    event = Event.get(Event.id == id)\n","stream":"stderr","time":"2021-01-23T19:25:38.068319527Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 6430, in get\n","stream":"stderr","time":"2021-01-23T19:25:38.068329304Z"}
{"log":"    return sq.get()\n","stream":"stderr","time":"2021-01-23T19:25:38.068338034Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 6860, in get\n","stream":"stderr","time":"2021-01-23T19:25:38.068346206Z"}
{"log":"    return clone.execute(database)[0]\n","stream":"stderr","time":"2021-01-23T19:25:38.068355634Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 1898, in inner\n","stream":"stderr","time":"2021-01-23T19:25:38.068363736Z"}
{"log":"    return method(self, database, *args, **kwargs)\n","stream":"stderr","time":"2021-01-23T19:25:38.068372256Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 1969, in execute\n","stream":"stderr","time":"2021-01-23T19:25:38.068380637Z"}
{"log":"    return self._execute(database)\n","stream":"stderr","time":"2021-01-23T19:25:38.068388948Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 2141, in _execute\n","stream":"stderr","time":"2021-01-23T19:25:38.068461442Z"}
{"log":"    cursor = database.execute(self)\n","stream":"stderr","time":"2021-01-23T19:25:38.068475341Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 3142, in execute\n","stream":"stderr","time":"2021-01-23T19:25:38.068483722Z"}
{"log":"    return self.execute_sql(sql, params, commit=commit)\n","stream":"stderr","time":"2021-01-23T19:25:38.068491753Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 3136, in execute_sql\n","stream":"stderr","time":"2021-01-23T19:25:38.068503626Z"}
{"log":"    self.commit()\n","stream":"stderr","time":"2021-01-23T19:25:38.068512147Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 2902, in __exit__\n","stream":"stderr","time":"2021-01-23T19:25:38.068520178Z"}
{"log":"    reraise(new_type, new_type(exc_value, *exc_args), traceback)\n","stream":"stderr","time":"2021-01-23T19:25:38.068528629Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 185, in reraise\n","stream":"stderr","time":"2021-01-23T19:25:38.068547905Z"}
{"log":"    raise value.with_traceback(tb)\n","stream":"stderr","time":"2021-01-23T19:25:38.068557054Z"}
{"log":"  File \"/usr/local/lib/python3.8/dist-packages/peewee.py\", line 3129, in execute_sql\n","stream":"stderr","time":"2021-01-23T19:25:38.068566064Z"}
{"log":"    cursor.execute(sql, params or ())\n","stream":"stderr","time":"2021-01-23T19:25:38.068574514Z"}
{"log":"peewee.OperationalError: database is locked\n","stream":"stderr","time":"2021-01-23T19:25:38.068582616Z"}
{"log":"frigate.app                    INFO    : Stopping...\n","stream":"stderr","time":"2021-01-23T22:23:34.969549276Z"}
{"log":"frigate.object_processing      INFO    : Exiting object processor...\n","stream":"stderr","time":"2021-01-23T22:23:35.107235821Z"}
{"log":"frigate.events                 INFO    : Exiting event processor...\n","stream":"stderr","time":"2021-01-23T22:23:39.925001396Z"}
{"log":"frigate.watchdog               INFO    : Exiting watchdog...\n","stream":"stderr","time":"2021-01-23T22:23:40.530946466Z"}
{"log":"frigate.record                 INFO    : Exiting recording maintenance...\n","stream":"stderr","time":"2021-01-23T22:23:41.254882934Z"}
{"log":"frigate.events                 INFO    : Exiting event cleanup...\n","stream":"stderr","time":"2021-01-23T22:23:42.848922443Z"}

Frigate debug stats

Output from frigate's /debug/stats endpoint

FFprobe from your camera

Run the following command and paste output below

ffprobe <stream_url>

Screenshots If applicable, add screenshots to help explain your problem.

Computer Hardware

  • OS: [e.g. Ubuntu, Windows]
  • Virtualization: [e.g. Proxmox, Virtualbox]
  • Coral Version: [e.g. USB, PCIe, None]
  • Network Setup: [e.g. Wired, WiFi]

Camera Info:

  • Manufacturer: [e.g. Dahua]
  • Model: [e.g. IPC-HDW5231R-ZE]
  • Resolution: [e.g. 720p]
  • FPS: [e.g. 5]

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

0reactions
blakeblackshearcommented, Jan 26, 2021

Reopen if this issue comes back up

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I unlock a SQLite database? - Stack Overflow
If a process has a lock on an SQLite DB and crashes, the DB stays locked permanently. That's the problem ...
Read more >
How to Fix SQLite Error Database is Locked - Error Code 5
This error code occurs when the user tries to perform two inappropriate operations on a database at the same detail and on the...
Read more >
Fix SQLite Database File is Locked Error - Kernel Data Recovery
Normally, the error occurs when two users try to run transactions on the same tables and change the content. SQLite engine finds it...
Read more >
How to Fix SQLite “Database Locked” Error - KaplanSoft
This error code occurs when the user tries to perform two inappropriate operations on a database at the same detail and on the...
Read more >
How to Resolve "Sqlite Database is Locked" Error Code 5?
The error occurs mainly when a user executes two inappropriate transactions in any database against the same connection. This Error message ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found