Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"NoConnectionError", even before "connected" #2020

Open
philipgo opened this issue Jan 5, 2025 · 1 comment
Open

"NoConnectionError", even before "connected" #2020

philipgo opened this issue Jan 5, 2025 · 1 comment
Labels
stale There has not been activity on this issue or PR for quite some time.

Comments

@philipgo
Copy link

philipgo commented Jan 5, 2025

Problem/Motivation

I hope this is the right place, please correct me if I should post this in https://github.com/zachowj/node-red-contrib-home-assistant-websocket

I stumbled upon the problem that certain nodes show a "no connection at:" error with a time corresponding to a restart of Home Assistant or the Node Red addon.

When looking at the Node Red addon-logs of the restart, I see many connection errors at times even before the addon reports "connected". Should connection attempts not wait until a connection is established? Is this the reason for the "no connection at:" error displayed by some nodes after restart?

Enabling connection delay and heartbeat made no difference.

Expected behavior

See no "no connection at:" errors :)

Actual behavior

see above, logs:

`Welcome to Node-RED

5 Jan 17:41:50 - [info] Node-RED version: v4.0.8
5 Jan 17:41:50 - [info] Node.js version: v22.11.0
5 Jan 17:41:50 - [info] Linux 6.6.66-haos x64 LE
5 Jan 17:41:50 - [info] Loading palette nodes
5 Jan 17:41:50 - [info] Node-RED Contrib Theme Collection version: v4.0.11
5 Jan 17:41:51 - [info] Dashboard version 3.6.5 started at /endpoint/ui
(node:297) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
5 Jan 17:41:52 - [info] node-red-contrib-home-assistant-websocket v0.75.0 nodes initialized
5 Jan 17:41:52 - [info] Settings file : /etc/node-red/config.js
5 Jan 17:41:52 - [info] Context store : 'default' [module=memory]
5 Jan 17:41:52 - [info] User directory : /config/
5 Jan 17:41:52 - [warn] Projects disabled : editorTheme.projects.enabled=false
5 Jan 17:41:52 - [info] Flows file : /config/flows.json
5 Jan 17:41:52 - [info] Server now running at http://127.0.0.1:46836/
[17:41:52] INFO: �[32mStarting NGinx...�[0m
5 Jan 17:41:52 - [info] Starting flows
5 Jan 17:41:52 - [info] Started flows
5 Jan 17:41:52 - [error] [api-get-history:2fb0984f587f7de5] NoConnectionError
5 Jan 17:41:52 - [error] [api-current-state:5c786a8e5fba3dd1] InputError: Entity could not be found in cache for entityId: sensor.home_nearest_distance
5 Jan 17:41:52 - [error] [ha-wait-until:3916bd181fd24218] InputError: Entity (sensor.time) could not be found
5 Jan 17:41:52 - [error] [api-current-state:56e1868d51d7c03d] InputError: Entity could not be found in cache for entityId: sensor.esp32_technikraum_frischwasser_durchfluss
5 Jan 17:41:52 - [error] [api-get-history:fd85ec8a5097ef52] NoConnectionError
5 Jan 17:41:52 - [error] [api-get-history:98c2d1e39ebd85c5] NoConnectionError
5 Jan 17:41:52 - [error] [api-get-history:f32b9e4d19068724] NoConnectionError
5 Jan 17:41:57 - [info] [server:Home Assistant] Connecting to http://supervisor/core
5 Jan 17:41:57 - [info] [server:Home Assistant] Connected to http://supervisor/core
`

Steps to reproduce

Sample flow that does not work after restart:

[ { "id": "387abdae978d0eda", "type": "inject", "z": "2915acb8b995b9cf", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 110, "y": 6720, "wires": [ [ "9ea43a5e75f810d8" ] ] }, { "id": "9ea43a5e75f810d8", "type": "api-get-history", "z": "2915acb8b995b9cf", "name": "", "server": "5a3777c7.b71588", "version": 1, "startDate": "", "endDate": "", "entityId": "sensor.time", "entityIdType": "equals", "useRelativeTime": true, "relativeTime": "5m", "flatten": true, "outputType": "array", "outputLocationType": "msg", "outputLocation": "payload", "x": 270, "y": 6720, "wires": [ [] ] }, { "id": "5a3777c7.b71588", "type": "server", "name": "Home Assistant", "version": 5, "addon": true, "rejectUnauthorizedCerts": true, "ha_boolean": "y|yes|true|on|home|open", "connectionDelay": true, "cacheJson": true, "heartbeat": true, "heartbeatInterval": "30", "areaSelector": "friendlyName", "deviceSelector": "friendlyName", "entitySelector": "friendlyName", "statusSeparator": "at: ", "statusYear": "hidden", "statusMonth": "short", "statusDay": "numeric", "statusHourCycle": "h23", "statusTimeFormat": "h:m", "enableGlobalContextStore": true } ]

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

@philipgo philipgo changed the title "NoConnectionError", also before "connected" "NoConnectionError", even before "connected" Jan 5, 2025
Copy link

github-actions bot commented Feb 5, 2025

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale There has not been activity on this issue or PR for quite some time.
Projects
None yet
Development

No branches or pull requests

1 participant