Connection Lost (Node-RED Snap)

Hello All

I don´t know if its coincidence or not, but after the dashboard node upgrade,every time i try to enter the dashboard i have the message " Connection Lost " in a recurrent way every second or so. Albeit the node red editor is still working as normal.

Looking forward to have any support.

Thank you

you may need to flush the browser cache. cmd/ctrl shift reload a couple of times shuold do it - but otherwise (on chrome) - go to chrome://appcache-internals/ and manually delete the node-red manifest.

Thank You dceejay,

solved in chrome but still the same issues in iPhone safari, any suggestions?

1 Like

dceejay.. cleand the cache from all the browser and its ok

Thank You once again for you prompt and effective support

Hello, I am seeing this on multiple browsers. I've tried flushing caches and visiting from browsers that have never seen the dashboard before but no change.

Dashboard version 2.11.0 running on ubuntu 18.04 LTS installed with snap

Any thoughts greatly appreciated.

James

Do you mean you are seeing connection lost appearing every few seconds? If so what do you see in the node red log

Thanks Colin. Where would I find the node red log bearing in mind i've installed with snap.

Thanks
James

You can see the log with

journalctl -f -u snap.node-red*

Great. Thanks. I'm back at the machine in the morning so will check and report back.

James

Dec 05 10:47:21 DC-4 node-red.node-red[16882]: 5 Dec 10:47:21 - [info] Node-RED version: v0.19.5
Dec 05 10:47:21 DC-4 node-red.node-red[16882]: 5 Dec 10:47:21 - [info] Node.js version: v8.12.0
Dec 05 10:47:21 DC-4 node-red.node-red[16882]: 5 Dec 10:47:21 - [info] Linux 4.15.0-39-generic x64 LE
Dec 05 10:47:21 DC-4 node-red.node-red[16882]: 5 Dec 10:47:21 - [info] Loading palette nodes
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [warn] rpi-gpio : Cannot find Pi RPi.GPIO python library
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] Dashboard version 2.11.0 started at /ui
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] Settings file : /root/snap/node-red/155/settings.js
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] Context store : 'default' [module=memory]
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] User directory : /root/snap/node-red/155
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [warn] Projects disabled : editorTheme.projects.enabled=false
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] Flows file : /root/snap/node-red/155/flows.json
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] Server now running at http://127.0.0.1:1880/
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [warn]
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: ---------------------------------------------------------------------
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: Your flow credentials file is encrypted using a system-generated key.
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: If the system-generated key is lost for any reason, your credentials
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: file will not be recoverable, you will have to delete it and re-enter
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: your credentials.
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: You should set your own key using the 'credentialSecret' option in
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: your settings file. Node-RED will then re-encrypt your credentials
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: file using your chosen key the next time you deploy a change.
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: ---------------------------------------------------------------------
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] Starting flows
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [tcp out:ECU1] connecting to 192.168.8.101:3002
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [tcp out:ECU2] connecting to 192.168.8.102:3002
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] Started flows
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [udp in:9dd3fbdd.7b138] udp listener at 0.0.0.0:7001
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [udp in:be82488e.ce8f5] udp listener at 0.0.0.0:7002
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [udp in:8c5fba52.9deb5] udp listener at 0.0.0.0:7003
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [udp in:8dfdf65e.75546] udp listener at 0.0.0.0:7004
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [udp in:65c646b4.1db2a8] udp listener at 0.0.0.0:7005
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [udp in:e1fa436e.a23338] udp listener at 0.0.0.0:7006
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [udp in:fa277899.242038] udp listener at 0.0.0.0:7007
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [udp in:7721a82d.d9cae8] udp listener at 0.0.0.0:7008
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [udp in:eac5113b.41868] udp listener at 0.0.0.0:7009
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [udp in:27dcfbaf.8c282c] udp listener at 0.0.0.0:7010
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [udp in:9ae3dd36.4ec3e8] udp listener at 0.0.0.0:7011
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [udp in:ec34e2a3.e80fd] udp listener at 0.0.0.0:7012
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [udp in:ac0a242f.bf1ca] udp listener at 0.0.0.0:7013
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [udp in:7732ed0c.6a09ac] udp listener at 0.0.0.0:7014
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [udp in:9eeef4d3.b924b] udp listener at 0.0.0.0:7015
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [udp in:5c40d986.5d148] udp listener at 0.0.0.0:7016
Dec 05 10:47:22 DC-4 node-red.node-red[16882]: 5 Dec 10:47:22 - [info] [tcp out:ECU1] connected to 192.168.8.101:3002
Dec 05 10:47:23 DC-4 node-red.node-red[16882]: 5 Dec 10:47:23 - [red] Uncaught Exception:
Dec 05 10:47:23 DC-4 node-red.node-red[16882]: 5 Dec 10:47:23 - Error: spawn EACCES
Dec 05 10:47:23 DC-4 node-red.node-red[16882]: at ChildProcess.spawn (internal/child_process.js:313:11)
Dec 05 10:47:23 DC-4 node-red.node-red[16882]: at exports.spawn (child_process.js:503:9)
Dec 05 10:47:23 DC-4 node-red.node-red[16882]: at Timeout._onTimeout (/snap/node-red/155/lib/node_modules/node-red-node-ping/88-ping.js:15:62)
Dec 05 10:47:23 DC-4 node-red.node-red[16882]: at ontimeout (timers.js:498:11)
Dec 05 10:47:23 DC-4 node-red.node-red[16882]: at tryOnTimeout (timers.js:323:5)
Dec 05 10:47:23 DC-4 node-red.node-red[16882]: at Timer.listOnTimeout (timers.js:290:5)
Dec 05 10:47:23 DC-4 systemd[1]: snap.node-red.node-red.service: Main process exited, code=exited, status=1/FAILURE
Dec 05 10:47:23 DC-4 systemd[1]: snap.node-red.node-red.service: Failed with result 'exit-code'.
Dec 05 10:47:23 DC-4 systemd[1]: snap.node-red.node-red.service: Service hold-off time over, scheduling restart.
Dec 05 10:47:23 DC-4 systemd[1]: snap.node-red.node-red.service: Scheduled restart job, restart counter is at 61284.
Dec 05 10:47:23 DC-4 systemd[1]: Stopped Service for snap application node-red.node-red.
Dec 05 10:47:23 DC-4 systemd[1]: Started Service for snap application node-red.node-red.

