RVM stable fails to apply railsexpress patches to named ruby 1.9.3-p484 on RHEL 5 #2640

Closed
janwtobi opened this Issue Feb 20, 2014 · 11 comments

Comments

Projects
None yet
3 participants

Having problems installing a ruby, and getting errors applying patches. This issue is specific to RHEL (as in it works locally on my mac os x mavericks laptop & on centos 6).

Here's the full command with output, and it's having problems finding patches (the __rvm_apply_patches fails to expand the curl'ed patches to files in the local filesystem, from what I can tell).

build@store4 ~ -> rvm --debug install ruby-1.9.3-p484 --patch railsexpress -n railsexpress_custom_1
ruby-1.9.3-p484-railsexpress_custom_1 - install
Log prefix: /home/build/.rvm/log/1392924141_ruby-1.9.3-p484-railsexpress_custom_1/
Log filesystem: ext3
Log max name length: 250
Log file: /home/build/.rvm/log/1392924141_ruby-1.9.3-p484-railsexpress_custom_1/remove.src.log
[2014-02-20 11:22:21] __rvm_rm_rf
__rvm_rm_rf () 
{ 
    __rvm_rm_rf_verbose "$@"
}
current path: /home/build
GEM_HOME=/home/build/.rvm/gems/ruby-1.9.3-p484
PATH=/home/build/.rvm/gems/ruby-1.9.3-p484/bin:/home/build/.rvm/gems/ruby-1.9.3-p484@global/bin:/home/build/.rvm/rubies/ruby-1.9.3-p484/bin:/home/build/.rvm/bin:/home/build/stack/pgsql/bin:/home/build/stack/memcache/bin:/home/build/stack/jetty/bin:/home/build/stack/jdk/bin:/usr/local/git/bin:/home/build/stack/ant/bin:/home/build/bin:/home/build/code/system:/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin
GEM_PATH=/home/build/.rvm/gems/ruby-1.9.3-p484:/home/build/.rvm/gems/ruby-1.9.3-p484@global
command(2): __rvm_rm_rf /home/build/.rvm/src/ruby-1.9.3-p484-railsexpress_custom_1
ruby-1.9.3-p484-railsexpress_custom_1 - #removing src.
ruby-1.9.3-p484-railsexpress_custom_1 - #already removed rubies
Free disk space 404021MB, required 240MB.
__rvm_setup_compile_environment_setup ruby-1.9.3-p484-railsexpress_custom_1
rvm_autolibs_flag=4
__rvm_setup_compile_environment_movable_early ruby-1.9.3-p484-railsexpress_custom_1
__rvm_setup_compile_environment_system_early ruby-1.9.3-p484-railsexpress_custom_1
__rvm_setup_compile_environment_requirements ruby-1.9.3-p484-railsexpress_custom_1
Checking requirements for redhat.
requirements code for redhat loaded
requirements lib type set to centos
Found required packages: bash, curl, patch, libyaml-devel, libffi-devel, glibc-headers, gcc-c++, glibc-devel, patch, readline, readline-devel, zlib, zlib-devel, openssl-devel, make, bzip2, autoconf, automake, libtool, bison.
Requirements installation successful.
__rvm_setup_compile_environment_movable ruby-1.9.3-p484-railsexpress_custom_1
__rvm_setup_compile_environment_parse_name ruby-1.9.3-p484-railsexpress_custom_1
__rvm_setup_compile_environment_system ruby-1.9.3-p484-railsexpress_custom_1
__rvm_setup_compile_environment_architectures ruby-1.9.3-p484-railsexpress_custom_1
rvm_architectures(0):.
__rvm_setup_compile_environment_gcc47plus ruby-1.9.3-p484-railsexpress_custom_1
__rvm_setup_compile_environment_bison ruby-1.9.3-p484-railsexpress_custom_1
__rvm_setup_compile_environment_flags_docs ruby-1.9.3-p484-railsexpress_custom_1
__rvm_setup_compile_environment_flags_shared_static ruby-1.9.3-p484-railsexpress_custom_1
__rvm_setup_compile_environment_flags_threads ruby-1.9.3-p484-railsexpress_custom_1
__rvm_setup_compile_environment_compatibility_flag ruby-1.9.3-p484-railsexpress_custom_1
found compiler: /usr/bin/gcc
Installing Ruby from source to: /home/build/.rvm/rubies/ruby-1.9.3-p484-railsexpress_custom_1, this may take a while depending on your cpu(s)...
ruby-1.9.3-p484-railsexpress_custom_1 - #downloading ruby-1.9.3-p484, this may take a while depending on your connection...
Archive checksum matched, not downloading
Downloaded archive checksum matched.
Log file: /home/build/.rvm/log/1392924141_ruby-1.9.3-p484-railsexpress_custom_1/extract.log
[2014-02-20 11:22:22] __rvm_package_extract
__rvm_package_extract () 
{ 
    rvm_debug __rvm_package_extract:$#: "$@";
    typeset __tempdir __path __file __return;
    __return=0;
    __tempdir="$( TMPDIR="${rvm_tmp_path}" mktemp -d -t rvm-tmp.XXXXXXXXX )";
    __rvm_package_extract_run "$1" "$__tempdir" || __return=$?;
    if (( __return == 0 )); then
        for __path in "$__tempdir"/*;
        do
            __file="${__path##*/}";
            if [[ -n "${__file}" && -e "$2/${__file}" ]]; then
                \rm -rf "$2/${__file}" || __return=$?;
            fi;
            \mv -f "${__path}" "$2/" || __return=$?;
        done;
    fi;
    if [[ -n "$__tempdir" ]]; then
        \rm -rf "$__tempdir";
    fi;
    return $__return
}
current path: /home/build/.rvm/src
GEM_HOME=/home/build/.rvm/gems/ruby-1.9.3-p484
PATH=/home/build/.rvm/gems/ruby-1.9.3-p484/bin:/home/build/.rvm/gems/ruby-1.9.3-p484@global/bin:/home/build/.rvm/rubies/ruby-1.9.3-p484/bin:/home/build/.rvm/bin:/home/build/stack/pgsql/bin:/home/build/stack/memcache/bin:/home/build/stack/jetty/bin:/home/build/stack/jdk/bin:/usr/local/git/bin:/home/build/stack/ant/bin:/home/build/bin:/home/build/code/system:/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin
GEM_PATH=/home/build/.rvm/gems/ruby-1.9.3-p484:/home/build/.rvm/gems/ruby-1.9.3-p484@global
command(3): __rvm_package_extract /home/build/.rvm/archives/ruby-1.9.3-p484.tar.bz2 /home/build/.rvm/tmp/rvm_src_24443
ruby-1.9.3-p484-railsexpress_custom_1 - #extracting ruby-1.9.3-p484 to /home/build/.rvm/src/ruby-1.9.3-p484-railsexpress_custom_1.
__rvm_rm_rf already gone: /home/build/.rvm/src/ruby-1.9.3-p484-railsexpress_custom_1
Patch name 'railsexpress', expanded_name(s) 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/01-fix-make-clean.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/02-railsbench-gc.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/03-display-more-detailed-stack-trace.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/04-fork-support-for-gc-logging.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/05-track-live-dataset-size.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/06-webrick_204_304_keep_alive_fix.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/07-export-a-few-more-symbols-for-ruby-prof.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/08-thread-variables.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/09-faster-loading.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/10-falcon-st-opt.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/11-falcon-sparse-array.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/12-falcon-array-queue.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/13-railsbench-gc-fixes.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/14-show-full-backtrace-on-stack-overflow.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/15-configurable-fiber-stack-sizes.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/16-backport-psych-20.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/17-fix-missing-c-return-event.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/18-fix-process-daemon-call.patch'.
Patch name 'default', expanded_name(s) 'GH-488'.
Patch name 'redhat', expanded_name(s) 'ssl_no_ec2m'.
All found patches(20): https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/01-fix-make-clean.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/02-railsbench-gc.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/03-display-more-detailed-stack-trace.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/04-fork-support-for-gc-logging.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/05-track-live-dataset-size.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/06-webrick_204_304_keep_alive_fix.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/07-export-a-few-more-symbols-for-ruby-prof.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/08-thread-variables.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/09-faster-loading.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/10-falcon-st-opt.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/11-falcon-sparse-array.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/12-falcon-array-queue.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/13-railsbench-gc-fixes.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/14-show-full-backtrace-on-stack-overflow.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/15-configurable-fiber-stack-sizes.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/16-backport-psych-20.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/17-fix-missing-c-return-event.patch https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/18-fix-process-daemon-call.patch GH-488 ssl_no_ec2m.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/01-fix-make-clean.patch' not found.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/02-railsbench-gc.patch' not found.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/03-display-more-detailed-stack-trace.patch' not found.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/04-fork-support-for-gc-logging.patch' not found.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/05-track-live-dataset-size.patch' not found.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/06-webrick_204_304_keep_alive_fix.patch' not found.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/07-export-a-few-more-symbols-for-ruby-prof.patch' not found.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/08-thread-variables.patch' not found.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/09-faster-loading.patch' not found.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/10-falcon-st-opt.patch' not found.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/11-falcon-sparse-array.patch' not found.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/12-falcon-array-queue.patch' not found.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/13-railsbench-gc-fixes.patch' not found.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/14-show-full-backtrace-on-stack-overflow.patch' not found.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/15-configurable-fiber-stack-sizes.patch' not found.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/16-backport-psych-20.patch' not found.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/17-fix-missing-c-return-event.patch' not found.
Patch full path ''.
Patch 'https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p484/railsexpress/18-fix-process-daemon-call.patch' not found.
Patch full path '/home/build/.rvm/patches/ruby/GH-488.patch'.
Log file: /home/build/.rvm/log/1392924141_ruby-1.9.3-p484-railsexpress_custom_1/patch.apply.GH-488.log
[2014-02-20 11:22:26] __rvm_patch
__rvm_patch () 
{ 
    \patch "$@" || return $?
}
current path: /home/build/.rvm/src/ruby-1.9.3-p484-railsexpress_custom_1
GEM_HOME=/home/build/.rvm/gems/ruby-1.9.3-p484
PATH=/home/build/.rvm/gems/ruby-1.9.3-p484/bin:/home/build/.rvm/gems/ruby-1.9.3-p484@global/bin:/home/build/.rvm/rubies/ruby-1.9.3-p484/bin:/home/build/.rvm/bin:/home/build/stack/pgsql/bin:/home/build/stack/memcache/bin:/home/build/stack/jetty/bin:/home/build/stack/jdk/bin:/usr/local/git/bin:/home/build/stack/ant/bin:/home/build/bin:/home/build/code/system:/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin
GEM_PATH=/home/build/.rvm/gems/ruby-1.9.3-p484:/home/build/.rvm/gems/ruby-1.9.3-p484@global
command(8): __rvm_patch -F 25 -p1 -N -f -i /home/build/.rvm/patches/ruby/GH-488.patch
ruby-1.9.3-p484-railsexpress_custom_1 - #applying patch /home/build/.rvm/patches/ruby/GH-488.patch.
Patch full path '/home/build/.rvm/patches/ruby/ssl_no_ec2m.patch'.
Log file: /home/build/.rvm/log/1392924141_ruby-1.9.3-p484-railsexpress_custom_1/patch.apply.ssl_no_ec2m.log
[2014-02-20 11:22:26] __rvm_patch
__rvm_patch () 
{ 
    \patch "$@" || return $?
}
current path: /home/build/.rvm/src/ruby-1.9.3-p484-railsexpress_custom_1
GEM_HOME=/home/build/.rvm/gems/ruby-1.9.3-p484
PATH=/home/build/.rvm/gems/ruby-1.9.3-p484/bin:/home/build/.rvm/gems/ruby-1.9.3-p484@global/bin:/home/build/.rvm/rubies/ruby-1.9.3-p484/bin:/home/build/.rvm/bin:/home/build/stack/pgsql/bin:/home/build/stack/memcache/bin:/home/build/stack/jetty/bin:/home/build/stack/jdk/bin:/usr/local/git/bin:/home/build/stack/ant/bin:/home/build/bin:/home/build/code/system:/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin
GEM_PATH=/home/build/.rvm/gems/ruby-1.9.3-p484:/home/build/.rvm/gems/ruby-1.9.3-p484@global
command(8): __rvm_patch -F 25 -p1 -N -f -i /home/build/.rvm/patches/ruby/ssl_no_ec2m.patch
ruby-1.9.3-p484-railsexpress_custom_1 - #applying patch /home/build/.rvm/patches/ruby/ssl_no_ec2m.patch.
There has been an error applying the specified patches. Halting the installation.
__rvm_rm_rf already gone: /home/build/.rvm/tmp/24443*
Owner

