# Context (Storage) File lock issue during restart of Node

**URL:** https://discourse.nodered.org/t/context-storage-file-lock-issue-during-restart-of-node/73743
**Category:** General
**Created:** [16 January 2023 05:40 UTC](https://discourse.nodered.org/t/context-storage-file-lock-issue-during-restart-of-node/73743 "2023-01-16T05:40:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jakonnode](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@jakonnode](https://discourse.nodered.org/u/jakonnode)
#### Post date: [16 January 2023 05:40 UTC](https://discourse.nodered.org/t/context-storage-file-lock-issue-during-restart-of-node/73743/1 "2023-01-16T05:40:00Z")

</div>

Background: On the edge device for guaranteed delivery, I use File ContextStorage. On a regular basis, the file gets used, the edge device gets rebooted for some uncontrollable reasons sometimes but the node-red service doesn't come up automatically as it has this File lock issue on this context file.

Once we remove this context file/folder and restart manually it works fine. (one thing I am thinking is to move to SQLLite instead of File based context storage but that is significant change at this point)

Question: Is there a way to avoid this file lock issue for hard reboots when the filestorage is in constant use?

---

<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: [16 January 2023 20:39 UTC](https://discourse.nodered.org/t/context-storage-file-lock-issue-during-restart-of-node/73743/2 "2023-01-16T20:39:21Z")

</div>

You could perhaps find a command line utility that clears the lock and simply run that on each boot before node-red runs?

I also think there is a REDIS version of context store? If your device is up to running that, it might help.

---

<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: [17 March 2023 20:40 UTC](https://discourse.nodered.org/t/context-storage-file-lock-issue-during-restart-of-node/73743/3 "2023-03-17T20:40:14Z")

</div>

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