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

RVM claims it can't find curl when using node-which; Node.js builds contain ./node_modules/bin in $PATH #5092

Open
cvrebert opened this issue Nov 12, 2015 · 76 comments

Comments

@cvrebert
Copy link

This literally stopped working just a few minutes ago.

$ rvm install 2.0.0 && rvm use 2.0.0
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/12.04/x86_64/ruby-2.0.0-p598.tar.bz2
Checking requirements for ubuntu.
Requirements installation successful.
ruby-2.0.0-p598 - #configure
ruby-2.0.0-p598 - #download
RVM requires 'curl'. Install 'curl' first and try again.
There was an error(200).
Checking fallback: ftp://rvm_io.global.ssl.fastly.net/binaries/ubuntu/12.04/x86_64/ruby-2.0.0-p598.tar.bz2?rvm=1.26.8
Checking fallback: http://www.mirrorservice.org/sites/rvm_io.global.ssl.fastly.net/binaries/ubuntu/12.04/x86_64/ruby-2.0.0-p598.tar.bz2?rvm=1.26.8
No fallback URL could be found, try increasing timeout with:
    echo "export rvm_max_time_flag=20" >> ~/.rvmrc
Downloading https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/12.04/x86_64/ruby-2.0.0-p598.tar.bz2 failed.
Mounting remote ruby failed with status 2, trying to compile.
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /home/travis/.rvm/rubies/ruby-2.0.0-p598, this may take a while depending on your cpu(s)...
ruby-2.0.0-p598 - #downloading ruby-2.0.0-p598, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10.2M  100 10.2M    0     0  46.1M      0 --:--:-- --:--:-- --:--:-- 53.7M
ruby-2.0.0-p598 - #extracting ruby-2.0.0-p598 to /home/travis/.rvm/src/ruby-2.0.0-p598....
ruby-2.0.0-p598 - #configuring..................................................
ruby-2.0.0-p598 - #post-configuration..
ruby-2.0.0-p598 - #compiling.............................................................................
ruby-2.0.0-p598 - #installing..............................
ruby-2.0.0-p598 - #making binaries executable..
RVM requires 'curl'. Install 'curl' first and try again.
There was an error while trying to resolve rubygems version for 'latest'. 
Halting the installation.
The command "rvm install 2.0.0 && rvm use 2.0.0" failed and exited with 4 during .

Obviously, falling back to compiling Ruby from source should be avoided if at all possible.

@cvrebert
Copy link
Author

The error has mysteriously stopped occurring.

@cvrebert
Copy link
Author

It's still happening: https://travis-ci.org/twbs/bootstrap/jobs/90976058
Apparently it's intermittent.

@cvrebert
Copy link
Author

@BanzaiMan Help?

@BanzaiMan
Copy link
Contributor

This is peculiar. My current guess is that the instance used in the failing builds were somehow lacking curl or had $PATH wrong.

@cvrebert
Copy link
Author

Okay, it gets even weirder. curl is installed on the system, despite what RVM claims.
From the debug output added to https://travis-ci.org/twbs/bootstrap/jobs/91526407 :

$ echo $PATH
/home/travis/.nvm/versions/node/v4.2.2/bin:/home/travis/bin:/home/travis/.local/bin:/home/travis/.gimme/versions/go1.4.1.linux.amd64/bin:/usr/local/phantomjs/bin:./node_modules/.bin:/usr/local/maven-3.2.5/bin:/usr/local/clang-3.4/bin:/home/travis/.gimme/versions/go1.4.1.linux.amd64/bin:/usr/local/phantomjs/bin:./node_modules/.bin:/usr/local/maven-3.2.5/bin:/usr/local/clang-3.4/bin:/home/travis/.gimme/versions/go1.4.1.linux.amd64/bin:/home/travis/.rvm/gems/ruby-1.9.3-p551/bin:/home/travis/.rvm/gems/ruby-1.9.3-p551@global/bin:/home/travis/.rvm/rubies/ruby-1.9.3-p551/bin:/usr/local/phantomjs/bin:./node_modules/.bin:/usr/local/maven-3.2.5/bin:/usr/local/clang-3.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/travis/.rvm/bin:/home/travis/.rvm/bin:/home/travis/.rvm/bin
$ which curl || true
/usr/bin/curl
$ ls -l /usr/bin/curl || true
-rwxr-xr-x 1 root root 129696 Jan 14  2015 /usr/bin/curl
$ rvm install 2.2
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/12.04/x86_64/ruby-2.2.0.tar.bz2
Checking requirements for ubuntu.
Requirements installation successful.
ruby-2.2.0 - #configure
ruby-2.2.0 - #download
RVM requires 'curl'. Install 'curl' first and try again.
There was an error(200).

@cvrebert
Copy link
Author

Still repros even after upgrading to rvm 1.26.11: https://travis-ci.org/twbs/bootstrap/jobs/91533567

@cvrebert
Copy link
Author

Filed rvm/rvm#3559 since the evidence points towards a possible bug in RVM.

@XhmikosR
Copy link

This still happens. If I clear the cache it works though.

@XhmikosR
Copy link

