# 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:** 20\
**Page:** 1

<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:** [11 February 2019 13:54 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/1 "2019-02-11T13:54:17Z")

</div>

Hello,

I hope for some help. My SqLite Database- File ist stored in /home/pi/.  
Everything is working fine working with node-red-node-sqlite 0.3.6. But when I try to write the copied (same file) to my network-Drive I can only read from it. By writing I get the "Database is Locked" Error. I changed the SQLite-Node and linked it to the new path(my Network-Drive; /mnt/NVR/e). The path is full accessable within node-red. I can delete and rename the Database (and other files) when I use the EXEC-node. So it shouldn't be a permission-problem (/mnt/NVR/e is full accessable for 'everyone'.  
I hope i can get any ideas to solve this.

Thank you in advance

Greetings Roland

---

<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:** [11 February 2019 14:55 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/2 "2019-02-11T14:55:35Z")

</div>

Is any other application accessing the database? Including any command line utility you may be 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:** [11 February 2019 16:43 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/3 "2019-02-11T16:43:25Z")

</div>

No, I double checked that. And it's simply impossible: I copied the .db file to /mnt/NVR/e (so trhere was no file before so no other application could access the (not existing) database.  
After copying, the node cannot write (database is locked). But I can access it with the commandline.

---

<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:** [11 February 2019 17:15 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/4 "2019-02-11T17:15:41Z")

</div>

