Empty flows.json

Good evening,

I thought I would free up some space and deleted the /.nodered/projects/Backup_node_RED_files//flows.json, not knowing that it was used to start the flows.
NOW I want to restore the copy of my USB key, but that doesn't work.
What am I doing wrong here?

Maru@RPi4:~/.node-red/projects/Backup_node_RED_files $ ls -al
total 32
drwxr-xr-x 3 Maru Maru 4096 Jul  1 21:10  .
drwxr-xr-x 4 Maru Maru 4096 Jun 18 11:49  ..
-rw-r--r-- 1 Maru Maru 4735 Jun 18 11:49  flows_cred.json
-rwxr-xr-x 1 Maru Maru    0 Jul  1 21:10  flows.json
-rw-r--r-- 1 Maru Maru    0 Jul  1 20:52 'flows.json.$$$'
drwxr-xr-x 8 Maru Maru 4096 Jul  1 21:17  .git
-rw-r--r-- 1 Maru Maru    8 Jun 18 11:49  .gitignore
-rw-r--r-- 1 Maru Maru  316 Jun 18 11:49  package.json
-rw-r--r-- 1 Maru Maru  263 Jun 18 11:49  README.md
Maru@RPi4:~/.node-red/projects/Backup_node_RED_files $ cd /media/usbkey
Maru@RPi4:/media/usbkey $ ls -al
total 35464
drwxr-xr-x 3 Maru Maru     2048 Jan  1  1970  .
drwxr-xr-x 4 root root     4096 Jul 15  2023  ..
-rwxr-xr-x 1 Maru Maru     4735 Jul  1 20:43  flows_cred.json
-rwxr-xr-x 1 Maru Maru  1371319 Jul  1 20:43  flows.json
-rwxr-xr-x 1 Maru Maru 33554432 Apr  8  2023  gigabyte.bin
-rwxr-xr-x 1 Maru Maru     1786 Jul  1 20:43  package.json
-rwxr-xr-x 1 Maru Maru  1371319 Jul  1 20:33  project_flows.json
drwxr-xr-x 2 Maru Maru     2048 Mar 11  2023 'System Volume Information'
Maru@RPi4:/media/usbkey $ cp flows.json /.node-red/projects/Backup_node_RED_files/flows.json
cp: cannot create regular file '/.node-red/projects/Backup_node_RED_files/flows.json': No such file or directory
Maru@RPi4:/media/usbkey $

I think perhaps your command should be

cp flows.json ~/.node-red/projects/Backup_node_RED_files/flows.json

(You are missing a tilde)

Thank you,

Indeed, I forgot about tilde, but now I get the following message:

Maru@RPi4:/media/usbkey $ cp flows.json ~/.node-red/projects/Backup_node_RED_files/flows.json
cp: error writing '/home/Maru/.node-red/projects/Backup_node_RED_files/flows.json': No space left on device

There is no space in /dev/root

Maru@RPi4:/media/usbkey $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 29G 29G 0 100% /
devtmpfs 666M 0 666M 0% /dev
tmpfs 925M 0 925M 0% /dev/shm
tmpfs 370M 1.2M 369M 1% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
/dev/sda 244M 35M 210M 15% /media/usbkey
/dev/mmcblk0p1 255M 61M 195M 24% /boot
tmpfs 185M 0 185M 0% /run/user/1000 

Is it an idea to let node-red use the file from the USB key?
Where could I adjust that to test whether it works?

You need to free up space in /dev/root.

I thought moving flows.json would free up space. In settings.js I now refer to /media/usbkey/flows.json but after reboot it still points to /home/Maru/.node-red/projects/Backup_node_RED_files/flows.json and apparently this file is empty?

Maru@RPi4:~ $ node-red-start --safe

Start Node-RED

Once Node-RED has started, point a browser at http://192.168.1.54: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.
1 Jul 23:11:33 - [info]
Welcome to Node-RED
===================
1 Jul 23:11:33 - [info] Node-RED version: v3.1.1
1 Jul 23:11:33 - [info] Node.js  version: v20.10.0
1 Jul 23:11:33 - [info] Linux 6.1.64-v8+ arm64 LE
1 Jul 23:11:34 - [info] Palette editor disabled : npm command not found
1 Jul 23:11:34 - [info] Loading palette nodes
1 Jul 23:11:39 - [info] Worldmap version 2.42.3
1 Jul 23:11:39 - [info] Dashboard version 3.6.1 started at /ui
1 Jul 23:11:40 - [info] Settings file  : /home/Maru/.node-red/settings.js
1 Jul 23:11:40 - [info] Context store  : 'default' [module=memory]
1 Jul 23:11:40 - [info] User directory : /home/Maru/.node-red
1 Jul 23:11:40 - [info] Projects directory: /home/Maru/.node-red/projects
1 Jul 23:11:40 - [info] Server now running at http://127.0.0.1:1880/
1 Jul 23:11:40 - [info] Active project : Backup_node_RED_files
1 Jul 23:11:40 - [info] Flows file     : /home/Maru/.node-red/projects/Backup_node_RED_files/flows.json
1 Jul 23:11:40 - [warn] **Existing flow file is empty**
1 Jul 23:11:40 - [info] Starting flows
1 Jul 23:11:40 - [info] Started flows

It looks like it's working again, at least I can see all my flows again and data comes in.

Suddenly my backup file flows.json disappeared from my USB key and the file that node-red uses to start was empty..

I first checked with sudo ncdu / what was taking up the space and deleted 25Gb of Influxdb data (Thanks Collin, I read about sudo ncdu / in one of your previous post).

Then I was able to copy flows.json (albeit from a month ago) from my homedir/.node-red/ directory to ~/.node-red/projects/Backup_node_RED_file.

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