# Node-red (snap-store) file system access permission problem, need advice!

**URL:** <https://discourse.nodered.org/t/node-red-snap-store-file-system-access-permission-problem-need-advice/81198>\
**Category:** General\
**Created:** [11 September 2023 13:48 UTC](https://discourse.nodered.org/t/node-red-snap-store-file-system-access-permission-problem-need-advice/81198 "2023-09-11T13:48:42Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Europino](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/europino/32/5132_2.png) [@Europino](https://discourse.nodered.org/u/Europino)\
**Post date:** [11 September 2023 13:48 UTC](https://discourse.nodered.org/t/node-red-snap-store-file-system-access-permission-problem-need-advice/81198/1 "2023-09-11T13:48:42Z")

</div>

I am struggling with permission problems when I want to create/access files in my home directory using the file and sqlite nodes.  
My system is a laptop running ubuntu 22/mint 21.1 and node-red version 3.0.2.  
I guess it has to do with the fact that I am running node-red using the ubuntu snap store. This was not my preference, but for development the easiest solution.  
I got the following error message when accessing the file system for creation and accessing of files in my ~/.mqtt directory.

```
 failed to create file: Error: EACCES: permission denied, mkdir '/home/leo/.mqtt' 

```

Similar error message when using the sqlite node.

I changed the permissions for this .mqtt directory as follows:  
drwxrwxrwx 2 leo leo 4096 Sep 7 11:20 .mqtt/

So this directory has rwx permissions for the world. But this didn't help.

Any hint to solve or investigate this problem is appreciated.

Leo

---

<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:** [11 September 2023 14:10 UTC](https://discourse.nodered.org/t/node-red-snap-store-file-system-access-permission-problem-need-advice/81198/2 "2023-09-11T14:10:43Z")

</div>

> [@Europino](#):
>
> I guess it has to do with the fact that I am running node-red using the ubuntu snap store. This was not my preference, but for development the easiest solution.

It doesn't seem particularly easy. Running the pi install script (which is good for Ubuntu) is simple.

I think the problem is that the snap install does not have access to the file system. There is likely some option you have to set when you install it. My advise is to ditch it and use the pi script.

---

<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:** [11 September 2023 19:49 UTC](https://discourse.nodered.org/t/node-red-snap-store-file-system-access-permission-problem-need-advice/81198/3 "2023-09-11T19:49:22Z")

</div>

> [@Colin](#):
>
> I think the problem is that the snap install does not have access to the file system

Indeed, I believe snap is a virtualisation wrapper, each snap is encapsulated and has its own file system doesn't it?

---

<div class="post-metadata">

**Author:** ![Europino](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/europino/32/5132_2.png) [@Europino](https://discourse.nodered.org/u/Europino)\
**Post date:** [12 September 2023 00:46 UTC](https://discourse.nodered.org/t/node-red-snap-store-file-system-access-permission-problem-need-advice/81198/4 "2023-09-12T00:46:48Z")

</div>

Thanks for your replies.  
I forgot to mention that I had configured the snap as follows.

 ![Screenshot from 2023-09-11 21-10-10](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/9/3942489fa058d1067626d146a8e0c3d213efe93e.png)

Given these settings it should be possible to access a file in the home directory.

I am wondering if there are other people using the snap version of node-red and do not have the problems I have now.

I will consider the given alternative using the pi script for installation. Does that script also install the latest version of node.js? If not then some of my nodes will not run, like the aedes mqtt broker.

---

<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:** [12 September 2023 00:52 UTC](https://discourse.nodered.org/t/node-red-snap-store-file-system-access-permission-problem-need-advice/81198/5 "2023-09-12T00:52:22Z")

</div>

> [@Europino](#):
>
> I will consider the given alternative using the pi script for installation. Does that script also install the latest version of node.js? If not then some of my nodes will not run, like the aedes mqtt broker.

It will ensure you have the latest version of the major version you ask for (your current major version by default). So it is easy to change versions.

---

<div class="post-metadata">

**Author:** ![Europino](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/europino/32/5132_2.png) [@Europino](https://discourse.nodered.org/u/Europino)\
**Post date:** [12 September 2023 00:56 UTC](https://discourse.nodered.org/t/node-red-snap-store-file-system-access-permission-problem-need-advice/81198/6 "2023-09-12T00:56:48Z")

</div>

I checked the node-red pi install info and it confirmed that if node.js is not installed it will install LT 16, not the latest but I guess sufficient for me. Ubuntu default install is LT 12.22.9 only.

---

<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:** [12 September 2023 01:19 UTC](https://discourse.nodered.org/t/node-red-snap-store-file-system-access-permission-problem-need-advice/81198/7 "2023-09-12T01:19:45Z")

</div>

There are parameters to tell it to use different versions. v18 is good at this time.

---

<div class="post-metadata">

**Author:** ![Europino](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/europino/32/5132_2.png) [@Europino](https://discourse.nodered.org/u/Europino)\
**Post date:** [12 September 2023 13:55 UTC](https://discourse.nodered.org/t/node-red-snap-store-file-system-access-permission-problem-need-advice/81198/8 "2023-09-12T13:55:32Z")

</div>

Thanks for your help and advice. I am in business again.

Saved my flows in text files, deleted node-red from snap store and executed the node-red shell pi script.  
For some reason the script could not install node-red core, but installed node.js v20.6.1.  
Rerun the script and installed node-red core successfully.  
Started the node-red service and imported the saved flow files.  
Everything is working well, and I can now access files in my home directory.

---

<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:** [11 November 2023 13:55 UTC](https://discourse.nodered.org/t/node-red-snap-store-file-system-access-permission-problem-need-advice/81198/9 "2023-11-11T13:55:52Z")

</div>

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