hassio-addons / addon-node-red

Node-RED - Home Assistant Community Add-ons
https://addons.community
MIT License
513 stars 117 forks source link

Network or Proxy settings borked in latest release. #1892

Closed ndoggac closed 2 weeks ago

ndoggac commented 2 weeks ago

Problem/Motivation

NR takes a long time to start, cannot install palettes, and it broke one of my flows that needs an exposed port 80.

Expected behavior

NR should start in only a few seconds, like it did a few weeks ago, and not take 4-5 minutes to start. NR should be able to install palettes. NR should work with my flow that's worked for over a year, with an exposed port 80. Believe network and/or proxy settings are messed up in new release. Running on HAOS, where HASS has internet connectivity with no issues. Also running latest websocket 0.65, NR latest, and HASS 2024.6.2.

Attempts to Fix

Exported all flows, uninstalled add-on, reinstalled new, and reimported flows. No change. Flows that do not depend on the network still work, once NR finally starts after 4+ minutes.

Steps to reproduce

Try to install a new palette? The node-red-contrib-amazon-echo-oztourer palette was working for nearly a year in my local Alexa flow.


2024-06-11T06:16:46.089Z Remove : node-red-contrib-amazon-echo-oztourer

2024-06-11T06:16:46.934Z npm remove --no-audit --no-update-notifier --no-fund --save node-red-contrib-amazon-echo-oztourer 2024-06-11T06:16:48.107Z [out] 2024-06-11T06:16:48.107Z [out] removed 70 packages in 998ms 2024-06-11T06:16:48.118Z rc=0


2024-06-11T06:16:55.966Z Install : node-red-contrib-amazon-echo 0.1.11

2024-06-11T06:16:56.785Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-amazon-echo@0.1.11 2024-06-11T06:16:57.037Z [err] npm warn config production Use --omit=dev instead.


2024-06-11T06:17:55.635Z Install : node-red-contrib-amazon-echo 0.1.11

2024-06-11T06:24:55.220Z [err] npm error code ETIMEDOUT 2024-06-11T06:24:55.220Z [err] npm error syscall connect 2024-06-11T06:24:55.220Z [err] npm error errno ETIMEDOUT 2024-06-11T06:24:55.224Z [err] npm error network request to https://registry.npmjs.org/node-red-contrib-amazon-echo failed, reason: connect ETIMEDOUT 2606:4700::6810:323:443 2024-06-11T06:24:55.224Z [err] npm error network This is a problem related to network connectivity. 2024-06-11T06:24:55.224Z [err] npm error network In most cases you are behind a proxy or have bad network settings. 2024-06-11T06:24:55.224Z [err] npm error network 2024-06-11T06:24:55.224Z [err] npm error network If you are behind a proxy, please make sure that the 2024-06-11T06:24:55.224Z [err] npm error network 'proxy' config is set properly. See: 'npm help config' 2024-06-11T06:24:55.227Z [err] 2024-06-11T06:24:55.227Z [err] npm error A complete log of this run can be found in: /root/.npm/_logs/2024-06-11T06_16_56_956Z-debug-0.log 2024-06-11T06:24:55.234Z rc=1

ndoggac commented 2 weeks ago

Was able to recreate this on a fresh installation of HAOS in a VM on Proxmox. HAOS has internet connection with no issues. I can download and install Node-Red add-on, disable SSL, and click "Start". It starts faster (probably due to no flows with port 80 exposed creating a timeout issue?). However, still cannot install new palettes, getting timeouts.

Since I can't install new palettes in the fresh installation, I can't test the port 80 exposed in the Alexa flow.

Wondering if this could be an IPV6 issue? Similar to: https://github.com/npm/cli/issues/348 Don't know how to force IPV4 on npm connection. But that would only fix palette installs, not the "port 80 exposed" issue which might be due to similar. Port 80 only exposed on the IPV6 connections, and not IPV4? Confirmed HAOS in both legacy and fresh installs have an IPV4 address assigned (since I'm connecting to the web interface :-).

tjorim commented 2 weeks ago

You should be able to disable IPv6 in the HA settings -> system -> network. Could you share your add-on config?

ndoggac commented 2 weeks ago

OK, fixed the IPV6 issue. Xfinity connection showed connection with DHCP6 address, but wasn't actually connected. Had to off/on the interface in pfsense to renew the DHCP and it came back. So that solves the palette download issue. Also disabled IPV6 in HASS settings per your recommendation. Thanks!

However, the exposed port 80 issue using the palette: node-red-contrib-amazon-echo still remains. As well as the very slow-startup, likely due to port 80 in some manner?

ndoggac commented 2 weeks ago

Using nmap, I can see that port 80 opens/closes on HAOS when I enable/disable the flow in node red. I wonder if Amazon disabled something?

ndoggac commented 2 weeks ago

Ok, things are working again. Not sure exactly what I did to fix it. Deleted the flow for Alexa, also removed the oztourer palette, rebooted HAOS, and reinstalled the palette, and imported the flow back in. Also could have been some latent thing tied to the IPV6 issues, or perhaps Amazon was having issues too? Some perfect, Mr. Murphy storm of issues coalesced right at the update of the add-on. Restarts are still a bit slow, but I can live with it. Please close this issue, sorry.

tjorim commented 2 weeks ago

Good to hear. You opened the issue, you can close it as well. There should be a button for it.