Issue with NR - Losing connection on Azure Cloud

Hi ,

I have NR based on docker.
Its on Azure Cloud.
No internet access.

The Editor keeps giving lost connection.
We removed all flows and made it empty. Yet process starts and in few minutes we get "Lost Connection".

Any insight ?

The Lost Connection notification in the editor happens when the websocket connection between the editor and runtime is broken. If you are running behind any sort of proxy, make sure it is configured to allow websocket connections through.

Thank You Nick for the super quick feedback. I will check this.

Also - based on what i read online - another way is to make it https ? We are already using https - FYI and still issue occurs.

https would only help if it got you through whatever is causing the issue so it was worth trying anyway.

Just a side-note - if you are accessing node-red over the Internet, you really MUST use https along with a login (which you can use Azure AD for when working with Azure services). If you had a login but didn't have https, please change your password ASAP in case anything harvested it.

For the issue, if you open the dev tools on your browser and go to the network tab, you will be able to see the websocket connection - if it is failing, you should see the error code and may get some other info (or may not depending on the issue). Here is an example of it working - note the code 101 which indicates that the websocket has done a successful handshake and "upgraded" the connection to wss: in this case, ws: if not using https.

image

If that had worked for you, clicking on the "messages" tab within the network entry would show you all of the messages being exchanged between the Editor and your browser.

Thank You @TotallyInformation .
I will work with out folks . This is useful.

Will update how it goes.

Hi,

I checked it with my team.

  1. There is proxy involved. No internet.
  2. Below is a snapshot from DevTools in Chrome.

Any further insights ?

You will need to monitor the websocket and see when it dies, see if you can spot any patterns. Also check the logs and performance of the proxy.

Noted. Will check. There is no proxy .
Thanks.

I just realised that earlier I said there is proxy when there is not.

My apologies.

There is no proxy.

Guys - anything ?

I think your NR host, and the box you're using to render the editor do not have a clean connection.

I would review the azure nw config to debug whats going on.

Checked . We are at our wits end. There is no proxy involved .
And yet editor keeps disconnecting . Any logs we can check which can give us any clues ?

You will need to look at networking between the client and the server. I think it likely that something is either periodically flooding the network or your client device is periodically flooding the devices network card (check for anything else that is running and double check for malware). Or it could be something on the server that is periodically flooding its network card (again check for malware or a process that shouldn't be running not just checking the normal processes).

if the editor is closing connection, I guess the logs you want to see are the ones you will find on the Web Dev Tools page. You want to understand why the websocket connection is closed.
I am guessing the node-red engine is not crashing... :thinking:

I am back.

Seeking your help again. The issue is not yet sorted.
On further invesitgation we see the below
It looks like the handshake between https and wss is not happening and causing the disconnect.

Any leads - based on below ?

You've blanked out the URL, but if you access the editor at example.com then I'd expect that url to be example.com/comms. Is that the case here?

We can see from those headers the request has made it to Node-RED (the X-Powered-By: Express is a clue unless you have other Express powered webservers in your environment). But for that to return 404 means the path is wrong.

So maybe your nginx config is incorrect for mapping through the request... not sure really.

Yes thats the case.
Editor is : http://example.com

You said previously that no proxy was involved but it clearly does have an NGINX reverse proxy in play.

So if you can reach the editor on https://example.local/ (e.g. no port number so using port 443 and no additional path), you need to check the NGINX config because you probably are not proxying other paths on that domain correctly. If you know the IP address, try that instead (as a test - most likely with :1880 port added). And double-check your settings.js file to see whether you've forgotten that you moved the admin or other paths around.

Guys - All -

Thank You so much for helping with this issue. The issue was indeed with NGINX . Once configured for ingress it started working .

(I am not the one doing the actual installation and am a go between for those guys - so sometimes the info provided to me was not correct/accurate. I regret sharing such info here before ).

Thank You again to the forum for its strength in helping with these issues.

3 Likes

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