So I have created a MQTT data tracking system using node red, and storing the data into SQLite.
The issue I'm having is after I create the SQLite table and data starts logging, I go home for the day, when I come back I get the error no table found , and the table has been dropped. Below will be a snip of the Node red flow.
Does anyone know why the table is getting deleted overnight?
are you sure that either the clear table or backup table functions are doing so in a way that doesn't actually wipe the table ? What happens if you run without those two actions happening ?
I can disconnect those nodes and see what happens tomorrow. It only happens over night.
The clear just wipes the tables data when I click on the inject. And the Backup just copies to a mounted drive. I will attach the two nodes configuration.
Hi.
I notice from the timestamps of the errors that they happen every 5 seconds.
it means that your reading / or writing every 5 seconds ?
And you have the Exec node doing a backup at the same rate ? with every read / write ?
(since its wired directly after the sqlite node)
I believe its the backup exec node that may be causing the issue. maybe corrupting the database because of the high rate of backup commands.
try to unwire that part of the flow and see what happens and if all is good for a couple of days wire it separately with an inject node or cron-plus to trigger once a week.
Also what OS are you running on and are you using Docker, or something similar, to run node-red? Is this running on a real device or on a VM or in the cloud somewhere?
I'm curious what settings there are in the inject node "Drop table"
Maybe you can run it a couple of days without this inject node, disconnect the wire.
Can you so us the configuration of the sqlite node? The reboot should not be wiping out the file unless you are storing it in /tmp which gets wiped on a reboot.