# Unable access node-red via browser

**URL:** <https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983>\
**Category:** General\
**Created:** [10 December 2021 06:57 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983 "2021-12-10T06:57:30Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![zyx09](https://avatars.discourse-cdn.com/v4/letter/z/f19dbf/32.png) [@zyx09](https://discourse.nodered.org/u/zyx09)\
**Post date:** [10 December 2021 06:57 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983/1 "2021-12-10T06:57:30Z")

</div>

Hello to all,  
I'm not able access node-red via browser due to my context storage error. Below error  
shown when running node-red from cli.

"$ node-red start  
10 Dec 15:04:53 - [info]

# Welcome to Node-RED

10 Dec 15:04:53 - [info] Node-RED version: v2.1.1  
10 Dec 15:04:53 - [info] Node.js version: v14.18.1  
10 Dec 15:04:53 - [info] Linux 3.4.39 arm LE  
10 Dec 15:04:54 - [info] Loading palette nodes  
10 Dec 15:04:58 - [info] Dashboard version 3.0.4 started at /ui  
10 Dec 15:04:58 - [info] Settings file : /home/htnice/.node-red/settings.js  
10 Dec 15:04:58 - [info] Context store : 'memoryOnly' [module=memory]  
10 Dec 15:04:58 - [info] Context store : 'file' [module=localfilesystem]  
10 Dec 15:04:58 - [error] Failed to start server:  
10 Dec 15:04:58 - [error] Error: Error loading context store: Error: Invalid JSON in context file '/home/htnice/.node-red/context/e9667f131763216a/flow.json'  
at /usr/local/lib/node\_modules/node-red/node\_modules/@node-red/runtime/lib/nodes/context/index.js:175:15  
$  
"  
How do i revert back to last good condition stage?  
Appreciate anyone can help.  
Thank you

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 December 2021 06:58 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983/2 "2021-12-10T06:58:55Z")

</div>

I thought the command was `node-red-start` not - as you how it: `node-red start`

---

<div class="post-metadata">

**Author:** ![zyx09](https://avatars.discourse-cdn.com/v4/letter/z/f19dbf/32.png) [@zyx09](https://discourse.nodered.org/u/zyx09)\
**Post date:** [10 December 2021 07:07 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983/3 "2021-12-10T07:07:11Z")

</div>

> [@Trying\_to\_learn](#):
>
> node-red-start

$ node-red-start  
-sh: 252: node-red-start: not found

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 December 2021 07:09 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983/4 "2021-12-10T07:09:13Z")

</div>

Ok, in what directory are you entering the command?

_Who_ installed Node-red? (You or _root_)?

Seeing the `$` I'm guessing you are using ubuntu/linux.

---

<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:** [10 December 2021 07:26 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983/5 "2021-12-10T07:26:21Z")

</div>

If you have not installed using the recommended Ubuntu/Debian/Pi script then the command to start node red using the default flow file is  
`node-red`  
Adding `start` tells it to use a flow file called start.  
Assuming it still fails using node-red then delete the file it is complaining about, which appears to be corrupted. Did you have a power failure? That is the sort of situation that might cause the corruption. The file contains flow context data.  
In fact rather than delete, move it somewhere and see what is in it. Restart node red after moving it.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 December 2021 07:26 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983/6 "2021-12-10T07:26:33Z")

</div>

What happens if you just type `node-red` in the terminal?

---

<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:** [10 December 2021 07:32 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983/7 "2021-12-10T07:32:11Z")

</div>

