hassio-addons / addon-node-red

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

[node-red-contrib-home-assistant-websocket] Node module cannot be loaded on this version. Requires: >=3.1.1 #1767

Closed Veldkornet closed 9 months ago

Veldkornet commented 9 months ago

Problem/Motivation

All HomeAssistant nodes failed to load after updating the home-assistant module from the palette

11 Dec 16:36:19 - [info] Node-RED version: v3.1.0
11 Dec 16:36:19 - [info] Node.js  version: v18.18.2
11 Dec 16:36:19 - [info] Linux 6.1.58-haos-raspi arm64 LE
11 Dec 16:36:21 - [info] Loading palette nodes
11 Dec 16:36:22 - [warn] [node-red-contrib-home-assistant-websocket] Node module cannot be loaded on this version. Requires: >=3.1.1 
11 Dec 16:36:30 - [warn] Missing node modules:
11 Dec 16:36:30 - [warn]  - node-red-contrib-home-assistant-websocket (0.59.0): ha_entity_filter, ha-api, ha-binary-sensor, ha-button, api-call-service, server, api-current-state, ha-device, ha-device-config, ha-entity, ha-entity-config, server-events, server-state-changed, ha-fire-event, ha-get-entities, api-get-history, ha-number, poll-state, api-render-template, ha-select, ha-sensor, ha-sentence, ha-switch, ha-tag, ha-text, ha-time, ha-time-entity, trigger-state, ha-update-config, ha-wait-until, ha-webhook, ha-zone
11 Dec 16:36:30 - [info] Removing modules from config
11 Dec 16:36:30 - [info] Settings file  : /etc/node-red/config.js
11 Dec 16:36:30 - [info] Context store  : 'default' [module=memory]
11 Dec 16:36:30 - [info] User directory : /config/
11 Dec 16:36:30 - [warn] Projects disabled : editorTheme.projects.enabled=false
11 Dec 16:36:30 - [info] Flows file     : /config/flows.json
11 Dec 16:36:30 - [info] Server now running at http://127.0.0.1:46836/
11 Dec 16:36:30 - [info] Waiting for missing types to be registered:
11 Dec 16:36:30 - [info]  - server
11 Dec 16:36:30 - [info]  - api-current-state
11 Dec 16:36:30 - [info]  - server-state-changed
11 Dec 16:36:30 - [info]  - api-call-service
11 Dec 16:36:30 - [info]  - server-events
[16:36:30] INFO: Starting NGinx...

Expected behavior

The module was updated and working after running the update and restarting.

Actual behavior

The module was not loaded because the version of NodeRED is not supported.

Steps to reproduce

Install this add-on, then install the node-red-contrib-home-assistant-websocket module

Proposed changes

Update NodeRED to version 3.1.3

DrDonoso commented 9 months ago

Hey @frenck, is it possible to generate a new release with the latest changes? It seems that the renovatebot updated the NodeRED version to 3.1.3: https://github.com/hassio-addons/addon-node-red/pulls?q=node-red+is%3Aclosed Highly appreciated, thanks!! 😁

frenck commented 9 months ago

is it possible to generate a new release with the latest changes?

Not right now, as the release process is current stuck due to a QEMU bug.

Closing this issue, as it is caused by a manual installment of the HA nodes, not the ones shipped by the add-on.

../Frenck

sheminasalam commented 9 months ago

Hey @frenck, is it possible to generate a new release with the latest changes? It seems that the renovatebot updated the NodeRED version to 3.1.3: https://github.com/hassio-addons/addon-node-red/pulls?q=node-red+is%3Aclosed Highly appreciated, thanks!! 😁

did you find any solution? i am also facing the same issue

Veldkornet commented 9 months ago

Hey @frenck, is it possible to generate a new release with the latest changes? It seems that the renovatebot updated the NodeRED version to 3.1.3: https://github.com/hassio-addons/addon-node-red/pulls?q=node-red+is%3Aclosed Highly appreciated, thanks!! 😁

did you find any solution? i am also facing the same issue

Yes, don't upgrade the module 😜

I see that the bot has already pulled all the correct versions together; so just need to wait on the next release.

cannondale0815 commented 9 months ago

Closing this issue, as it is caused by a manual installment of the HA nodes, not the ones shipped by the add-on.

../Frenck

@frenck So basically we are not supposed to ever update any nodes in the Node-Red palette manager? I do that regularly just because it doesn't seem to happen automatically. Is there a way to prevent this for the HA websocket node? I don't think this is typical user error, but a user just doing what they thought was the right thing to do -- updating the nodes in Node Red.

cannondale0815 commented 9 months ago

did you find any solution? i am also facing the same issue

@sheminasalam You can manually reinstall the "node-red-contrib-home-assistant-websocket" node in the node-red palette manager for the time being. That's what fixes it for me -- until the next restart of the node-red add-on.

tjorim commented 9 months ago

@frenck So basically we are not supposed to ever update any nodes in the Node-Red palette manager? ... I don't think this is typical user error, but a user just doing what they thought was the right thing to do -- updating the nodes in Node Red.

Correct, knock yourself out but don't complain when it breaks. You can update nodes yourself but not node-red, so take that into account when reading the changelogs.

Renovate automatically opens a pull request to update dependencies that are included by default. With the next release of the add-on, those updates will also be included.

I do that regularly just because it doesn't seem to happen automatically. Is there a way to prevent this for the HA websocket node?

That's a bit of a contradiction. It doesn't happen automatically, so what do you need to prevent? Just don't do it.

cannondale0815 commented 9 months ago

Correct, knock yourself out but don't complain when it breaks. You can update nodes yourself but not node-red, so take that into account when reading the changelogs.

Good to know, thank you. I have a few other custom nodes and have made it a habit to periodically check for any updates in the palette manager and then update them. Never occurred to me that I shouldn't do that for any HA-related nodes. Now I know, and hopefully this bug report here can serve for others to learn about this.

cannondale0815 commented 9 months ago

@tjorim Sorry to prolong this conversation. As per your suggestion I now stayed away from manually updating the websocket module but I'm afraid the damage is already done and after every full reboot and also after upgrading to 12.4 I have to manually install it again in the palette manager to get things going. I was under the impression that this issue would fix itself with a new release (based on some info further above). Anyway, would you have a suggestion of how to correct the damage for those who have updated the module manually at some point? I promise I will never manually update it again. Thanks!

Edit: Nevermind, this worked