# \[error\] Error: Error loading context store: Error: EACCES: permission denied, mkdir '/data'

**URL:** <https://discourse.nodered.org/t/error-error-error-loading-context-store-error-eacces-permission-denied-mkdir-data/89461>\
**Category:** General\
**Created:** [13 July 2024 08:10 UTC](https://discourse.nodered.org/t/error-error-error-loading-context-store-error-eacces-permission-denied-mkdir-data/89461 "2024-07-13T08:10:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![hermiot](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hermiot/32/28140_2.png) [@hermiot](https://discourse.nodered.org/u/hermiot)\
**Post date:** [13 July 2024 08:10 UTC](https://discourse.nodered.org/t/error-error-error-loading-context-store-error-eacces-permission-denied-mkdir-data/89461/1 "2024-07-13T08:10:28Z")

</div>

Hi,  
I'm running Node-RED on Debian and needed to change the config.js to

```auto
contextStorage: {
        default: {
            module:"localfilesystem",
            config: {
              dir:"/data",
              base:"context",
              cache: true,
              flushInterval: 30
            }
        },
    }, 

```

To get Netatmo back to work ([https://gist.github.com/matz33/843165d0046cac534864b65e633801a5?permalink\_comment\_id=4785938#gistcomment-4785938](https://gist.github.com/matz33/843165d0046cac534864b65e633801a5?permalink_comment_id=4785938#gistcomment-4785938)).

But when I do so, Node-RED won't start anymore.

When I run sudo service nodered status, the output is

```auto
Jul 13 09:57:25 nodered Node-RED[115]: 13 Jul 09:57:25 - [info] Loading palette nodes
Jul 13 09:57:27 nodered Node-RED[115]: 13 Jul 09:57:27 - [info] Dashboard version 1.0.2 started at /ui
Jul 13 09:57:30 nodered Node-RED[115]: 13 Jul 09:57:30 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
Jul 13 09:57:31 nodered Node-RED[115]: 13 Jul 09:57:31 - [info] Settings file : /home/hermiot/.node-red/settings.js
Jul 13 09:57:31 nodered Node-RED[115]: 13 Jul 09:57:31 - [info] Context store : 'default' [module=localfilesystem]
Jul 13 09:57:31 nodered Node-RED[115]: (node:115) V8: /home/hermiot/.node-red/node_modules/@throneless/libsignal-protocol/build/curve25519_concat.js:20225 Invalid asm.js: Expected shift of word size
Jul 13 09:57:31 nodered Node-RED[115]: (Use `node --trace-warnings ...` to show where the warning was created)
Jul 13 09:57:31 nodered Node-RED[115]: 13 Jul 09:57:31 - [error] Failed to start server:
Jul 13 09:57:31 nodered Node-RED[115]: 13 Jul 09:57:31 - [error] Error: Error loading context store: Error: EACCES: permission denied, mkdir '/data'
Jul 13 09:57:31 nodered Node-RED[115]: at /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/context/index.js:180:15

```

Can anybody help please?

Thanks!

---

<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:** [13 July 2024 08:41 UTC](https://discourse.nodered.org/t/error-error-error-loading-context-store-error-eacces-permission-denied-mkdir-data/89461/2 "2024-07-13T08:41:55Z")

</div>

How did you install node-red?

---

<div class="post-metadata">

**Author:** ![hermiot](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hermiot/32/28140_2.png) [@hermiot](https://discourse.nodered.org/u/hermiot)\
**Post date:** [13 July 2024 09:04 UTC](https://discourse.nodered.org/t/error-error-error-loading-context-store-error-eacces-permission-denied-mkdir-data/89461/3 "2024-07-13T09:04:14Z")

</div>

I'm pretty sure via npm  
[https://nodered.org/docs/getting-started/local](https://nodered.org/docs/getting-started/local)  
Definitely not Docker.

---

<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:** [13 July 2024 09:05 UTC](https://discourse.nodered.org/t/error-error-error-loading-context-store-error-eacces-permission-denied-mkdir-data/89461/4 "2024-07-13T09:05:48Z")

</div>

What do you see if you start node red using the command  
`node-red`?

---

<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:** [13 July 2024 09:07 UTC](https://discourse.nodered.org/t/error-error-error-loading-context-store-error-eacces-permission-denied-mkdir-data/89461/5 "2024-07-13T09:07:47Z")

</div>

Oh, I see the problem, you have told it to store the config in `/data`. It needs to be a folder that node red can write to.

---

<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:** [13 July 2024 09:12 UTC](https://discourse.nodered.org/t/error-error-error-loading-context-store-error-eacces-permission-denied-mkdir-data/89461/6 "2024-07-13T09:12:52Z")

</div>

> [@hermiot](#):
>
> ```auto
> contextStorage: {
> default: {
> module:"localfilesystem",
> config: {
> dir:"/data",
> base:"context",
> cache: true,
> flushInterval: 30
> }
> },
> }, 
> 
> ```

You shouldn't need the config section at all, let node red using its defaults. Just use

```auto
contextStorage: {
        default: {
            module:"localfilesystem",
        },
    }, 

```

---

<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:** [13 July 2024 10:44 UTC](https://discourse.nodered.org/t/error-error-error-loading-context-store-error-eacces-permission-denied-mkdir-data/89461/7 "2024-07-13T10:44:20Z")

</div>

You have told Node-RED to try to create context data files at `/data` - the leading `/` tells the OS to start from the root of the filing system. This is generally a bad idea on Linux systems and won't be accessible to Node-RED by default, you would have to manually create the folder and set its permissions if you really want to do that.

Unless you really want to move it somewhere, best to do as Colin says and let it use the default which is likely to end up at:

```auto
~/.node-red/context/

```

---

<div class="post-metadata">

**Author:** ![hermiot](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hermiot/32/28140_2.png) [@hermiot](https://discourse.nodered.org/u/hermiot)\
**Post date:** [15 July 2024 10:28 UTC](https://discourse.nodered.org/t/error-error-error-loading-context-store-error-eacces-permission-denied-mkdir-data/89461/8 "2024-07-15T10:28:03Z")

</div>

Thank you all for pointing me out to the solution 🙂

---

<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:** [29 July 2024 10:28 UTC](https://discourse.nodered.org/t/error-error-error-loading-context-store-error-eacces-permission-denied-mkdir-data/89461/9 "2024-07-29T10:28:23Z")

</div>

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