You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
nvm being "installed" on jenkins-workspace hosts #988
Ugh, changed NVM_HOME but forgot that its install script is messing with .bashrc w/o asking.
@refack It's already installing it in local scope (that's why it's trying to load nvm from the workspace's tmp dir). The problem is that I'm running the install script instead of just git-cloning nvm into the directory myself.
The primary purposes of the install script is to install nvm and update your profile files; a direct git clone works fine too.
I'm confused tho why simply having those lines in bashrc would be a problem; unless you have a default alias specified, sourcing nvm.sh should be a noop.
The directory defined by export NVM_DIR="$HOME/build/workspace/node-inspect@tmp/.nvm" is ephemeral and when it's doesn't exist those statements return exit code 1.
They shouldn't; it's in a test - both lines are guarded by -s checks. The $NVM_DIR never has to exist; it's designed to gracefully do nothing in that case.
Are you setting some sort of bash options that might make it abnormally exit nonzero?
darn, I wish I had have saved the error output because I can't replicate it now by putting it back in. Basically I noticed this when I logged in as root and did su iojs to switch to that account and was confronted with 1/2 a screen of error messages, stack traces and whatnot.
so my guess now is that $HOME/build/workspace/node-inspect@tmp/.nvm was partly intact so the bash was executing to load it, but something about the node installation wasn't, causing the problem. I'm pretty sure the error I was seeing was Node stack traces, so it was loading Node but not fully somehow?
It seems like the issue was that [ -s "$NVM_DIR/nvm.sh" ] will not, in fact, fail with set -e - but if it's the last line of .bashrc, it will cause the process to exit 1.
A simple fix is to make the last line of .bashrc exit zero, perhaps by adding test ||: or something.
Activity
rvagg commentedon Nov 8, 2017
I've changed perms on .bashrc and .profile to
444to prevent this happening again (crossing fingers that nvm isn't too clever)refack commentedon Nov 8, 2017
Ack, that's me.
That job - https://ci.nodejs.org/job/node-inspect/ - is still in "beta" and hasn't landed yet (ATM only admins should have "run" capa) - #956.
/CC @jkrems
refack commentedon Nov 8, 2017
Ping @ljharb is there a way to use
nvmin a local scope, without it changing global state?hybrist commentedon Nov 8, 2017
Ugh, changed
NVM_HOMEbut forgot that its install script is messing with.bashrcw/o asking.@refack It's already installing it in local scope (that's why it's trying to load nvm from the workspace's tmp dir). The problem is that I'm running the install script instead of just git-cloning nvm into the directory myself.
hybrist commentedon Nov 8, 2017
Switching to direct git clone which should remove the side effect on bashrc: 1fb7b60
ljharb commentedon Nov 8, 2017
The primary purposes of the install script is to install nvm and update your profile files; a direct git clone works fine too.
I'm confused tho why simply having those lines in bashrc would be a problem; unless you have a default alias specified, sourcing nvm.sh should be a noop.
refack commentedon Nov 8, 2017
The directory defined by
export NVM_DIR="$HOME/build/workspace/node-inspect@tmp/.nvm"is ephemeral and when it's doesn't exist those statements return exit code 1.ljharb commentedon Nov 8, 2017
They shouldn't; it's in a
test- both lines are guarded by-schecks. The $NVM_DIR never has to exist; it's designed to gracefully do nothing in that case.Are you setting some sort of bash options that might make it abnormally exit nonzero?
rvagg commentedon Nov 8, 2017
darn, I wish I had have saved the error output because I can't replicate it now by putting it back in. Basically I noticed this when I logged in as root and did
su iojsto switch to that account and was confronted with 1/2 a screen of error messages, stack traces and whatnot.so my guess now is that
$HOME/build/workspace/node-inspect@tmp/.nvmwas partly intact so the bash was executing to load it, but something about the node installation wasn't, causing the problem. I'm pretty sure the error I was seeing was Node stack traces, so it was loading Node but not fully somehow?hybrist commentedon Nov 8, 2017
Sorry for the confusion! Should've thought of that. :)
refack commentedon Nov 8, 2017
@jkrems I'm trying to learn from this. For example, we should do beta testing only on sandboxed bots.
ljharb commentedon Nov 8, 2017
It seems like the issue was that
[ -s "$NVM_DIR/nvm.sh" ]will not, in fact, fail withset -e- but if it's the last line of.bashrc, it will cause the process to exit 1.A simple fix is to make the last line of
.bashrcexit zero, perhaps by addingtest ||:or something.