# Empty flows.json

**URL:** <https://discourse.nodered.org/t/empty-flows-json/89159>\
**Category:** General\
**Created:** [1 July 2024 20:20 UTC](https://discourse.nodered.org/t/empty-flows-json/89159 "2024-07-01T20:20:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![maru](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maru/32/99601_2.png) [@maru](https://discourse.nodered.org/u/maru)\
**Post date:** [1 July 2024 20:20 UTC](https://discourse.nodered.org/t/empty-flows-json/89159/1 "2024-07-01T20:20:05Z")

</div>

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?

```auto
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 $

```

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [1 July 2024 20:26 UTC](https://discourse.nodered.org/t/empty-flows-json/89159/2 "2024-07-01T20:26:19Z")

</div>

> [@maru](#):
>
> ```auto
> 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

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

```

(You are missing a tilde)

---

<div class="post-metadata">

**Author:** ![maru](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maru/32/99601_2.png) [@maru](https://discourse.nodered.org/u/maru)\
**Post date:** [1 July 2024 20:59 UTC](https://discourse.nodered.org/t/empty-flows-json/89159/3 "2024-07-01T20:59:04Z")

</div>

Thank you,

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

```auto
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?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [1 July 2024 21:11 UTC](https://discourse.nodered.org/t/empty-flows-json/89159/4 "2024-07-01T21:11:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![maru](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maru/32/99601_2.png) [@maru](https://discourse.nodered.org/u/maru)\
**Post date:** [1 July 2024 21:19 UTC](https://discourse.nodered.org/t/empty-flows-json/89159/5 "2024-07-01T21:19:58Z")

</div>

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?

```auto
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

```

---

<div class="post-metadata">

**Author:** ![maru](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maru/32/99601_2.png) [@maru](https://discourse.nodered.org/u/maru)\
**Post date:** [1 July 2024 22:25 UTC](https://discourse.nodered.org/t/empty-flows-json/89159/6 "2024-07-01T22:25:03Z")

</div>

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.

---

<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:** [15 July 2024 22:25 UTC](https://discourse.nodered.org/t/empty-flows-json/89159/7 "2024-07-15T22:25:38Z")

</div>

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