mpapis commented Feb 20, 2014

what is in the log file: /home/build/.rvm/log/1392924141_ruby-1.9.3-p484-railsexpress_custom_1/patch.apply.ssl_no_ec2m.log

Here's what's there:

[2014-02-20 11:22:26] __rvm_patch
__rvm_patch () 
{ 
    \patch "$@" || return $?
}
current path: /home/build/.rvm/src/ruby-1.9.3-p484-railsexpress_custom_1
GEM_HOME=/home/build/.rvm/gems/ruby-1.9.3-p484
PATH=/home/build/.rvm/gems/ruby-1.9.3-p484/bin:/home/build/.rvm/gems/ruby-1.9.3-p484@global/bin:/home/build/.rvm/rubies/ruby-1.9.3-p484/bin:/home/build/.rvm/bin:/home/build/stack/pgsql/bin:/home/build/stack/memcache/bin:/home/build/stack/jetty/bin:/home/build/stack/jdk/bin:/usr/local/git/bin:/home/build/stack/ant/bin:/home/build/bin:/home/build/code/system:/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin
GEM_PATH=/home/build/.rvm/gems/ruby-1.9.3-p484:/home/build/.rvm/gems/ruby-1.9.3-p484@global
command(8): __rvm_patch -F 25 -p1 -N -f -i /home/build/.rvm/patches/ruby/ssl_no_ec2m.patch
patching file ext/openssl/ossl_pkey_ec.c
Hunk #1 succeeded at 758 with fuzz 3 (offset -4 lines).
Hunk #2 succeeded at 821 with fuzz 3 (offset 2 lines).

