# Sqlite Database is Locked

**URL:** https://discourse.nodered.org/t/sqlite-database-is-locked/7829
**Category:** General
**Created:** [11 February 2019 13:54 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829 "2019-02-11T13:54:16Z")
**Posts on this page:** 7
**Page:** 2

<div class="post-metadata">

### Author: ![gnome2012](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@gnome2012](https://discourse.nodered.org/u/gnome2012)
#### Post date: [14 February 2019 07:46 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/21 "2019-02-14T07:46:05Z")

</div>

OK. Thank you

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [14 February 2019 09:05 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/22 "2019-02-14T09:05:11Z")

</div>

I have replicated your setup and file and folder ownership on the share and can't replicate the problem.  
What sort of share is it? I have tested it with a Samba share on another linux machine.  
What version of node-red-node-sqlite are you using?

---

<div class="post-metadata">

### Author: ![gnome2012](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@gnome2012](https://discourse.nodered.org/u/gnome2012)
#### Post date: [14 February 2019 09:40 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/23 "2019-02-14T09:40:19Z")

</div>

It is a windows share (mounted CIFS) I'm using version 0.3.6.

I just tried it on on a different pi with new installed nodered:  
I also created with user pi a new subfolder and moved the database into it.

Result: Error: SQLITE\_BUSY: database is locked

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [14 February 2019 10:23 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/24 "2019-02-14T10:23:00Z")

</div>

Don’t move the database. Try with a new one.

---

<div class="post-metadata">

### Author: ![gnome2012](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@gnome2012](https://discourse.nodered.org/u/gnome2012)
#### Post date: [14 February 2019 10:45 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/25 "2019-02-14T10:45:44Z")

</div>

I made it with a trick:  
It is unclean but it works til a real solution is found.  
I made a share on mi pi with SMB. I share now '/mnt/NVR/e to the second pi that is in use. I mounted the share on the second pi. I linked the Database to a Sqlite-node in the new installed nodered and could write data from there. So I wrote from Pi2 through the share on p1 to the share on a windows-system. that way works.  
I didn't make a new database. It's same file.

I hope I expressed myself clearly.

So now I try to send the SQL via mqqt to nodered on pi2 and write it with a sqlite-node

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [14 February 2019 11:38 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/26 "2019-02-14T11:38:19Z")

</div>

Which shows that it **IS** a permissions issue I think.

---

<div class="post-metadata">

### Author: ![gnome2012](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@gnome2012](https://discourse.nodered.org/u/gnome2012)
#### Post date: [14 February 2019 11:41 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/27 "2019-02-14T11:41:46Z")

</div>

To me it seems to be a CIFS - or a node(sqllite)issue

[Previous page](https://discourse.nodered.org/t/sqlite-database-is-locked/7829.md?page=1)
