-
-
Notifications
You must be signed in to change notification settings - Fork 253
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
Add updating of pre-installed node red nodes to update to upgrade system script #213
Comments
Reference: https://community.openhab.org/t/node-red-as-a-rule-script-engine-for-openhab/14914/130 Thanks for reporting! |
@roswennen now that I'm reading the issue description again, I wonder. Why is it, that you can not update those nodes through node-red? I do not use node-red but it sounds like a solution for that might actually be the better solution in whole!? |
Thom, I'm a fairly node red newbie so not sure I can solve but I think you are right. It looks like the node red is installed as root and the big timer and the openhanded node as user openhabian. You clearly see the difference when looking at the /usr/lib/node_modules/ folder
the 2 nodes pre installed by your script are use openhabian while the node red itself is user root. The same difference across when I look at nodes afterwards installed through the node red UI in the folder /root/.node-red/node_modules/
bigtimer and openhaal have user openhabian and group openhabian while the global cache one (which is one that I installed through the UI) has user root I'm not sure what the solution is and I can't play around now with chown and changing group (as I re-installed node red through the scrip and all nodes are now up to date (as your script does seem to have an npm update line for the 2 installed nodes). In the Openhab community there are some node red experts maybe they can help (it's probably a matter of running the nom install for the nodes as root rather than openhabian) |
is there any workaround for this? Perhaps uninstalling nodes and installing them again? (I have a lot of rules that would then be affected?) |
ok I googled a quick workaround for manual update via console, one needs to go to /usr/lib/node_modules node-red-stop and latest version of nodes is installed |
@dakipro @roswennen I'm not a nodered user myself. It would be great if you could figure out the best way to solve the issue for others so that either a simple update through the UI is possible or by integrating the steps by @dakipro in the openhabian-config nodered routine. A PR would be appreciated! |
Sorry for the delay, I'll double check tonight to see the directories are indeed these for openhabian and yes when adding this to the element in your menu that updates all components this would indeed update the nodes. So it would work and users can use openhabian install menu for the preinstalled nodes and the GUI for all other nodes. But it's not 100% clean solution, having consistency across all nodes would be the clean way to go. But for now, yes it would definitely work. |
I really do not have environment and skills (yet) to check this, but I agree that having nodes on the right location in the first place is the right approach. Important question is how will existing users be affected, would update script need to uninstall existing nodes and install them on the "proper" location and how would that affect existing flows? |
Tested the script and it indeed updates the pre-installed nodes. Don't know whether it also updates the nodes installed through UI as those were up to date. So adding the script in 02 - Upgrade System will do the trick. For the long run I would almost argue removing the pre-installation of bigtimer and OH from the node red installation script and telling people how to install them through the UI (very simple). This way you won't have any maintenance issues Thom as your script will install node red but not the nodes. People using node red will for sure install additional nodes through UI so in the long run they will be better of installing bigtimer and OH node through UI as well for consistency. |
@roswennen is this still an issue ? If so, could you come up with a PR ? Add a routine to the functions/*.bash script to handle node-red today, and use an argumernt such as install/uninstall/upgrade |
Reading last comments and having waited for a month without feedback, I think is no longer needed. |
When installing Node red through the openhabian menu (optional components) certain nodes are pre installed.
These nodes cannot be upgraded through the node red UI once live. So in order to keep the node red nodes up to date all pre-installed node red nodes that are included in the optional components node red node should be added in the "02 Upgrade system script" like (example for bigtimer)
sudo npm update -g node-red-contrib-bigtimer
The text was updated successfully, but these errors were encountered: