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/scripts/hook: line 17: rvm_hooks_path: unbound variable #3902

Closed
ifelsefi opened this issue Feb 3, 2017 · 1 comment
Closed

~/.rvm/scripts/hook: line 17: rvm_hooks_path: unbound variable #3902

ifelsefi opened this issue Feb 3, 2017 · 1 comment

Comments

@ifelsefi
Copy link

ifelsefi commented Feb 3, 2017

Description

We are sequencing genomes, for the purpose of understanding the causes of various terminal diseases, using a custom ruby-based pipeline of software with RVM 1.25.28 and ruby 1.9.3p448. RVM, ruby, and all other dependencies, exist on a NFS-exported home directory across a group of servers. We can run our pipeline successfully on the older RHEL 6.3 servers. I built a new CentOS 6.8 server where we cannot now run the pipeline. When we have "set -o nounset" included on this Centos 6.8 server, it dies immediately with the error:

/home/aladdin/.rvm/scripts/hook: line 17: rvm_hooks_path: unbound variable

However jobs run successfully on the older RHEL 6.3 server with that option in place.

Though they do run on the CentOS 6.8 server with that option removed...

Do you have any idea on case given RVM, ruby, bash, and all other dependencies are the same across these servers given the shared NFS directory?

Steps to reproduce

CentOS release 6.8 (Final)
2.6.32-642.13.1.el6.x86_64

  1. qsub file which calls ruby
  2. immediate crash shown below

aladdin@epicore07 scratch001 $ cat /home/aladdin/.rvm/scripts/hook

#!/usr/bin/env bash

# need additional step to not redefine variables value if already set
typeset old_rvm_verbose_flag old_rvm_debug_flag >/dev/null 2>/dev/null
old_rvm_verbose_flag=${rvm_verbose_flag:-0}
old_rvm_debug_flag=${rvm_debug_flag:-0}

# silence Zsh redefinitions
typeset rvm_verbose_flag rvm_debug_flag hooks >/dev/null 2>/dev/null

true rvm_verbose_flag:${rvm_verbose_flag:=${old_rvm_verbose_flag}} \
  rvm_debug_flag:${rvm_debug_flag:=${old_rvm_debug_flag}} rvm_hook:${rvm_hook:=}

if
  [[ -n "$rvm_hook" ]]
then
  hooks=( "$rvm_hooks_path")
  [[ "$PWD/.rvm/hooks" == "$rvm_hooks_path" ]] || <------ LINE17 HERE
    hooks+=( "$PWD/.rvm/hooks" )

  _hooks_list=($(
    __rvm_find -L "${hooks[@]}" -iname "$rvm_hook*" -type f 2>/dev/null
  ))

  for hook in "${_hooks_list[@]}"
  do
    if [[ -x "${hook}" || "${hook##*/}" == "$rvm_hook" ]]
    then
      rvm_debug "Running $hook"
      __rvm_conditionally_do_with_env . "${hook}" >&2
    fi
  done
fi