> [@zyx09](#):
>
> Error: Invalid JSON in context file '/home/htnice/.node-red/context/e9667f131763216a/flow.json'

Hi @zyx09

The error in the log tells you exactly what the issue is.

You have file context enabled, and somehow one of the store files has invalid JSON in it.

Have a look at the json file mentioned in the error message.

The quick fix will be to remove that file - you will lose whatever context data had been saved for that flow, but if the file is bad, then it's probably already lost.

---

<div class="post-metadata">

**Author:** ![zyx09](https://avatars.discourse-cdn.com/v4/letter/z/f19dbf/32.png) [@zyx09](https://discourse.nodered.org/u/zyx09)\
**Post date:** [10 December 2021 07:47 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983/8 "2021-12-10T07:47:39Z")

</div>

> [@knolleary](#):
>
> you will lose whatever context data had been saved

Thank you and Colin reply.

I dun mind lose all context data had been saved. As long i can access node-red to continue

my development.

I will try it and you update.

Again thanks a lot

---

<div class="post-metadata">

**Author:** ![zyx09](https://avatars.discourse-cdn.com/v4/letter/z/f19dbf/32.png) [@zyx09](https://discourse.nodered.org/u/zyx09)\
**Post date:** [10 December 2021 08:10 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983/9 "2021-12-10T08:10:21Z")

</div>

It's work, now can access node-red via browser.

But not only data lost. I had few flows tab also lost too.

Can you point me where can i learn how to backup all flows and node-red settings files to my

laptop, Instead leave it at controller.

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:** [10 December 2021 10:41 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983/10 "2021-12-10T10:41:27Z")

</div>

Does the fact that you have marked this as the solution mean that you do not need the question there answered?

Just in case, you should backup the whole of the .node-red folder except for the node\_modules folder, which may be very large.

The fact that you lost more than just the context file is worrying. In your situation I would probably discard the SD card, or at least only use it on non-critical systems, as there is a possibility that it may be failing. Also make sure you are using a good quality power supply.

---

<div class="post-metadata">

**Author:** ![zyx09](https://avatars.discourse-cdn.com/v4/letter/z/f19dbf/32.png) [@zyx09](https://discourse.nodered.org/u/zyx09)\
**Post date:** [10 December 2021 11:45 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983/11 "2021-12-10T11:45:55Z")

</div>

Thanks your valuable information.

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [10 December 2021 12:47 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983/12 "2021-12-10T12:47:33Z")

</div>

> [@zyx09](#):
>
> But not only data lost. I had few flows tab also lost too.

maybe you didn't lose your flows ?

1. how did you start node-red after you fixed the problem with the corrupt Context file ?  
With `node-red` ?
2. show us the list of .json files from your `.node-red` folder ?

---

<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:** [10 December 2021 13:35 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983/13 "2021-12-10T13:35:59Z")

</div>

If you did use `node-red start` as originally posted you may well also have a file called start or start.json that may contain a version of your flows - whether it is worth saving will require some careful digging - but first backup the files as Colin suggested.

---

<div class="post-metadata">

**Author:** ![zyx09](https://avatars.discourse-cdn.com/v4/letter/z/f19dbf/32.png) [@zyx09](https://discourse.nodered.org/u/zyx09)\
**Post date:** [12 December 2021 06:24 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983/14 "2021-12-12T06:24:50Z")

</div>

@UnborN & @dceejay Thank you for both reply and help.

Hello UnborN,  
I setup systmectl enable node-red.service to startup my node-red application when controller is power up. By default it will run flows.json.

Here is my json files. Unfortunately i already deleted that corrupt flows.json and flows.json.backup which on date 09 Dec. The rest of json files still in good condition.

 ![listjson](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/b/3bdfc67e9cab033cfc9f6a120ecc9b2d5768b3f9.jpeg)

I did open that 2 corrupt json files, all it shown "^@Q^@Q^@Q^@Q.........".

Hi dceejay,  
I tried search "start.json" with command 'find -type f -iname "start.json",  
but it reported all are permission denied, as shown below

$ find / -type f -iname "start.json"  
find: '/lost+found': Permission denied  
find: '/proc/tty/driver': Permission denied  
find: '/proc/1/task/1/fd': Permission denied  
find: '/proc/1/task/1/fdinfo': Permission denied  
find: '/proc/1/task/1/ns': Permission denied"  
...

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [12 December 2021 07:43 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983/15 "2021-12-12T07:43:56Z")

</div>

> [@zyx09](#):
>
> Unfortunately i already deleted that corrupt flows.json and flows.json.backup

Why did you delete the actual flow files? Nobody suggested to do that.  
The discussion and suggestions was to backup the `.node-red` folder  
and then remove the Context file `'/home/htnice/.node-red/context/e9667f131763216a/flow.json'`

Anyway .. i think the only chance to salvage anything is from that `flows.json.bak1` file with Date Nov 5

Open it with a text editor .. copy its contents and paste in the Node-red Editor **Import** window (Ctrl-I)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/2/f2529f84f2d93373bc828fdb50afa784410f2775.png)

---

<div class="post-metadata">

**Author:** ![zyx09](https://avatars.discourse-cdn.com/v4/letter/z/f19dbf/32.png) [@zyx09](https://discourse.nodered.org/u/zyx09)\
**Post date:** [12 December 2021 12:45 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983/16 "2021-12-12T12:45:51Z")

</div>

learn the painful lesson... 😢

---

<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:** [26 December 2021 12:45 UTC](https://discourse.nodered.org/t/unable-access-node-red-via-browser/54983/17 "2021-12-26T12:45:56Z")

</div>

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