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

Add updating of pre-installed node red nodes to update to upgrade system script #213

Closed
roswennen opened this issue Sep 27, 2017 · 11 comments
Labels
bug Something isn't working help wanted Extra attention is needed optional component Not part of the base system

Comments

@roswennen
Copy link

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

@ThomDietrich
Copy link
Member

@ThomDietrich
Copy link
Member

ThomDietrich commented Sep 27, 2017

@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!?
The issue is probably related to the fact, that the packages are installed globally. This issue HAS to be known in the node-red community. Would it be possible for you to dig in and find a way?

@roswennen
Copy link
Author

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

drwxr-xr-x  8 nobody root       4096 Jun 17 13:07 frontail
drwxr-xr-x  8 root   root       4096 Sep 27 08:30 node-red
drwxr-xr-x  4 nobody openhabian 4096 Sep 27 08:31 node-red-contrib-bigtimer
drwxr-xr-x  4 nobody openhabian 4096 Sep 27 08:31 node-red-contrib-openhab2
drwxr-xr-x 11 root   root       4096 Sep  7 18:49 npm

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/

drwxr-xr-x   3 openhabian openhabian 4096 Sep 27 08:31 node-red-contrib-bigtimer
drwxr-xr-x   3 root       root       4096 Sep 23 12:35 node-red-contrib-globalcache
drwxr-xr-x   4 root       root       4096 Sep  7 18:55 node-red-contrib-ibm-watson-iot
drwxr-xr-x   4 openhabian openhabian 4096 Sep 27 08:31 node-red-contrib-openhab2

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)

@dakipro
Copy link

dakipro commented Nov 1, 2017

is there any workaround for this? Perhaps uninstalling nodes and installing them again? (I have a lot of rules that would then be affected?)

@dakipro
Copy link

dakipro commented Nov 1, 2017

ok I googled a quick workaround for manual update via console, one needs to go to

/usr/lib/node_modules
then run

node-red-stop
sudo npm update
node-red-start

and latest version of nodes is installed

@ThomDietrich
Copy link
Member

@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!

@roswennen
Copy link
Author

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.

@dakipro
Copy link

dakipro commented Nov 9, 2017

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.
Of course, having a quick fix in the main update is good as a temporarily solution, it would "postpone" the urge to change way node-red is installed. Perhaps pre-installed nodes must be on this location.

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?

@roswennen
Copy link
Author

roswennen commented Nov 10, 2017

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.

@EliasGabrielsson EliasGabrielsson added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed optional component Not part of the base system and removed enhancement New feature or request labels Aug 5, 2019
@EliasGabrielsson EliasGabrielsson added this to the Upcoming Development milestone Aug 5, 2019
@mstormi
Copy link
Contributor

mstormi commented Apr 17, 2020

@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

@mstormi
Copy link
Contributor

mstormi commented Jun 16, 2020

Reading last comments and having waited for a month without feedback, I think is no longer needed.

@mstormi mstormi closed this as completed Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed optional component Not part of the base system
Projects
None yet
Development

No branches or pull requests

5 participants