# Settings.js will be ignored

**URL:** <https://discourse.nodered.org/t/settings-js-will-be-ignored/11467>\
**Category:** General\
**Created:** [23 May 2019 15:55 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467 "2019-05-23T15:55:35Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dirkzp](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dirkzp](https://discourse.nodered.org/u/dirkzp)\
**Post date:** [23 May 2019 15:55 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/1 "2019-05-23T15:55:35Z")

</div>

Hello,

I'm using Ubuntu Core on a Raspberry Pi and also on a DELL Edge Gateway. On both systems Node-red is installed (snap). During the start/run of Node-red the used settings.js file is displayed (root/snap/node-red/current/settings.js). Changes at this file and also in the settings.js (/home/{user}/snap/node-red/current) has no effect after restart. Any suggestions what the reason can be? Thanks a lot.

BR, Dirk

---

<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:** [23 May 2019 19:00 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/2 "2019-05-23T19:00:41Z")

</div>

I imagine that NR is not actually using the settings file you think it is.

Normally you would try turning up the logging to see what is happening, not sure if there is a command line switch to do that since you can't change the settings.

Alternatively, maybe you can find a file monitor that will show you which files are being opened by NR.

---

<div class="post-metadata">

**Author:** ![Louise](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@Louise](https://discourse.nodered.org/u/Louise)\
**Post date:** [24 May 2019 08:16 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/3 "2019-05-24T08:16:22Z")

</div>

I agree with TotallyInformation. I had the same problem. You can specify the settings file to use when starting node-red by using the command `node-red -s path\to\settings\file`

---

<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:** [24 May 2019 09:28 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/4 "2019-05-24T09:28:39Z")

</div>

This is under snap - so yes - I can't recall which settings it uses - but it is pretty "secure" in that it doesn't like things to get access where they shouldn't. I know it will certainly revert things to vanilla if you update at all.

---

<div class="post-metadata">

**Author:** ![dirkzp](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dirkzp](https://discourse.nodered.org/u/dirkzp)\
**Post date:** [24 May 2019 13:02 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/5 "2019-05-24T13:02:24Z")

</div>

Thanks, but my ubuntu core said flag "-s" is unknown ☹

---

<div class="post-metadata">

**Author:** ![Louise](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@Louise](https://discourse.nodered.org/u/Louise)\
**Post date:** [24 May 2019 13:13 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/6 "2019-05-24T13:13:33Z")

</div>

That is very confusting, I have absolutely no idea what is going wrong. What command do you use to start node-red?

---

<div class="post-metadata">

**Author:** ![dirkzp](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dirkzp](https://discourse.nodered.org/u/dirkzp)\
**Post date:** [24 May 2019 13:38 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/7 "2019-05-24T13:38:46Z")

</div>

I use "snap start node-red" or "snap run node-red"

---

<div class="post-metadata">

**Author:** ![Louise](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@Louise](https://discourse.nodered.org/u/Louise)\
**Post date:** [24 May 2019 13:56 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/8 "2019-05-24T13:56:47Z")

</div>

what happens if you try `snap start node-red -s path\to\settings\file.js`?

---

<div class="post-metadata">

**Author:** ![dirkzp](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dirkzp](https://discourse.nodered.org/u/dirkzp)\
**Post date:** [24 May 2019 15:02 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/9 "2019-05-24T15:02:21Z")

</div>

unknown flag "-s"

---

<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:** [24 May 2019 15:05 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/10 "2019-05-24T15:05:23Z")

</div>

This is a snap issue rather than Node-RED as such.

What does the snap documentation say about passing parameters to an executable?

---

<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:** [24 May 2019 15:15 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/11 "2019-05-24T15:15:05Z")

</div>

> [@TotallyInformation](#):
>
> What does the snap documentation say about passing parameters to an executable?

The only way I found to do this so far was to change the exec line of the snap desktop file in `/var/lib/snapd/desktop/applications`. Unless the exec line contains an environment variable in the exec line that is. I haven't installed the node red snap so I don't know whether this is the case. I have asked on the Ubuntu list whether there is another way.  
@dirkzp find the desktop file in the directory mentioned and post the contents here so we can have a look.

---

<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:** [24 May 2019 16:03 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/12 "2019-05-24T16:03:57Z")

</div>

happy to take a Pull Request if someone figures it out.

---

<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:** [24 May 2019 16:24 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/13 "2019-05-24T16:24:43Z")

</div>

Is the snap desktop file under our control? If so then you could possibly add an environment variable to the exec line so one should be able to say something like  
`NODE_RED_PARAMS="-s some/file/path" snap start node-red`

---

<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:** [24 May 2019 16:59 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/14 "2019-05-24T16:59:23Z")

</div>

the command it uses is  
`"$SNAP"/bin/node-red -u "$SNAP_USER_DATA" "$SNAP_USER_DATA/flows.json"`  
so what is $SNAP\_USER\_DATA set to ? as that is where the settings file and flows file should be .

---

<div class="post-metadata">

**Author:** ![dirkzp](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dirkzp](https://discourse.nodered.org/u/dirkzp)\
**Post date:** [24 May 2019 21:51 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/15 "2019-05-24T21:51:26Z")

</div>

The content of the file under /var/lib/snapd/desktop/application is:

[Desktop Entry]  
X-SnapInstanceName=node-red  
Type=Application  
Name=Node-RED  
Comment=Flow-based programming for the Internet of Things  
Exec=env BAMF\_DESKTOP\_FILE\_HINT=/var/lib/snapd/desktop/applications/node-red\_node-red.desktop /snap/bin/node-red.desktop-launch  
Icon=/snap/node-red/314/meta/gui/node-red.png  
Terminal=false  
Categories=Development;

---

<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:** [25 May 2019 20:44 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/16 "2019-05-25T20:44:27Z")

</div>

> [@dceejay](#):
>
> "$SNAP"/bin/node-red -u "$SNAP\_USER\_DATA" "$SNAP\_USER\_DATA/flows.json"

Out of interest, where does that get invoked from? I was expecting to see it in the desktop file.

---

<div class="post-metadata">

**Author:** ![dirkzp](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dirkzp](https://discourse.nodered.org/u/dirkzp)\
**Post date:** [26 May 2019 18:17 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/17 "2019-05-26T18:17:53Z")

</div>

So, what is your opinion? What should I add to the file under applications?

---

<div class="post-metadata">

**Author:** ![dirkzp](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dirkzp](https://discourse.nodered.org/u/dirkzp)\
**Post date:** [4 June 2019 08:41 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/18 "2019-06-04T08:41:53Z")

</div>

@dceejay: Do you have a suggestion? at the moment I can't use node-red under Ubuntu Core because of ignoring the settings.js file. Especially to change the credentials or add an additional node directory. Thanks fr your help.

---

<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 June 2019 10:43 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/19 "2019-06-04T10:43:09Z")

</div>

Hi, sorry I'm on a business trip for next two weeks so can't dig into this now. It will be using a settings file somewhere.

---

<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:** [4 June 2019 11:16 UTC](https://discourse.nodered.org/t/settings-js-will-be-ignored/11467/20 "2019-06-04T11:16:55Z")

</div>

> [@dirkzp](#):
>
> Do you have a suggestion? at the moment I can't use node-red under Ubuntu Core because of ignoring the settings.js file. Especially to change the credentials or add an additional node directory. Thanks fr your help.

If you can run command-line in snap, you could find out what file Node-RED is trying to access when it opens. I know there are linux tools for that though my sysadmin-fu is not quite up to the job of telling you what they are I'm afraid.
