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

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?

Might be a copy paste issue ... but there's "splite" in this path ... rather than "sqlite" ...

1 Like

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)

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.

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