> [@gnome2012](#):
>
> No, I double checked that. And it's simply impossible:  
> ...  
> But I can access it with the commandline.

Well that is another process accessing it so it's not impossible. Make sure you don't try to access with command line at the same time as node-red.  
Assuming it is not that, however, can you write to it with the command line?

---

<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:** [12 February 2019 01:02 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/5 "2019-02-12T01:02:47Z")

</div>

it is impossible. I tried to write data to the database via commandline AFTER I failed to write with nodered. At this point no application 'knew' that there is a database (execpt one nodered sqlite-node that says it was locked). one other sqlite-node is linked to a database in /home/pi/ and works perfectly. but I need it to get it work when the database is' stored in /mnt/NVR/e'.

summary:

1. copied the database to path /mnt/NVR/e (database exists now in the path /mnt/NVR/e.
2. try to write with nodered =\> 'database is locked'
3. try with commandline ==\> success

tried it all with other subdirectories. =\>same

in local it works fine.

---

<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:** [12 February 2019 09:23 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/6 "2019-02-12T09:23:05Z")

</div>

Sorry, no idea in that case.

Are you wanting to do simultaneous access to the db on a shared drive? If so then it is generally considered that sqlite doesn't work well in that situation.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 February 2019 09:35 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/7 "2019-02-12T09:35:30Z")

</div>

Instead of copying the database, have you tried doing a back/restore from CLI sqlite?  
or search Google for some [ideas](https://www.arysontechnologies.com/blog/fix-sqlite-error-database-locked/)?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [12 February 2019 11:23 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/8 "2019-02-12T11:23:53Z")

</div>

Are you sure nothing else is holding the "database" open ? like the read... ?

---

<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:** [12 February 2019 13:05 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/9 "2019-02-12T13:05:35Z")

</div>

@dceejay: i bet my life on it!!  
again: how can any application a database open, when I seconds before I want to access it with nodered, (write) is created by copying it in a folder. before it doesn't exist. I tried it on several subfolders.

---

<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:** [12 February 2019 13:29 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/10 "2019-02-12T13:29:48Z")

</div>

Can you write a file from node-red to that folder? Try with the File Out node.

---

<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:** [13 February 2019 06:12 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/11 "2019-02-13T06:12:43Z")

</div>

Thx Colin! I found something interesting.  
I can write to that folder using 'node-red-contrib-fs' with the node 'file delete'. And I can do a test with 'file-access' (read/write). Both successful.  
But with the node 'File-Lister' I can't even read that folder ("Error processing folder listing").  
home/pi/ can be listed to any subfolder in that path (with the same node).

Is it possibble that some nodes have different permissions?  
strange

---

<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:** [13 February 2019 16:19 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/12 "2019-02-13T16:19:20Z")

</div>

Sorry, I am out of ideas.

---

<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:** [13 February 2019 17:07 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/13 "2019-02-13T17:07:12Z")

</div>

One more thing to try. What do these commands show

```bash
ls -al /mnt/NVR
ls -al /mnt/NVR/e

```

Copy/paste the results here.  
Also copy/paste the result of

```bash
node-red-stop
node-red-start

```

Also export the sqlite node and paste it here.

---

<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:** [13 February 2019 18:38 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/14 "2019-02-13T18:38:19Z")

</div>

Colin, thanks for the effort:  
here we go:

pi@raspberrypi:/mnt/NVR $ ls -al /mnt/NVR  
insgesamt 48  
drwxrwxrwx 3 root root 4096 Jun 16 2017 .  
drwxrwxrwx 5 root root 4096 Feb 13 09:49 ..  
drwxrwxrwx 2 root root 40960 Feb 13 19:18 e

pi@raspberrypi:/mnt/NVR $ ls -al /mnt/NVR/e  
insgesamt 40582342  
drwxrwxrwx 2 root root 40960 Feb 13 19:18 .  
drwxrwxrwx 3 root root 4096 Jun 16 2017 ..  
-rwxrwxrwx 1 root root 3592 Jun 26 2017 Acer wecken.xml  
-rwxrwxrwx 1 root root 5632 Nov 6 13:59 Alexa.4tw  
-rwxrwxrwx 1 root root 4608 Nov 6 12:21 Alexa.4tw.pre\_850  
-rwxrwxrwx 1 root root 5632 Nov 6 12:37 Alexa.4tw.prev  
-rwxrwxrwx 1 root root 15471 Feb 3 19:33 .alexa.devicelist.json  
-rwxrwxrwx 1 root root 33647 Feb 3 19:32 .alexa.login  
-rwxrwxrwx 1 root root 5582 Nov 6 11:59 Alexa\_Login.mrf  
-rwxrwxrwx 1 root root 3900 Nov 6 15:05 alexa.rec  
-rwxrwxrwx 1 root root 794 Mai 21 2017 amzon\_AWS-codes.txt  
drwxrwxrwx 2 root root 0 Aug 30 2017 Application Files  
-rwxrwxrwx 1 root root 3174012 Nov 6 12:09 AutoHotkey\_1.1.30.00\_setup.exe  
drwxrwxrwx 2 root root 0 Feb 5 18:09 be960225447221f0fc3e4dd7f1f319  
drwxrwxrwx 2 root root 0 MÃ¤r 7 2017 BlueIris  
-rwxrwxrwx 1 root root 9216 Aug 30 2017 CatAway.exe  
-rwxrwxrwx 1 root root 11 Jan 25 07:00 Cataway.txt  
drwxrwxrwx 2 root root 0 Jun 14 2017 CD-Rom  
-rwxrwxrwx 1 root root 45260 Sep 22 11:29 config\_Rollladen\_U13\_Build20100\_201811 (1).dat  
-rwxrwxrwx 1 root root 65536 Sep 22 11:28 config\_Rollladen\_U13\_Build20100\_201811.dat  
-rwxrwxrwx 1 root root 5660 Aug 30 2017 ConsoleApplication4.application  
-rwxrwxrwx 1 root root 20626 Feb 13 18:03 cookies.txt  
-rwxrwxrwx 1 root root 1126 Okt 4 13:21 Cube\_Status.txt  
-rwxrwxrwx 1 root root 4264558592 Jan 12 2017 Debian 8.6.0 (32bit).vdi  
-rwxrwxrwx 1 root root 331350016 Mai 23 2017 debian-8.8.0-i386-netinst.iso  
-rwxrwxrwx 1 root root 642977280 MÃ¤r 12 2017 debian\_exp.ova  
drwxrwxrwx 2 root root 0 Feb 4 21:54 f  
drwxrwxrwx 2 root root 0 Feb 4 21:46 Fhem  
-rwxrwxrwx 1 root root 320096 Nov 2 21:43 Firefox Installer (1).exe  
-rwxrwxrwx 1 root root 320096 Nov 2 21:29 Firefox Installer.exe  
drwxrwxrwx 2 root root 0 Sep 13 19:04 FRITZ!fax\_3.07.04 Installation  
-rwxrwxrwx 1 root root 18089776 Sep 13 19:07 FRITZ!fax\_3.07.04 Installation.zip  
-rwxrwxrwx 1 root root 199 MÃ¤r 19 2018 ic\_add\_black\_48px.svg  
-rwxrwxrwx 1 root root 181 MÃ¤r 19 2018 ic\_remove\_black\_24px.svg  
drwxrwxrwx 2 root root 0 Jun 2 2017 Kiwi-Syslog-Server-9.6.1-Freeware  
-rwxrwxrwx 1 root root 8891166 Feb 8 07:57 koko-lambda-upload.zip  
drwxrwxrwx 2 root root 0 Nov 6 12:06 MacroDollar-0.6.1  
-rwxrwxrwx 1 root root 117718 Nov 6 12:05 MacroDollar-0.6.1.zip  
drwxrwxrwx 2 root root 0 Sep 13 09:02 MAXBuddy-r9.16.2-win  
-rwxrwxrwx 1 root root 52240998 Sep 10 15:18 MAXBuddy-r9.16.2-win.zip  
-rwxrwxrwx 1 root root 98925112 Sep 10 15:09 max\_home\_automation\_setup\_2\_10.exe  
-rwxrwxrwx 1 root root 2542720 Nov 6 11:48 mouserecordersetup.exe  
-rwxrwxrwx 1 root root 7034976 Nov 6 12:12 mtw\_free.exe  
drwxrwxrwx 2 root root 0 Jan 25 08:27 Musik  
-rwxrwxrwx 1 root root 17182720 Feb 5 18:04 mysql-installer-web-community-8.0.15.0.msi  
-rwxrwxrwx 1 root root 1426720 Feb 5 18:06 NDP47-KB3186500-Web.exe  
-rwxrwxrwx 1 root root 3638 Jun 25 2017 OMV wecken.xml  
drwxrwxrwx 2 root root 0 Jun 14 2017 prtg  
-rwxrwxrwx 1 root root 164879976 Jun 2 2017 prtg.zip  
drwxrwxrwx 2 root root 0 MÃ¤r 16 2018 raps  
-rwxrwxrwx 1 root root 31914983424 Jun 4 2017 raspberrypi-dd-backup-20170604-220201.img  
drwxrwxrwx 2 root root 0 Feb 13 00:43 Rasp\_Fhem\_Backup  
-rwxrwxrwx 1 root root 4025483264 Mai 15 2017 Rasp.img  
drwxrwxrwx 2 root root 0 MÃ¤r 8 2017 $RECYCLE.BIN  
-rwxrwxrwx 1 root root 771512 Aug 30 2017 setup.exe  
drwxrwxrwx 2 root root 0 Okt 3 14:36 SharedData  
drwxrwxrwx 2 root root 0 MÃ¤r 8 2017 Sicherung\_HDD0\_20170308\_1611  
drwxrwxrwx 2 root root 0 Mai 4 2017 Sicherung\_HDD1\_20170504\_0954  
drwxrwxrwx 2 root root 0 Jan 2 2018 Sicherung\_HDD1\_20180102\_1512  
-rwxrwxrwx 1 root root 61440 Feb 13 10:06 SmartH.db  
-rwxrwxrwx 1 root root 2375 Mai 21 2017 sonofF\_FEHEN.txt  
-rwxrwxrwx 1 root root 9216 Sep 28 2017 Sonoff\_Reboot.exe  
drwxrwxrwx 2 root root 0 Feb 3 10:32 sqliteadmin  
drwxrwxrwx 2 root root 0 Feb 13 06:53 StH  
drwxrwxrwx 2 root root 0 Jul 16 2016 System Volume Information  
-rwxrwxrwx 1 root root 6369 Feb 2 20:46 test  
-rwxrwxrwx 1 root root 6369 Feb 2 20:46 test.xls  
-rwxrwxrwx 1 root root 33792 Nov 6 13:54 tinytask\_162.exe  
-rwxrwxrwx 1 root root 102 Feb 5 18:01 tinytask\_162.ini  
drwxrwxrwx 2 root root 0 Mai 14 2017 Visual Studio 2008  
drwxrwxrwx 2 root root 0 Mai 14 2017 Visual Studio 2010  
drwxrwxrwx 2 root root 0 Jun 26 2017 WOL2  
-rwxrwxrwx 1 root root 50176 Jan 4 2005 WolCmd.exe  
-rwxrwxrwx 1 root root 140184 Jun 25 2017 wol.exe  
-rwxrwxrwx 1 root root 361199 Okt 29 2017 xbmc-gamepass-master.zip

```auto
node-red-stop
pi@raspberrypi:/mnt/NVR $ node-red-stop

Stop Node-RED

Use node-red-start to start Node-RED again

node-red-stop

pi@raspberrypi:/mnt/NVR $ node-red-start

Start Node-RED

Once Node-RED has started, point a browser at http://192.168.0.248:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as a systemd service.
Started Node-RED graphical event wiring tool.
13 Feb 19:35:12 - [info]
Welcome to Node-RED
===================
13 Feb 19:35:12 - [info] Node-RED version: v0.19.4
13 Feb 19:35:12 - [info] Node.js version: v8.12.0
13 Feb 19:35:12 - [info] Linux 4.9.35-v7+ arm LE
13 Feb 19:35:13 - [info] Loading palette nodes
13 Feb 19:35:25 - [info] Dashboard version 2.13.0 started at /ui
13 Feb 19:35:26 - [warn] ------------------------------------------------------
13 Feb 19:35:26 - [warn] [node-red-contrib-xiaomi-devices/xiaomi-ht] Type already registered
13 Feb 19:35:26 - [warn] [node-red-contrib-xiaomi-devices/xiaomi-magnet] Type already registered
13 Feb 19:35:26 - [warn] [node-red-contrib-xiaomi-devices/xiaomi-motion] Type already registered
13 Feb 19:35:26 - [warn] [node-red-contrib-xiaomi-devices/xiaomi-switch] Type already registered
13 Feb 19:35:26 - [warn] [node-red-contrib-xiaomi-devices/xiaomi-socket] Type already registered
13 Feb 19:35:26 - [warn] [node-red-contrib-xiaomi-devices/xiaomi-socket-wifi] Type already registered
13 Feb 19:35:26 - [warn] [node-red-contrib-xiaomi-devices/xiaomi-configurator] Type already registered
13 Feb 19:35:26 - [warn] [node-red-contrib-snowboy/snowboy] Error: libcblas.so.3: cannot open shared object file: No such file or directory (line:5)
13 Feb 19:35:26 - [warn] ------------------------------------------------------
13 Feb 19:35:26 - [info] Settings file : /home/pi/.node-red/settings.js
13 Feb 19:35:26 - [info] Context store : 'default' [module=memory]
13 Feb 19:35:26 - [info] User directory : /home/pi/.node-red
13 Feb 19:35:26 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
13 Feb 19:35:26 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
13 Feb 19:35:26 - [info] Server now running at http://127.0.0.1:1880/
13 Feb 19:35:26 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
13 Feb 19:35:26 - [info] Starting flows
13 Feb 19:35:27 - [info] [maxcube-server:877c6ca6.d771b] undefined
13 Feb 19:35:29 - [info] [fritzbox-callmonitor:266e9be6.127eb4] Connecting to fritzbox...
13 Feb 19:35:29 - [info] Started flows
13 Feb 19:35:30 - [info] [sqlitedb:9596ebaa.b1646] opened /home/pi/SmartH.db ok
13 Feb 19:35:30 - [info] [sqlitedb:9596ebaa.b1646] opened /home/pi/SmartH.db ok
13 Feb 19:35:30 - [info] [sqlitedb:9596ebaa.b1646] opened /home/pi/SmartH.db ok
13 Feb 19:35:30 - [info] [sqlitedb:9596ebaa.b1646] opened /home/pi/SmartH.db ok
13 Feb 19:35:30 - [info] [sqlitedb:94a0d278.049a18] opened /mnt/blue/SmartH.db ok
13 Feb 19:35:31 - [info] [fritzbox-callmonitor:266e9be6.127eb4] Connected to fritzbox
13 Feb 19:35:31 - [info] [mqtt-broker:44384cc2.2368f4] Connected to broker: mqtt://192.168.0.249:1883
13 Feb 19:35:31 - [info] [mqtt-broker:localhost] Connected to broker: mqtt://localhost:1883
13 Feb 19:35:35 - [info] [exec:bfb8276f.105be] error:Error: Command failed: sh /alexa_remote_control.sh -d " 21.10" -e speak:'GÃ¤ste-WC-Heizung ist auf undefined Grad eingestellt! Die aktuelle Temperatur betrÃ¤gt 21 Grad. Der Thermostat ist zu undefined prozent geÃ¶ffnet. Die Luftfeuchtigkeit betrÃ¤gt 37 Prozent!'
13 Feb 19:35:39 - [info] [maxcube out:e4f625bc.295a88] {"duty_cycle":0,"free_memory_slots":50}

I hope you can find something. thanx

```

---

<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:** [13 February 2019 20:37 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/15 "2019-02-13T20:37:39Z")

</div>

At least part of your issue is that all of those files and folders are owned by root:root. Since Node-RED is most likely not being run by user root (or a user in group root), you may hit some issues.

Maybe try changing ownership to pi:users instead?

---

<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:** [13 February 2019 20:46 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/16 "2019-02-13T20:46:11Z")

</div>

Well, lets start from the begining.  
Probably nothing to do with the problem, but you should sort it first anyway, just in case. You seem to have installed two conflicting xiaomi nodes. Remove whichever one you are not using and make sure those warnings go away.  
Next, you seem to be opening multiple connections to `/home/pi/SmartH.db`  
and one to `/mnt/blue/SmartH.db`. I guess this means you have multiple config nodes instead of re-using the same one in the sqlite nodes. You should sort it so you only use one config node for each database (I think).  
Did you realise you are using two databases with the same name, one on the pi and one on the share?  
Finally did it occur to you to wonder why I asked for an ls of /mnt/NVR/e? It was to see the permissions on the database, but it seems it is not there at all, it is in /mnt/blue, so that is the folder that is of interest. If you do this again then I don't need to see all the files, just that one.  
I suggest you clear up the known problems first then see what happens.

---

<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:** [13 February 2019 20:55 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/17 "2019-02-13T20:55:34Z")

</div>

Personally as this is in a pi I would start again.

Export your flows and email them to your self.  
Then start with a new install, install the nodes you use and you shouldn’t have an issue with permissions

You can then reimport your flows

---

<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:** [13 February 2019 20:57 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/18 "2019-02-13T20:57:48Z")

</div>

I think the permissions issues are on a shared drive, not on the pi. But actually he/she isn't even using that folder so I don't think it is relevant.

---

<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 06:33 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/19 "2019-02-14T06:33:07Z")

</div>

first:  
I´ll fix the conflicting xaomi nodes and see.

> [@Colin](#):
>
> Next, you seem to be opening multiple connections to `/home/pi/SmartH.db`  
> and one to `/mnt/blue/SmartH.db` . I guess this means you have multiple config nodes instead of re-using the same one in the sqlite nodes. You should sort it so you only use one config node for each database (I think).  
> Did you realise you are using two databases with the same name, one on the pi and one on the share?

yes, there is now a config-node pointing to /mnt/blue. I made an other share pointing to the same destination. I wanted to be sure that there is realy no permission issue caused by the host. But didn't solve the problem. A few hours before that sqlite-node was configured linking to /mnt/NVR/e. This is the node I triy to get to work to store my data.  
The `/home/pi/SmartH.db`-node is the current working sqlite-node where I store my data as long as I can't get the other to work.

> [@Colin](#):
>
> Did you realise you are using two databases with the same name, one on the pi and one on the share?  
> Finally did it occur to you to wonder why I asked for an ls of /mnt/NVR/e? It was to see the permissions on the database, but it seems it is not there at all, it is in /mnt/blue, so that is the folder that is of interest. If you do this again then I don't need to see all the files, just that one.

/mnt/blue was just a testing thing. In the meantime I reconfigured it to  
/mnt/NVR/e again an unmounted /mnt/blue . So you saw the permissions of the right folder .  
Sorry, I wasn`t aware that the node was still configured to mnt/blue.  
To be clear, I'm using this folder: mnt/NVR/e

> [@Colin](#):
>
> I think the permissions issues are on a shared drive, not on the pi. But actually he/she isn't even using that folder so I don't think it is relevant.

So when there is a permission issue, why can I write to the shared drive with some nodes and, with other nodes I can't? With file-lister-node I can't even read.

> [@gnome2012](#):
>
> Thx Colin! I found something interesting.  
> I can write to that folder using 'node-red-contrib-fs' with the node 'file delete'. And I can do a test with 'file-access' (read/write). Both successful.  
> But with the node 'File-Lister' I can't even read that folder ("Error processing folder listing").  
> home/pi/ can be listed to any subfolder in that path (with the same node).
> 
> Is it possibble that some nodes have different permissions?  
> strange

I have full access to the share with user pi via commandline. I could show with copy/paste.

@ukmoose

To reinstall I think a total remove of node-red and a new install should do.

so I remove node-red, delete all folders in .node-red and reinstall?

Thank you all.

---

<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 07:14 UTC](https://discourse.nodered.org/t/sqlite-database-is-locked/7829/20 "2019-02-14T07:14:37Z")

</div>

No point reinstalling Node-RED on its own. The problem is probably outside of Node-RED. It would appear that you’ve tried so many things, sometimes it is better to take a breath and start again.

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