# Grafana SQLite database locked

**URL:** <https://community.grafana.com/t/grafana-sqlite-database-locked/86840>\
**Category:** Configuration\
**Tags:** database, sqlite\
**Created:** [May 1, 2023, 12:46pm UTC](https://community.grafana.com/t/grafana-sqlite-database-locked/86840 "2023-05-01T12:46:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![schachre1998](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@schachre1998](https://community.grafana.com/u/schachre1998)\
**Post date:** [May 1, 2023, 12:47pm UTC](https://community.grafana.com/t/grafana-sqlite-database-locked/86840/1 "2023-05-01T12:47:00Z")

</div>

I have hosted grafana on AWS ECS service. and by default it is using sqlite database. When I am doing queries on dashboards, I am facing database lock issue. and then grafana stops working. it gives 502 bad gateway error.

---

<div class="post-metadata">

**Author:** ![usman.ahmad](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/usman.ahmad/32/29706_2.png) [@usman.ahmad](https://community.grafana.com/u/usman.ahmad)\
**Post date:** [May 1, 2023, 2:19pm UTC](https://community.grafana.com/t/grafana-sqlite-database-locked/86840/2 "2023-05-01T14:19:57Z")

</div>

Hi @schachre1998,

Please check this GitHub [issue](https://github.com/grafana/grafana/issues/64664#issuecomment-1471414001) which shows a possible workaround. Also, SQLite has some [limitations](https://grafana.com/docs/grafana/latest/setup-grafana/installation/#supported-databases) (see Notes section) and therefore is not recommended for use in a production environment.

I hope this helps.

---

<div class="post-metadata">

**Author:** ![usman.ahmad](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/usman.ahmad/32/29706_2.png) [@usman.ahmad](https://community.grafana.com/u/usman.ahmad)\
**Post date:** [September 14, 2023, 10:45am UTC](https://community.grafana.com/t/grafana-sqlite-database-locked/86840/3 "2023-09-14T10:45:07Z")

</div>

Related to the similar post:

> [@Database is locked](https://community.grafana.com/t/database-is-locked/87028):
>
> Hi. Every morning at 6 am I get a warning notification due to “no value”. The reason for the error appears as follows. It fixes in a few minutes, but it causes me to receive dozens of notifications. How can I solve this problem? Version: Grafana v9.5.1 (bc353e4b2d) Error: failed to build query ‘A’: [sqlstore.max-retries-reached] retry 1: database is locked
