Database is locked error in grafana, database is set to postgresql

  • What Grafana version and what operating system are you using?
    Version 9.3.6

  • What are you trying to achieve?
    I want to get rid of database lock error

  • Can you copy/paste the configuration(s) that you are having problems with?
    Error: failed to build query ‘A’: database is locked

I installed Grafana with Postgresql 16. Tried to increase some memory parameters and connection parameters but still have same issue.
Please help here to resolve this issue. Appreciate help. Thanks.

I have analyzed your problem. The “database is locked” error indicates a problem with your 'sqlite 'database. This can happen if the database is left in an inconsistent state after a crash, or if there are problems with the disk.

One thing you can try is to dump the data from your existing db file into a new one, then swap it out. From inside your Grafana data directory after shutting down Grafana.
image

The OP stated they are using postgres not sqlite