Does this shed any light on it?

Thanks
James

Yes... for some reason the ping command does not have access and is failing... Remove it from your flow - for now.
(Will need to fix that node to catch that error better - so thanks)

"Dec 05 10:47:23 DC-4 node-red.node-red[16882]: at Timeout._onTimeout (/snap/node-red/155/lib/node_modules/node-red-node-ping/88-ping.js:15:62)"

Thanks. Will try that.

When you say it doesn't have access, do you mean it can't resolve a ping to its target? The ping is fairly integral to this flow that monitors the status of various devices on the network.

FYI, the flow is copied directly from an installation on an RPi that runs without issue.

Thanks
James

Running things in a snap means they are restricted in what they can do... (the whole point of snaps is to try to make these containers more secure) - so it needs to be investigated as to which bit of what is blocking the access...

The error is just a generic Error: spawn EACCES

It may be the fact that the ping node is trying to spawn an external ping command (which snap blocks) - most likely... or it may be that the snap blocks network icmp access - less likely - or something else... so yes needs investigation.

OK. Thanks. I'm new to Ubuntu/Snap. Would i be better uninstalling from snap and reinstalling directly?

James

you could try snap install node-red --classic (after uninstalling first). This (should) install it un-contained and allow this to work... but... That's sort of not the point... but hey...

Failing that then yes you will need to do a "normal" install - for Ubuntu the Pi install script should work fine as they are both Debian based.

New version of ping node published so at least the new one catches the error and hopefully won't die... - it still won't actually run ping from within the container of course... but...

OK - now have some magic...
Apparently you need to manually attach the network-observe interface and then it will work...
It won't allow auto-connect as it is considered a management interface)

sudo snap connect node-red:network-observe

Thanks for your help on this and the speedy resolve to the snap issue.

I had uninstalled and re-installed 'normally' before I saw this so all is working well now.

Thanks
James

Is it the same issue I mentioned here?