# NR runs, but not

**URL:** <https://discourse.nodered.org/t/nr-runs-but-not/55393>\
**Category:** General\
**Created:** [18 December 2021 14:32 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393 "2021-12-18T14:32:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![StrongTown](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@StrongTown](https://discourse.nodered.org/u/StrongTown)\
**Post date:** [18 December 2021 14:32 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/1 "2021-12-18T14:32:08Z")

</div>

No idea what I've done however when I use `node-red-start` I get the response below. Neither the editor nor dashboard are available. Also, `node-red --safe` seems to do nothing, I just get my CLI prompt back.

```auto

Start Node-RED
 
Once Node-RED has started, point a browser at http://192.168.2.155:1880
On Pi Node-RED works better with the Firefox or Chrome browser
 
Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot
 
To find more nodes and example flows - go to http://flows.nodered.org
 
Starting as a systemd service.
nodered.service: Succeeded.

```

It will stay this way with nothing working.

I did run the current NR install / update script, results were the same.

```auto
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

```

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [18 December 2021 14:47 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/2 "2021-12-18T14:47:23Z")

</div>

> [@StrongTown](#):
>
> It will stay this way with nothing working.

You mean that the terminal does not return to the dollar prompt?  
What do you get when you point your browser to 192.168.2.155:1880 ?

There may be some useful information in the log, which you can see with node-red-log

I may be wrong but I think that with both node-red-start and node-red-log you have to use ctrl c to exit.

Personally I use **sudo systemctl start nodered** if I just want it to start up in the background, **node-red** if I want to see the output

---

<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:** [18 December 2021 15:01 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/3 "2021-12-18T15:01:51Z")

</div>

`node-red-start` should start node-red as a service and leave the terminal showing the node-red log.

I seem to remember seeing this problem before but can't remember the cause.

@StrongTown try setting the log level to trace in .node-red/settings.js and try again.

---

<div class="post-metadata">

**Author:** ![StrongTown](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@StrongTown](https://discourse.nodered.org/u/StrongTown)\
**Post date:** [18 December 2021 15:03 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/4 "2021-12-18T15:03:15Z")

</div>

The response I show above is the full NR log and no, it does not return to the CLI prompt, it stays exactly as shown above.

---

<div class="post-metadata">

**Author:** ![StrongTown](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@StrongTown](https://discourse.nodered.org/u/StrongTown)\
**Post date:** [18 December 2021 15:09 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/5 "2021-12-18T15:09:16Z")

</div>

Thanks `Colin`, good idea, however it has started to work properly again and I'm not sure why. As I think back on what I was doing, I did change the location of `contextStorage` prior to this problem. Can you advise please, should my file location (directory) be:

```auto
~/HC_Config/

```

```
  or 

```

`~/HC_Config` (no forward slash at the end).

---

<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:** [18 December 2021 15:11 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/6 "2021-12-18T15:11:15Z")

</div>

I suspect I know why. If you run node-red-start while it is running then that is what happens. I always run node-red-stop first. You can do this with  
`node-red-stop;node-red-start`  
and since that is usually the only command that I use `;` in I can just do Ctrl+R, hit `;` and it pops up the command, ready for me to hit Enter.

---

<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:** [18 December 2021 15:13 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/7 "2021-12-18T15:13:20Z")

</div>

Show us the whole of the contextStorage section. Is it working ok?

---

<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:** [18 December 2021 15:13 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/8 "2021-12-18T15:13:32Z")

</div>

Or node-red-reload

---

<div class="post-metadata">

**Author:** ![StrongTown](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@StrongTown](https://discourse.nodered.org/u/StrongTown)\
**Post date:** [18 December 2021 15:15 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/9 "2021-12-18T15:15:37Z")

</div>

```auto
   contextStorage: 
   {
      default: {
          module: "localfilesystem",
          config: {
			dir: "~/HC_Config/",
     			flushInterval: 30,         
        	  }
               }
   },

```

---

<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:** [18 December 2021 15:15 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/10 "2021-12-18T15:15:45Z")

</div>

> [@dceejay](#):
>
> node-red-reload

Thanks Dave, I didn't know about that one. It isn't in the log output on startup.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [18 December 2021 15:16 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/11 "2021-12-18T15:16:28Z")

</div>

When you install node-red on Linux - at least Debian based Linux, the installation process includes setting up and enabling a systemd service. Which means that when you reboot, NR starts automatically.

So it puzzles me that the guidance suggests **node-red-start** rather than **sudo systemctl restart nodered** for first and subsequent startups.

---

<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:** [18 December 2021 15:16 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/12 "2021-12-18T15:16:50Z")

</div>

Does it work?

---

<div class="post-metadata">

**Author:** ![StrongTown](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@StrongTown](https://discourse.nodered.org/u/StrongTown)\
**Post date:** [18 December 2021 15:19 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/13 "2021-12-18T15:19:24Z")

</div>

Everything is running fine BUT no, the context variables were not loaded from filesystem. I can tell because of the issues that are appearing. Easy enough to fix up but I want to make sure NR is using the right context directory. That's the one that gets backed up nightly.

---

<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:** [18 December 2021 15:21 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/14 "2021-12-18T15:21:17Z")

</div>

> [@StrongTown](#):
>
> I want to make sure NR is using the right context directory

Look in the folder and make sure the files are there and getting updated. If you look in the files it is obvious what they are.

---

<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:** [18 December 2021 15:23 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/15 "2021-12-18T15:23:45Z")

</div>

> [@jbudd](#):
>
> it puzzles me that the guidance suggests **node-red-start** rather than **sudo systemctl restart nodered**

node-red-start does some checks that node-red is installed ok, runs systemctl start, displays some helpful stuff, and shows the startup log, which is useful to make sure there aren't any startup issues.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [18 December 2021 15:31 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/16 "2021-12-18T15:31:23Z")

</div>

Yes it is sometimes helpful to see the log output, especially when it's freshly installed.

A matter of choice I guess but it seems less than helpful for the recommended startup method not to return to the dollar prompt, where one could otherwise choose to run **systemctl status nodered** or **tail -f /var/log/node-red.log** or **node-red-log**

I suppose I'm just uncomfortable if the dollar prompt isn't there. One reason I don't generally use the GUI

---

<div class="post-metadata">

**Author:** ![StrongTown](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@StrongTown](https://discourse.nodered.org/u/StrongTown)\
**Post date:** [18 December 2021 15:35 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/17 "2021-12-18T15:35:44Z")

</div>

Hmm. Not seeing a file time change every 30 secs like I should and I've tried setting the DIR to both options (with and without the ending forward slash). Even looked with file manager to see where else it might be writing` context` variables to with no luck so far.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [18 December 2021 15:35 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/18 "2021-12-18T15:35:57Z")

</div>

> [@StrongTown](#):
>
> `~/HC_Config`

You cannot use `~` in the path - it doesn't mean anything to node.js. Use the full path. It doesn't matter if it has a trailing / or not.

---

<div class="post-metadata">

**Author:** ![StrongTown](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@StrongTown](https://discourse.nodered.org/u/StrongTown)\
**Post date:** [18 December 2021 15:37 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/19 "2021-12-18T15:37:21Z")

</div>

Thanks Nick You''ll need to update the on-line docs I think as I believe they indicate the default DIR path is "`~/.node-red`".

EDIT: What I mean is to maybe expand on how to enter a proper location. I understand now what that is meant to portray however it did confuse me as I went to change it.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [18 December 2021 15:41 UTC](https://discourse.nodered.org/t/nr-runs-but-not/55393/20 "2021-12-18T15:41:40Z")

</div>

Good point.

We don't (I believe) ever use ~ in the context of an example setting you'd put in settings.js, and I _think_ we do say to use the full path.

But we do use it as a shortcut for explaining where the default user dir is located - so I can see how that could mislead readers.

[Next page](https://discourse.nodered.org/t/nr-runs-but-not/55393.md?page=2)
