Flows stopped in case of missing nodes influxdb and influxdb.out

Hello
since today morning all works fine with my MQTT, Node-Red, InfluxDB2 and Grafana installation.
Then I made backup of my RasberryPI and after them rebooting the RasberryPI.
When I now open Node-Red I get error message that my flows stopped in case of missing nodes influxdb and influxdb.out.
When I look into the settings of Node-Red into menu Palette then I see an error for node-red-contrib-influxdb " * SyntaxError: Unexpected token '(' (line:1)".

With node-red-log at terminal I get the messages:
26 Feb 10:30:12 - [info] Waiting for missing types to be registered:
26 Feb 10:30:12 - [info] - influxdb
26 Feb 10:30:12 - [info] - influxdb out

Can somebody tell me what could be the reason and how I can fix without loosing all my flows?
IĀ“ve nothing changed at the installation of node-red neither on the RasberryPI.

Sounds like corruption. I would definitely recommend getting a new SD card.

To get you up and running, try uninstalling and reinstalling the Node via command line.

Change directory into your .node-red directory, do npm remove node-red-contrib-influxdb followed by npm install node-red-contrib-influxdb

Also, in case of complete SD card failure, you should most definitely have a backup of your flows. While you are in the .node-red directory , make a backup of your flows JSON file to a remote location (usb stick/Google drive/email/something)

Backup of the json files allways done when I change something. So in case of the worst case the flows are secure.
Lovely thing happen. I shutdown RasberryPI again, make him powerless and then repower and restart again and all is ok.
Strange behaviour.
But will get new SD card. But wondering. The card is brought in November 2024! Should be not normal live time of SD card!?

Depends on a huge number of factors. The quality of the SD card. How much space there is. How often you are doing writes. Whether the card has built in wear levelling. It does seem like a short period of time but not unheard of.

One of the golden rules with raspberry pi running off SD is to minimise logging to file to reduce wear (there are more)

I have just replaced an SD card that has been running continuously (and was still fine) in a pi for 9 years. I only replaced it because I wanted to upgrade node-red and that will no longer run under Jessie!

1 Like

OK. Now I'm completely confused.
I have a SanDisk Extreme with 128 GB in it. There is enough space on it (approx. 117 GB). That is permanently written on it, because the InfluxDB2 data has to stay somewhere.
However, I would have expected the card to last reliably longer.
9 years is of course great. But 3 months is probably a bit short.
But as long as I have no logical explanation as to why the nodes suddenly disappeared after the first reboot and then reappeared after the second, it's not impossible with the card. Maybe a black sheep?

After 9 years, does df -h show the card size as significantly smaller than it's nominal capacity?

eg on one of my Pies with a Sandisk 64GB card I see

/dev/mmcblk0p2   58G  5.7G   50G  11% /
/dev/mmcblk0p1  510M   67M  444M  14% /boot/firmware

I'm wondering if this offers a way of assessing the card's status.

I check my Pie with Android App RaspController. There IĀ“ve many possibilties to check the Pie.

1 Like

I would not recommend using a card with influxdb. It seems to to do large amounts of shuffling data about and can generate vast amounts of log output.

Do you mean you are using 117 of the 128GB, or there is 117GB free? If you are using 117 of 128 then that is less than 10% free which is not good. If you are then put a USB disc in it, that should be much more reliable.

It is supposed to be an 8GB card, gparted reports it as 7.4GiB (which is 7.95GB apparently), of which I am using about 5GiB. However, that doesn't mean much about lost sectors because I don't know what it said when it was new. Manufacturers tend to use a rather vague definition of GB I think. I have moved to a 16GB card.

I ran that way for years as well with no issues. Modern quality cards with plenty of spare space should last years of really heavy use. The main thing is to make sure that you have one with wear levelling and plenty of spare capacity The Samsung EVO ranges all have wear levelling.

You should never, of course, run ANY filing system with so little spare capacity. Indeed, anything less than 20% is going to start having performance issues. For SD-Cards, I'd recommend having a card at least 2-3 times the size you think you need - as long as it has wear levelling.

IĀ“ve 117 GB free space. The idea with the USB Disc sounds good. IĀ“l try next days.

Also see @TotallyInformation's post. Since you have so much free space then it may be that there is no problem with using influxdb.

If you shut down the pi to do the backup did you shut it down correctly or just disconnect the power?

After backup IĀ“ve shut him down or better restart with sudo shutdown -r now. After he is still alive IĀ“ve the problem.
After IĀ“ve posted here I try it with sudo shutdown -h 0, when he is down disconnect power, after few seconds reconnect power and then the Pie is coming up and Node-red working properly.
Is there a difference between the restart and the complete shutdown which can explain the behaviour?

I don't think so, but not sure.

You should run a filing system check if you aren't going to replace the card.

A restart will not remove the power from all circuits, perhaps not from the SD card, so if some logic somewhere was confused it may not reset it. Shutdown and then powering down will force everything to be switched off.

IĀ“m not the great Linux expert. How can I check filesystem?
FSCK doesnĀ“t work because partition on SD card are mounted.

sudo fsck  -n /dev/sdX1

Replace X with the letter corresponding to your card's drive. Use the lsblk command to find it if you need to. That runs it in read-only mode. Not really recommended but it does work.

To check the boot drive on a pi, sudo touch /forcefsck and then reboot.