# Flows.json access locked

**URL:** <https://discourse.nodered.org/t/flows-json-access-locked/83335>\
**Category:** General\
**Created:** [1 December 2023 09:44 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335 "2023-12-01T09:44:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anikitos](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Anikitos](https://discourse.nodered.org/u/Anikitos)\
**Post date:** [1 December 2023 09:44 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/1 "2023-12-01T09:44:12Z")

</div>

Hi!

I'm trying to set up Node-RED with Kubernetes + Helm charts (Ubuntu 22). I have flows.json file in data folder on the pod and on Persistent Volume to secure data after a reboot:

> ```
> volumeMounts:
> - name: node-red-flows
> mountPath: "/data/flows.json"
> subPath: node-red/flows.json
> 
> volumes:
> - name: node-red-flows
> persistentVolumeClaim:
> claimName: {{ .Values.persistentVolumeClaim }}
> 
> ```

But when I do this it prevents me from using Node-RED from web. If I try to change flows there – an error pops up:

> Deploy failed: {"code":"EBUSY","message":"EBUSY: resource busy or locked, rename '/data/flows.json.$$$' -\> '/data/flows.json'"}

I tried to modify access to this file (chmode/chown or with securityContext in chart) but it didn't help. Any suggestions?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [1 December 2023 10:58 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/2 "2023-12-01T10:58:21Z")

</div>

Presumably because Node-RED is running when you are trying to rename the file?

---

<div class="post-metadata">

**Author:** ![Anikitos](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Anikitos](https://discourse.nodered.org/u/Anikitos)\
**Post date:** [1 December 2023 11:14 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/3 "2023-12-01T11:14:33Z")

</div>

I'm not trying to rename it. Node-RED is just duplicating flow file (with $$$ in it's name) and asks me to rename it (according to the error)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [1 December 2023 11:19 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/4 "2023-12-01T11:19:34Z")

</div>

Can you check what has locked the file? Is it Node-RED or something else? You probably need to check both the temp file and the actual as it isn't clear which is locked.

---

<div class="post-metadata">

**Author:** ![Anikitos](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Anikitos](https://discourse.nodered.org/u/Anikitos)\
**Post date:** [1 December 2023 12:16 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/5 "2023-12-01T12:16:56Z")

</div>

I checked with _lsof_ and _fuser_ and it seems like nothing is blocking them. And also both of this files can be changed with text editors (_nano_ for example).

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [1 December 2023 14:16 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/6 "2023-12-01T14:16:53Z")

</div>

Hmm, must be a timing thing then. Sorry, not sure what else to suggest. I don't use Docker or Kubernetes for Node-RED I'm afraid.

---

<div class="post-metadata">

**Author:** ![Anikitos](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Anikitos](https://discourse.nodered.org/u/Anikitos)\
**Post date:** [1 December 2023 14:37 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/7 "2023-12-01T14:37:24Z")

</div>

Thanks anyway

---

<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 December 2023 15:21 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/8 "2023-12-01T15:21:02Z")

</div>

> [@Anikitos](#):
>
> rename '/data/flows.json.$$$' -\> '/data/flows.json'"

> [@Anikitos](#):
>
> I'm not trying to rename it. Node-RED is just duplicating flow file (with $$$ in it's name) and asks me to rename it (according to the error)

Surely something is actually attempting to rename flows.json.$$$ to flows.json? And flows.json is in use.

I don't suppose it is related to this issue but having $ or other "special" characters in a filename is probably inviting trouble.

---

<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 December 2023 17:12 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/9 "2023-12-01T17:12:40Z")

</div>

> [@Anikitos](#):
>
> But when I do this it prevents me from using Node-RED from web. If I try to change flows there – an error pops up:

Do you mean that it does allow you to use node-red from the web, but when you Deploy you see the error? If so them my guess is that node-red first writes the new file with the $$$ extension and will then rename it. The error suggests it has written the new one but then is unable to rename it.

What is the ownership and permissions on the flows file, and other files in the folder?

---

<div class="post-metadata">

**Author:** ![Anikitos](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Anikitos](https://discourse.nodered.org/u/Anikitos)\
**Post date:** [4 December 2023 05:48 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/10 "2023-12-04T05:48:39Z")

</div>

Yes. It seems like that is exactly what is happening.

Other files was owned by _node-red_ user and flows.json was owned by _root_. I changed ownership to _node-red_ user but it didn't help.

---

<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:** [4 December 2023 08:39 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/11 "2023-12-04T08:39:32Z")

</div>

> [@Anikitos](#):
>
> it didn't help.

Do you mean the ownership is changed back to root again?

---

<div class="post-metadata">

**Author:** ![Anikitos](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Anikitos](https://discourse.nodered.org/u/Anikitos)\
**Post date:** [4 December 2023 08:48 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/12 "2023-12-04T08:48:17Z")

</div>

Sorry. No. The owner is _node-red_ but the error is still there when I'm trying to Deploy.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [4 December 2023 09:14 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/13 "2023-12-04T09:14:10Z")

</div>

and what are the permissions on the file ?

---

<div class="post-metadata">

**Author:** ![Anikitos](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Anikitos](https://discourse.nodered.org/u/Anikitos)\
**Post date:** [4 December 2023 11:38 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/14 "2023-12-04T11:38:16Z")

</div>

I set permissions to 777 (read/write for all) but it didn't help. Initially it was 644 (read/write for owner, only read for everyone else).

---

<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:** [4 December 2023 11:54 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/15 "2023-12-04T11:54:06Z")

</div>

Can you show us an `ls -al` on the whole directory please?

---

<div class="post-metadata">

**Author:** ![Anikitos](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Anikitos](https://discourse.nodered.org/u/Anikitos)\
**Post date:** [4 December 2023 12:16 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/16 "2023-12-04T12:16:28Z")

</div>

![2023-12-04_15-15-07](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/8/b8a5bf09c8f05a2b38a744491809c1f5b6042e93.png)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [4 December 2023 13:29 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/17 "2023-12-04T13:29:39Z")

</div>

I think the whole directory ( . ) should be fully owned by node-red. Currently it is owned by the root group.

---

<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:** [4 December 2023 13:46 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/18 "2023-12-04T13:46:38Z")

</div>

Why have virtually all the files got the same time stamp? Even package.json and settings.js.

---

<div class="post-metadata">

**Author:** ![Anikitos](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Anikitos](https://discourse.nodered.org/u/Anikitos)\
**Post date:** [5 December 2023 06:02 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/19 "2023-12-05T06:02:51Z")

</div>

It didn't help

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/8/783d9fbb38674db38fd4f79800b8a9dd789a89b1.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/d/4d99b517ed5bff759ebd81c7dbeb6770231f8075.png)

---

<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:** [5 December 2023 07:41 UTC](https://discourse.nodered.org/t/flows-json-access-locked/83335/20 "2023-12-05T07:41:20Z")

</div>

Why have the timestamps on most of the files changed?

[Next page](https://discourse.nodered.org/t/flows-json-access-locked/83335.md?page=2)