A few hours and digging way into the internals of RVM, we've found the problem. Its really not specific to RHEL but really about curl, an oddity in how curl handles flags, and how RVM interacts with curl.

We hand edited the --fail flag out of how RVM was invoking curl and the answer started to materialize quickly. Turns out curl is a bit weird with the --insecure flag, if you set it twice its the same as not setting it (counter intuitive, but it is actually vaguely mentioned in the man page). RVM explicitly sets this flag, but it was also set in the users .curlrc. So curl was would run into an SSL issue, stop, and because the --fail flag was set it would fail silently.

Owner

mpapis commented Feb 20, 2014

as much as I would suggest updating certificates instead of using the insecure flag it is a fail on rvm side, we should either return a better message about what failed - or even better handle the ssl issue and fallback to retrying without the flag, do you remember the file / line where the curl was invoked? are you interested in writing a patch or should I do it?

@mpapis mpapis removed the feedback needed label Feb 20, 2014

@mpapis mpapis added this to the rvm 1.25 milestone Feb 20, 2014

I'll put together a patch, or two.

  1. curl shouldn't have the --fail flag when RVM is using --debug or --trace
  2. I'll see if theres anything I can do to detect if curl is already in insecure mode.

Nice! Thanks for all the help with this.

Owner

mpapis commented Feb 20, 2014

there is only one place we use --insecure - checking if remote file exist and it is required there as a bit later we will download that file and should fail with a proper error message - but in this place we can add extra check for status 60 - this means certificate issues - and we should not have those here as we used the --insecure flag - this would be the duplicate case, next retry without the flag + warning about the insecure in .curlrc should solve this problem

Owner

mpapis commented Feb 27, 2014

any progress on it? or should I fix it?

@mpapis This uses logic and messaging from scripts/fetch, but does not retry. Would you rather have a retry in here?

Owner

mpapis commented Feb 28, 2014

I would prefer to keep the --insecure as default and do a retry without it in the case of getting 60, it is desired to postpone the warning from this point to later on, having it in here might have side effects on other code, this function is intended to check only if a file exist on server, not the status of server certificates.

@mpapis mpapis closed this in 613c940 Mar 7, 2014

@mpapis mpapis removed the feedback needed label Mar 7, 2014

Owner

mpapis commented Mar 7, 2014

please try again after rvm get head

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