# Can't locate Setting file

**URL:** <https://discourse.nodered.org/t/cant-locate-setting-file/25688>\
**Category:** General\
**Created:** [28 April 2020 15:40 UTC](https://discourse.nodered.org/t/cant-locate-setting-file/25688 "2020-04-28T15:40:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![1bit](https://avatars.discourse-cdn.com/v4/letter/1/d6d6ee/32.png) [@1bit](https://discourse.nodered.org/u/1bit)\
**Post date:** [28 April 2020 15:40 UTC](https://discourse.nodered.org/t/cant-locate-setting-file/25688/1 "2020-04-28T15:40:49Z")

</div>

Hello,

I'm using Armbian on Orange Pi Zero and have Node-red running as a server for a healthy 6 months.

## To cut a long story short, I had to reinstall everything only to encouter the following at startup problem:

root@orangepizero:~# **node-red -start**  
28 Apr 15:18:03 - [info]

# Welcome to Node-RED

28 Apr 15:18:03 - [info] Node-RED version: v1.0.6  
28 Apr 15:18:03 - [info] Node.js version: v10.15.2  
28 Apr 15:18:03 - [info] Linux 5.4.20-sunxi arm LE  
28 Apr 15:18:10 - [info] Loading palette nodes  
28 Apr 15:18:17 - [info] Dashboard version 2.21.0 started at /ui  
28 Apr 15:18:18 - [info] Settings file : /root/.node-red/settings.js  
28 Apr 15:18:18 - [info] Context store : 'default' [module=memory]  
28 Apr 15:18:18 - [info] User directory : /root/.node-red  
28 Apr 15:18:18 - [warn] Projects disabled : editorTheme.projects.enabled=false  
28 Apr 15:18:18 - [info] Flows file : /root/.node-red/flows\_orangepizero.json  
28 Apr 15:18:18 - [warn]

* * *

Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials  
file will not be recoverable, you will have to delete it and re-enter  
your credentials.

## You should set your own key using the 'credentialSecret' option in your settings file. Node-RED will then re-encrypt your credentials file using your chosen key the next time you deploy a change.

## 28 Apr 15:18:18 - [info] Starting flows 28 Apr 15:18:19 - [info] Started flows 28 Apr 15:18:19 - [info] [mqtt-broker:mqtt] Connection failed to broker: mqtt://localhost:1883 28 Apr 15:18:19 - [error] Unable to listen on [http://127.0.0.1:1880/](http://127.0.0.1:1880/) 28 Apr 15:18:19 - [error] Error: port in use

## So, I did this:

root@orangepizero:~# **netstat -ltup**  
Active Internet connections (only servers)  
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name  
tcp 0 0 0.0.0.0:ssh 0.0.0.0:\* LISTEN 937/sshd  
tcp 0 0 0.0.0.0:1880 0.0.0.0:\* LISTEN 1343/node-red  
tcp6 0 0 [::]:ssh [::]:\* LISTEN 937/sshd  
udp 0 0 localhost:323 0.0.0.0:\* 905/chronyd  
udp 0 0 0.0.0.0:bootpc 0.0.0.0:\* 1017/dhclient  
udp6 0 0 localhost:323 [::]:\* 905/chronyd

followed by,  
root@orangepizero:~# **killall node-red**

and node-red -start  
and back to square one.

So I decided to check for setting file by

root@orangepizero:~# **find / -name settings.js**  
/root/.node-red/settings.js  
/usr/local/lib/node\_modules/node-red/settings.js  
/usr/local/lib/node\_modules/node-red/node\_modules/@node-red/runtime/lib/settings.js  
/usr/local/lib/node\_modules/node-red/node\_modules/@node-red/runtime/lib/storage/localfilesystem/settings.js  
/usr/local/lib/node\_modules/node-red/node\_modules/@node-red/runtime/lib/api/settings.js  
/usr/local/lib/node\_modules/node-red/node\_modules/@node-red/editor-api/lib/editor/settings.js

and picked the First one, and to my surprise, there was nothing under \root

Since I'm a beginner in Linux, I'm puzzled and have no clue what to do next.

So I appreciate any help.

Thanks.

p.s. When running design view ([http://192.168.1.11:1880/#flow/94dde7f4.01f478](http://192.168.1.11:1880/#flow/94dde7f4.01f478)) on node-red under windows browser, all nodes display 'connecting' as expected.

---

<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:** [28 April 2020 15:54 UTC](https://discourse.nodered.org/t/cant-locate-setting-file/25688/2 "2020-04-28T15:54:49Z")

</div>

> [@1bit](#):
>
> node-red -start

That should be `node-red-start`, no spaces.  
To stop node red use `node-red-stop`.  
If those don't work then tell us how you installed node-red. Note that it is generally considered a bad idea to run node-red as root, generally it should run as a user so you can't accidentally write all over the operating system.

---

<div class="post-metadata">

**Author:** ![1bit](https://avatars.discourse-cdn.com/v4/letter/1/d6d6ee/32.png) [@1bit](https://discourse.nodered.org/u/1bit)\
**Post date:** [28 April 2020 16:28 UTC](https://discourse.nodered.org/t/cant-locate-setting-file/25688/3 "2020-04-28T16:28:12Z")

</div>

Colin:  
root@orangepizero:/# node-red-start  
node-red-start: command not found  
root@orangepizero:/# node-red-stop  
node-red-stop: command not found

I have installed it as per this site: [https://agrinode.github.io/docs/install\_nodered\_orangepi/](https://agrinode.github.io/docs/install_nodered_orangepi/)

I agree on your note regarding running as root user.

---

<div class="post-metadata">

**Author:** ![onbekende](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/onbekende/32/20559_2.png) [@onbekende](https://discourse.nodered.org/u/onbekende)\
**Post date:** [28 April 2020 16:52 UTC](https://discourse.nodered.org/t/cant-locate-setting-file/25688/5 "2020-04-28T16:52:22Z")

</div>

So, what's the directorylisting from your root homedir?

> cd ~  
> root@yourserver:~# ls -lah

Check to see if there's a .node-red directory

> cd .node-red/

> root@yourserver:~#/.node-red$ ls -lah  
> total 196K  
> drwxr-xr-x 7 red red 4.0K Apr 24 14:47 .  
> drwxr-xr-x 7 red red 4.0K Apr 6 16:30 ..  
> drwxr-xr-x 2 red red 4.0K Mar 24 15:01 certs  
> -rw-r--r-- 1 red red 19K Apr 24 14:47 .config.json  
> -rw-r--r-- 1 red red 19K Apr 24 14:32 .config.json.backup  
> -rw-r--r-- 1 red red 44 Mar 24 16:07 flows\_www\_cred.json  
> -rw-r--r-- 1 red red 83 Mar 24 16:07 flows\_www.json  
> -rw-r--r-- 1 red red 265 Mar 24 16:07 .flows\_www.json.backup  
> drwxr-xr-x 3 red red 4.0K Mar 24 11:29 lib  
> drwxr-xr-x 192 red red 4.0K Apr 24 14:32 node\_modules  
> -rw-r--r-- 1 red red 459 Apr 24 14:32 package.json  
> -rw-r--r-- 1 red red 73K Apr 24 14:32 package-lock.json  
> drwxr-xr-x 4 red red 4.0K Mar 24 16:16 projects  
> -rw-r--r-- 1 red red 715 Apr 28 14:49 .sessions.json  
> -rw-r--r-- 1 red red 14K Mar 24 16:50 **settings.js**  
> -rw-r--r-- 1 red red 13K Mar 24 14:31 settings.original  
> drwxr-xr-x 2 red red 4.0K Mar 24 17:13 static

Here you should find your settings file.

---

<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:** [28 April 2020 16:57 UTC](https://discourse.nodered.org/t/cant-locate-setting-file/25688/6 "2020-04-28T16:57:46Z")

</div>

> [@1bit](#):
>
> I have installed it as per this site: [Install Node-RED on Orange Pi - AgriNode Project](https://agrinode.github.io/docs/install_nodered_orangepi/)
> 
> I agree on your note regarding running as root user.

Well that is why node-red-start and stop don't work. It is horrible running as root just to get access to the pins. That should just be a matter of making sure that the user is in the appropriate group, but I don't know much about armbian so can't comment further on that. Presumably you set up the start on boot which is why it is already running. If so then you should be able to start and stop node red as a service using

```auto
sudo systemctl stop nodered
sudo systemctl start nodered

```

It will probably log to syslog when running as a service. To run it in a terminal stop the service then run `node-red` to start it in a terminal. It will stop when you break out.

---

<div class="post-metadata">

**Author:** ![1bit](https://avatars.discourse-cdn.com/v4/letter/1/d6d6ee/32.png) [@1bit](https://discourse.nodered.org/u/1bit)\
**Post date:** [28 April 2020 17:10 UTC](https://discourse.nodered.org/t/cant-locate-setting-file/25688/7 "2020-04-28T17:10:29Z")

</div>

onbekende: That is a direct answer. Thanks.  
Colin: Thanks for your input.

So I'll install a clean copy of Armbian and try ([https://nodered.org/docs/getting-started/local#installing-with-npm](https://nodered.org/docs/getting-started/local#installing-with-npm)) based on the new information and see what happens.

cheers.

---

<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:** [28 April 2020 18:13 UTC](https://discourse.nodered.org/t/cant-locate-setting-file/25688/8 "2020-04-28T18:13:08Z")

</div>

As it is Debian based, maybe try the pi install script first

---

<div class="post-metadata">

**Author:** ![1bit](https://avatars.discourse-cdn.com/v4/letter/1/d6d6ee/32.png) [@1bit](https://discourse.nodered.org/u/1bit)\
**Post date:** [29 April 2020 04:40 UTC](https://discourse.nodered.org/t/cant-locate-setting-file/25688/9 "2020-04-29T04:40:30Z")

</div>

Update: After a complete installation nothing changed.

So I installed mosquitto and voila.

Thank you all for your support.

---

<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:** [28 June 2020 04:40 UTC](https://discourse.nodered.org/t/cant-locate-setting-file/25688/10 "2020-06-28T04:40:35Z")

</div>

Closed on 28 June 2020 04:40 UTC

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