# NodeRed 2.2 - Error 502

**URL:** https://discourse.nodered.org/t/nodered-2-2-error-502/57609
**Category:** General
**Created:** [1 February 2022 22:20 UTC](https://discourse.nodered.org/t/nodered-2-2-error-502/57609 "2022-02-01T22:20:21Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![nsoares](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nsoares/32/34031_2.png) [@nsoares](https://discourse.nodered.org/u/nsoares)
#### Post date: [1 February 2022 22:20 UTC](https://discourse.nodered.org/t/nodered-2-2-error-502/57609/1 "2022-02-01T22:20:21Z")

</div>

Hi good people.

I've been running node-red without any issues with Home-Assistant.  
Today I've realized it was automatically updated to version 2.2, and while creating a simple flow, I notice an "error 502". All the flows are "apparently running" but any new flow I create I get an "error 502" when pushing the deploy button.

Any ideas?? After a few seconds and pushes on the deploy button it goes away but returns a few seconds later.

 ![Screen Shot 2022-02-01 at 22.39.20](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/4/d40aebb905f95fc80bdca82ababf0dd763299d1b.png)

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [2 February 2022 06:00 UTC](https://discourse.nodered.org/t/nodered-2-2-error-502/57609/2 "2022-02-02T06:00:03Z")

</div>

This is more a home assistant issue. 502 means bad gateway. If you google "home assistant node-red 502" you will find various topics with suggestions.

---

<div class="post-metadata">

### Author: ![calif](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/calif/32/59768_2.png) [@calif](https://discourse.nodered.org/u/calif)
#### Post date: [3 February 2022 14:23 UTC](https://discourse.nodered.org/t/nodered-2-2-error-502/57609/3 "2022-02-03T14:23:15Z")

</div>

Did you find already a solution?  
have the same, after upgrade to node red 2.2 a "new" message appears. Generally when i deploy new flows it appears and after a while its gone. With the previous version of node red it never happened though.

---

<div class="post-metadata">

### Author: ![nsoares](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nsoares/32/34031_2.png) [@nsoares](https://discourse.nodered.org/u/nsoares)
#### Post date: [5 February 2022 18:54 UTC](https://discourse.nodered.org/t/nodered-2-2-error-502/57609/4 "2022-02-05T18:54:56Z")

</div>

no. haven't found the source of the problem yet ! and yourself @calif ?

---

<div class="post-metadata">

### Author: ![josiahtmorgan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/josiahtmorgan/32/55897_2.png) [@josiahtmorgan](https://discourse.nodered.org/u/josiahtmorgan)
#### Post date: [5 February 2022 19:04 UTC](https://discourse.nodered.org/t/nodered-2-2-error-502/57609/5 "2022-02-05T19:04:26Z")

</div>

Same here. Node Red auto-updated and I'm suddenly getting 502 errors everywhere and it seems that Node Red can no longer connect to Home Assistant.

---

<div class="post-metadata">

### Author: ![chrisghz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chrisghz/32/55411_2.png) [@chrisghz](https://discourse.nodered.org/u/chrisghz)
#### Post date: [5 February 2022 20:07 UTC](https://discourse.nodered.org/t/nodered-2-2-error-502/57609/6 "2022-02-05T20:07:27Z")

</div>

I'm having exactly the same issue after I just upgraded. ☹

---

<div class="post-metadata">

### Author: ![bnnie](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bnnie/32/55898_2.png) [@bnnie](https://discourse.nodered.org/u/bnnie)
#### Post date: [5 February 2022 20:10 UTC](https://discourse.nodered.org/t/nodered-2-2-error-502/57609/7 "2022-02-05T20:10:30Z")

</div>

Same problem here, after updating home assistant and node red.  
Repeatedly after deploying modification to any kind of node, if I try to inject anything goes to 502.

if it can help i've noticed missing icons in nodes properties before the 502 fades away,  
like in the screenshot below:  
 ![screenshot](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/1/71fd36fe5c0d6f591eff197add2140fd8b3a28f9.jpeg)

Also log reports multiple errors like:

```auto
2022/02/05 21:00:40 [error] 562#562: *437 connect() failed (111: Connection refused) while connecting to upstream, client:

```

After few seconds, judging from the logs, seems there's like a reconnection (?) and 502 error just goes away, icons are back, and all flows seems to work correctly.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [6 February 2022 05:32 UTC](https://discourse.nodered.org/t/nodered-2-2-error-502/57609/8 "2022-02-06T05:32:06Z")

</div>

I would highly recommend to report this in the home assistant forums.

---

<div class="post-metadata">

### Author: ![mikefila](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikefila/32/95223_2.png) [@mikefila](https://discourse.nodered.org/u/mikefila)
#### Post date: [6 February 2022 17:37 UTC](https://discourse.nodered.org/t/nodered-2-2-error-502/57609/9 "2022-02-06T17:37:20Z")

</div>

Temporary fix for ppl with the home assistant addon.

> <https://github.com/hassio-addons/addon-node-red/issues/1258#issuecomment-1028306193>
>
> \# Problem/Motivation
> 
> \> Everytime pressing deploy, NodeRed restarts
> 
> This is… happening since i updated NodeRed to 10.4.0
> 
> \## Expected behavior
> 
> \> only deploy, no restart
> 
> \## Actual behavior
> 
> \> Node Red restarts
> 
> \## Steps to reproduce
> 
> \> Press Deploy button
> 
> 
> 
> LOG says this:
> 
> 1 Feb 18:42:39 - \[info\] Stopping modified nodes
> 1 Feb 18:42:39 - \[info\] Stopped modified nodes
> 1 Feb 18:42:39 - \[info\] Starting modified nodes
> 1 Feb 18:42:39 - \[red\] Uncaught Exception:
> 1 Feb 18:42:39 - \[error\] TypeError: RED.settings.functionGlobalContext.get is not a function
> at map (/opt/node\_modules/node-red-contrib-actionflows/actionflows/actionflows.js:270:51)
> at EventEmitter.runtimeMap (/opt/node\_modules/node-red-contrib-actionflows/actionflows/actionflows.js:593:5)
> at EventEmitter.emit (node:events:390:28)
> at start (/opt/node\_modules/@node-red/runtime/lib/flows/index.js:383:12)
> \[18:42:39\] INFO: Starting Node-RED...

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [6 February 2022 18:08 UTC](https://discourse.nodered.org/t/nodered-2-2-error-502/57609/10 "2022-02-06T18:08:55Z")

</div>

I had a sneaky feeling this was due to node-red crashing and related to action flows.

There is an issue (and a PR to fix it) here: [https://github.com/Steveorevo/node-red-contrib-actionflows/issues/19](https://github.com/Steveorevo/node-red-contrib-actionflows/issues/19)

@mikefila you might want to share this on the HA forum - on that thread? (I am not a member / dont use HA)

---

<div class="post-metadata">

### Author: ![mikefila](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikefila/32/95223_2.png) [@mikefila](https://discourse.nodered.org/u/mikefila)
#### Post date: [6 February 2022 18:46 UTC](https://discourse.nodered.org/t/nodered-2-2-error-502/57609/11 "2022-02-06T18:46:11Z")

</div>

That is where I got the link from. Someone started another thread this morning looking for a fix and linked to here. Figured I'd convey the fix.

---

<div class="post-metadata">

### Author: ![bnnie](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bnnie/32/55898_2.png) [@bnnie](https://discourse.nodered.org/u/bnnie)
#### Post date: [6 February 2022 19:54 UTC](https://discourse.nodered.org/t/nodered-2-2-error-502/57609/12 "2022-02-06T19:54:17Z")

</div>

Lovely..

adding:

```auto
init_commands: 
    - npm uninstall node-red-contrib-actionflows

```

to node red configuration seems to worked for me (I've made a quite a few testing at this point).  
I understood this is a temporary fix to the issue, but for now Node red runs stable.

Thank you very much for the tip @mikefila 🙏

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [7 February 2022 08:13 UTC](https://discourse.nodered.org/t/nodered-2-2-error-502/57609/13 "2022-02-07T08:13:32Z")

</div>

@bnnie @mikefila

node-red-contrib-actionflows V2.1.2 is now available [in the flows library](https://flows.nodered.org/node/node-red-contrib-actionflows) 👍

This should hopefully close this thread off.

---

<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: [21 February 2022 08:13 UTC](https://discourse.nodered.org/t/nodered-2-2-error-502/57609/14 "2022-02-21T08:13:44Z")

</div>

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