ShipChain / hydra

Centralized network management for decentralized networks -- helping organize and publish sidechain connection details
https://docs.shipchain.io/docs/validatorGuide.html
Apache License 2.0
8 stars 2 forks source link

`hydra client update` breaks when hydra installed under sudo #14

Open leewardbound opened 5 years ago

leewardbound commented 5 years ago

hydra client update works by replacing the running process with pip install git+... to upgrade itself, always installing into the users home folder.

However, since replacing the running process eliminates the side effects of prefixing hydra client update with sudo, if the package is installed under sudo, there's no way for it to update itself.

Anyone with hydra installed under sudo currently (who followed our getting started guide prior to v0.0.3b3) will therefore be unable to use the upgrade helper and must either: 1) always use sudo pip3 install git+https://github.com/shipchain/hydra.git@master, which is longer and inconvenient but pretty much fine, but it needs to be documented somewhere... or 2) run this one time right now to remove all the installed versions and just reinstall under your ~/.local directory, which will fix this problem for you forever: pip3 uninstall -y hydra ; sudo pip3 uninstall -y hydra ; pip3 install git+https://github.com/shipchain/hydra.git@master (and then log out and log in, and hydra -v should show at least version 0.0.3b3 on the first line)

Hydra could try to engineer around this by changing off of the os.execpv method, but (1) and (2) above would still be relevant (because if we introduced the fix in v0.0.3b4, you'd still have to manually sudo your upgrade to download it) and frankly I'm not sure how else we can safely make this package update itself while it's still running. I think since we've updated the Getting Started Guide to no longer default to sudo installs, this issue can dangle, we ask users to run (2) above.

mlclay commented 5 years ago

While we could engineer a way to make this upgrade work for sudo installed hydra and user installed hydra, I don't think we should perpetuate this unrecommended approach to having the application installed.

We should post the instructions in (2) above to the appropriate Gitter and Slack channels to get the current users on the recommended installation approach and close this issue.

leewardbound commented 5 years ago

agreed, and i've already taken such steps :) i just want to leave this issue open as documentation for another ~month until we're sure everyone has upgraded onto testnet-beta