# SQLITE\_BUSY: database is locked

**URL:** <https://community.n8n.io/t/sqlite-busy-database-is-locked/7188>\
**Category:** Questions\
**Created:** [August 10, 2021, 10:18am UTC](https://community.n8n.io/t/sqlite-busy-database-is-locked/7188 "2021-08-10T10:18:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rugia](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/rugia/32/3422_2.png) [@Rugia](https://community.n8n.io/u/Rugia)\
**Post date:** [August 10, 2021, 10:18am UTC](https://community.n8n.io/t/sqlite-busy-database-is-locked/7188/1 "2021-08-10T10:18:46Z")

</div>

Hello,

sometimes when I have Workflow executions windows open a workflow that runs in background on schedule generates an Error - SQLITE\_BUSY: database is locked.

So far I have seen it happening only in **Outlook nodes** (Edit: also in **HTTP request** nodes) and the cause is following:

> {  
> “message”: “SQLITE\_BUSY: database is locked”,  
> “errno”: 5,  
> “code”: “SQLITE\_BUSY”,  
> “\_\_augmented”: true,  
> “name”: “QueryFailedError”,  
> “query”: “UPDATE "credentials\_entity" SET "name" = ?, "type" = ?, "data" = ?, "nodesAccess" = ?, "updatedAt" = ? WHERE "name" = ? AND "type" = ?”,  
> “parameters”: [  
> “[email@email.com](mailto:email@email.com)”,  
> “microsoftOutlookOAuth2Api”,  
> “_…NQJ385…_”,  
> “[{"nodeType":"n8n-nodes-base.microsoftOutlook","date":"2021-03-05T16:27:39.956Z"}]”,  
> “2021-08-09 08:40:25.133”,  
> “[email@email.com](mailto:email@email.com)”,  
> “microsoftOutlookOAuth2Api”  
> ]  
> }

Is it possible to fix it ?

---

<div class="post-metadata">

**Author:** ![krynble](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/krynble/32/2010_2.png) [@krynble](https://community.n8n.io/u/krynble)\
**Post date:** [August 10, 2021, 11:09am UTC](https://community.n8n.io/t/sqlite-busy-database-is-locked/7188/2 "2021-08-10T11:09:10Z")

</div>

Hello @Rugia

I have seen this issue happening a few times. This means that your database is under some heavy load and n8n is unable to write to it.

Just a quick overview of what happens is that n8n is trying to save the information to the database, but only one process can write at a time. If there are multiple executions or actions happening simultaneously, a few of them might fail to write the updates with this error message.

I would strongly suggest migrating your database from SQLite (which is n8n’s default and great for development puprposes) for MySQL or Postgres (preferably the latter).

This should solve this problem.

---

<div class="post-metadata">

**Author:** ![Rugia](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/rugia/32/3422_2.png) [@Rugia](https://community.n8n.io/u/Rugia)\
**Post date:** [August 10, 2021, 11:36am UTC](https://community.n8n.io/t/sqlite-busy-database-is-locked/7188/3 "2021-08-10T11:36:49Z")

</div>

Hi @krynble

Thank you for the response!

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [August 10, 2021, 1:18pm UTC](https://community.n8n.io/t/sqlite-busy-database-is-locked/7188/4 "2021-08-10T13:18:02Z")

</div>

Just fyi if you can not change the database for what reason ever, should also setting:

```bash
export EXECUTIONS_PROCESS=main

```

help with that problem. That will make sure that all executions run in the main process and so parallel access can not happen anymore.

> **[Configuration methods | n8n Docs](https://docs.n8n.io/hosting/configuration/configuration-methods/)**
>
> How to set environment variables for n8n.

---

<div class="post-metadata">

**Author:** ![Surge.Media](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@Surge.Media](https://community.n8n.io/u/Surge.Media)\
**Post date:** [March 6, 2022, 8:57pm UTC](https://community.n8n.io/t/sqlite-busy-database-is-locked/7188/5 "2022-03-06T20:57:11Z")

</div>

Hi @jan

Where would I put the export EXECUTIONS\_PROCESS=main ? in the .env or the yml file ?

---

<div class="post-metadata">

**Author:** ![huuich](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/huuich/32/1115_2.png) [@huuich](https://community.n8n.io/u/huuich)\
**Post date:** [March 7, 2022, 3:58am UTC](https://community.n8n.io/t/sqlite-busy-database-is-locked/7188/6 "2022-03-07T03:58:58Z")

</div>

![image](https://europe1.discourse-cdn.com/n8n/original/2X/9/989a37efae132d34f7825deb4b5e52b2de7c2710.png)  
in yml file like this picture, doesn’t has export.