Example, failing https://travis-ci.org/mpc-hc/mpc-hc.org/builds/93137684
with cache cleared https://travis-ci.org/mpc-hc/mpc-hc.org/builds/93137684

Same build, it's just the cache is cleared.

@BanzaiMan
Copy link
Contributor

@XhmikosR Does the build reliably fail if you keep the cache?

@XhmikosR
Copy link

Yeah it would seem so.
On Nov 25, 2015 15:25, "Hiro Asari" notifications@github.com wrote:

@XhmikosR https://github.com/XhmikosR Does the build reliably fail if
you keep the cache?


Reply to this email directly or view it on GitHub
#5092 (comment)
.

@XhmikosR
Copy link

I noticed the same thing with bootstrap too BTW.
On Nov 25, 2015 15:26, "XhmikosR" xhmikosr@gmail.com wrote:

Yeah it would seem so.
On Nov 25, 2015 15:25, "Hiro Asari" notifications@github.com wrote:

@XhmikosR https://github.com/XhmikosR Does the build reliably fail if
you keep the cache?


Reply to this email directly or view it on GitHub
#5092 (comment)
.

@BanzaiMan
Copy link
Contributor

What bootstrap?

@XhmikosR
Copy link

The original post is for Bootstrap but I notice the same failures in my other projects too.

cvrebert added a commit to twbs/bootstrap that referenced this issue Nov 26, 2015
Until travis-ci/travis-ci#5092 gets resolved.
A slow build is better than a broken build.
Refs travis-ci/travis-ci#5092 (comment)

[skip sauce]
@cvrebert
Copy link
Author

Judging by https://travis-ci.org/twbs/bootstrap/builds/93292414 , it seems that the problem occurs even if the caching is only of node_modules and not RubyGems.

@RX14
Copy link

RX14 commented Jan 5, 2016

@RX14
Copy link

RX14 commented Jan 5, 2016

Actually, this occurs whether caching is on or not.

BanzaiMan added a commit to travis-ci/travis-build that referenced this issue Dec 6, 2016
Some npm modules define commands with widely used bash functions
(and probably others).
Putting this component in `$PATH` causes subtle issues, such as
travis-ci/travis-ci#5092.
We are removing it, so that this is no longer the case.

This will most likely break some builds, so we add a warning.
@BanzaiMan
Copy link
Contributor

Hello. Our attempt to remove ./node_modules/.bin from $PATH negatively affected many existing builds.

This issue is going to cause pain in non-negligible number of users either way, unfortunately.

@Fire-Dragon-DoL
Copy link

Fire-Dragon-DoL commented Dec 6, 2016

@BanzaiMan It broke many existing builds (based on this bug too) on the other side too, so at least assume the correct default and let people fix it (I personally lost various hours due to unpredicted behavior).

What about providing at least a configuration option to disable this behavior? That would be enough, instead of having to hack around with `,

@BanzaiMan
Copy link
Contributor

See also: #4862.

andymantell added a commit to LandRegistry/land-registry-elements that referenced this issue Jun 6, 2017
@vvo
Copy link

vvo commented Oct 17, 2017

This issue is really long, the tl;dr; is:

There's a way to solve it for you:

before_cache:
  - rm -f ./node_modules/.bin/which # <-- workaround for https://github.com/travis-ci/travis-

@szimek
Copy link

szimek commented Nov 13, 2017

Wouldn't it be possible to add a setting like:

i_do_not_want_all_my_node_modules_binaries_to_be_global_thank_you: true

(or something similar 😉) that would cause ./node_modules/.bin to be not added to PATH? This could become the default behavior e.g. when a new image is released in the future.

There's even npx tool distributed with node (via npm 5.2.0+) to run local binaries: http://blog.npmjs.org/post/162869356040/introducing-npx-an-npm-package-runner, so if anyone depends on the current behavior, it's enough to change e.g. which curl to npx which curl - no need to modify package.json or PATH.

@ankon
Copy link

ankon commented Nov 28, 2017

[An option in .travis.yml] that would cause ./node_modules/.bin to be not added to PATH? This could become the default behavior e.g. when a new image is released in the future.

That would be much appreciated indeed!

@stale
Copy link

stale bot commented Apr 13, 2018

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

@stale stale bot added the stale label Apr 13, 2018
@ankon
Copy link

ankon commented Apr 13, 2018

This problem still exists, and is still as annoying as ever -- please keep it open :)

@stale stale bot removed the stale label Apr 13, 2018
@stale
Copy link

stale bot commented Aug 3, 2018

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 24 hours. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

@stale stale bot added the stale label Aug 3, 2018
@ankon
Copy link

ankon commented Aug 3, 2018

Bot: Can you leave this open and linked to travis-ci/travis-build#1263 please? :)

@stale stale bot removed the stale label Aug 3, 2018
@BanzaiMan BanzaiMan changed the title RVM claims it can't find curl when using node-which RVM claims it can't find curl when using node-which; Node.js builds contain ./node_modules/bin in $PATH Oct 29, 2018
@crequena-babbel
Copy link

As workaround for this bug I'm doing this in the .travis.yml :

PATH="/bin:$PATH" rvm use $(< .ruby-version) --install --binary --fuzzy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests