# Raspberry Pi "failed to open" error for "sqlite"

**URL:** <https://discourse.nodered.org/t/raspberry-pi-failed-to-open-error-for-sqlite/84532>\
**Category:** General\
**Tags:** database, sqlite\
**Created:** [14 January 2024 12:48 UTC](https://discourse.nodered.org/t/raspberry-pi-failed-to-open-error-for-sqlite/84532 "2024-01-14T12:48:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rabbit](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@Rabbit](https://discourse.nodered.org/u/Rabbit)\
**Post date:** [14 January 2024 12:48 UTC](https://discourse.nodered.org/t/raspberry-pi-failed-to-open-error-for-sqlite/84532/1 "2024-01-14T12:48:11Z")

</div>

I get error "failed to open /tmp/splite/testdb.db" when I deploy my "sqlite" project at Node-Red.  
The "sqlite" node properties "Database" setting is "/tmp/splite/testdb.db".

The database file is "pi@raspberrypi:/tmp/sqlite/testdb.db",  
The database properties is:  
-rwxrwxrwx 1 pi pi 12288 Jan 14 20:45 testdb.db

I can use command line to create table "**sqlite\> CREATE TABLE test1(name,url);**" , and didplay the table by using .table.

How to fix this error?

---

<div class="post-metadata">

**Author:** ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)\
**Post date:** [14 January 2024 13:02 UTC](https://discourse.nodered.org/t/raspberry-pi-failed-to-open-error-for-sqlite/84532/2 "2024-01-14T13:02:06Z")

</div>

> [@Rabbit](#):
>
> /tmp/splite/testdb.db

Might be a copy paste issue ... but there's "s **p** lite" in this path ... rather than "s **q** lite" ...

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [14 January 2024 16:45 UTC](https://discourse.nodered.org/t/raspberry-pi-failed-to-open-error-for-sqlite/84532/3 "2024-01-14T16:45:13Z")

</div>

> [@Rabbit](#):
>
> /tmp

and isnt the `/tmp` directory wiped on linux systems after each restart ?  
not a good place to store your db file .. better place it under `.node-red` folder (makes it easier to backup)

---

<div class="post-metadata">

**Author:** ![Rabbit](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@Rabbit](https://discourse.nodered.org/u/Rabbit)\
**Post date:** [15 January 2024 00:29 UTC](https://discourse.nodered.org/t/raspberry-pi-failed-to-open-error-for-sqlite/84532/4 "2024-01-15T00:29:32Z")

</div>

There are two issues, one is mistake for the file name spelling, another is the database folder will be deleted when I restart Raspberry Pi.  
I build the database file in the same directory as the project, is is better for backup project?  
So the final files are:

pi@raspberrypi:~/.node-red/projects/SQLite $ ls  
flow\_cred.json flow.json package.json README.md testdb.db

It works as I expected now.  
Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [29 January 2024 00:30 UTC](https://discourse.nodered.org/t/raspberry-pi-failed-to-open-error-for-sqlite/84532/5 "2024-01-29T00:30:28Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