In ~/.rvm/scripts/initialize I see:

 case "$rvm_path" in
    (/usr/local/rvm)         rvm_user_install_flag=0 ;;
    ($HOME/*|/${USER// /_}*) rvm_user_install_flag=1 ;;
    (*)                      rvm_user_install_flag=0 ;;
  esac

  : \
    rvm_bin_path:${rvm_bin_path:="$rvm_path/bin"} \
    rvm_man_path:${rvm_man_path:="$rvm_path/share/man"} \
    rvm_archives_path:${rvm_archives_path:="$rvm_path/archives"} \
    rvm_docs_path:${rvm_docs_path:="$rvm_path/docs"} \
    rvm_environments_path:${rvm_environments_path:="$rvm_path/environments"} \
    rvm_examples_path:${rvm_examples_path:="$rvm_path/examples"} \
    rvm_gems_path:${rvm_gems_path:="$rvm_path/gems"} \
    rvm_gemsets_path:${rvm_gemsets_path:="$rvm_path/gemsets"} \
    rvm_help_path:${rvm_help_path:="$rvm_path/help"} \
    rvm_docs_path:${rvm_docs_path:="$rvm_path/docs"} \
    rvm_hooks_path:${rvm_hooks_path:="$rvm_path/hooks"} \

 export rvm_action rvm_alias_expanded rvm_archive_extension rvm_archives_path rvm_bin_flag rvm_bin_path rvm_debug_flag rvm_default_flag rvm_delete_flag rvm_docs_path rvm_docs_type rvm_dump_environment_flag rvm_environments_path rvm_error_message rvm_examples_path rvm_expanding_aliases rvm_file_name rvm_gemdir_flag rvm_gems_cache_path rvm_gems_path rvm_gemset_name rvm_gemset_separator rvm_gemsets_path rvm_gemstone_package_file rvm_gemstone_url rvm_head_flag rvm_help_path rvm_docs_path rvm_hook rvm_hooks_path

So why unbound?

Expected behavior

The jobs run in SGE

Actual behavior

Immediate crash

Environment info

aladdin@epicore07 scratch001 $ rvm info

ruby-1.9.3-p448:

  system:
    uname:       "Linux epicore07.pbtech 2.6.32-642.13.1.el6.x86_64 #1 SMP Wed Jan 11 20:56:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux"
    system:      "centos/6/x86_64"
    bash:        "/bin/bash => GNU bash, version 4.1.2(2)-release (x86_64-redhat-linux-gnu)"
    zsh:         "/bin/zsh => zsh 4.3.11 (x86_64-redhat-linux-gnu)"

  rvm:
    version:      "rvm 1.25.28 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "2 years 4 months 30 days 22 hours 16 minutes 12 seconds ago"
    path:         "/home/aladdin/.rvm"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.3p448"
    date:         "2013-06-27"
    platform:     "x86_64-linux"
    patchlevel:   "2013-06-27 revision 41675"
    full_version: "ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux]"

  homes:
    gem:          "/home/aladdin/.rvm/gems/ruby-1.9.3-p448"
    ruby:         "/home/aladdin/.rvm/rubies/ruby-1.9.3-p448"

  binaries:
    ruby:         "/home/aladdin/.rvm/rubies/ruby-1.9.3-p448/bin/ruby"
    irb:          "/home/aladdin/.rvm/rubies/ruby-1.9.3-p448/bin/irb"
    gem:          "/home/aladdin/.rvm/rubies/ruby-1.9.3-p448/bin/gem"
    rake:         "/home/aladdin/.rvm/gems/ruby-1.9.3-p448@global/bin/rake"

  environment:
    PATH:         "/home/aladdin/.rvm/gems/ruby-1.9.3-p448/bin:/home/aladdin/.rvm/gems/ruby-1.9.3-p448@global/bin:/home/aladdin/.rvm/rubies/ruby-1.9.3-p448/bin:/home/aladdin/.rvm/bin:/softlib/exe/i686/pkg/sybyl/7.3/dist/trigo:/softlib/exe/i686/pkg/oracle_client/11.1.0.6/dist/oracle/product/11.1.0/client_1/bin:/softlib/exe/x86_64/pkg/ifort/9.1.039/dist/bin:/softlib/exe/x86_64/pkg/icc/9.1.044/dist/bin:/softlib/exe/panda/bin:/softlib/exe/x86_64/bin:/softlib/exe/i686/bin:/softlib/exe/linux/bin:/softlib/exe/all/bin:/opt/sge/bin/lx24-amd64:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:/home/aladdin/.rvm/bin:/home/aladdin/bin"
    GEM_HOME:     "/home/aladdin/.rvm/gems/ruby-1.9.3-p448"
    GEM_PATH:     "/home/aladdin/.rvm/gems/ruby-1.9.3-p448:/home/aladdin/.rvm/gems/ruby-1.9.3-p448@global"
    MY_RUBY_HOME: "/home/aladdin/.rvm/rubies/ruby-1.9.3-p448"
    IRBRC:        "/home/aladdin/.rvm/rubies/ruby-1.9.3-p448/.irbrc"
    RUBYOPT:      ""
    gemset:       ""

aladdin@epicore07 scratch001 $ rvm requirements run

Checking requirements for centos.
Requirements installation successful.
@mpapis
Copy link
Member

mpapis commented Feb 12, 2017

please check with:

rvm get branch /bugfix/3902_ensure_rvm_hooks_path_exists

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

3 participants