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 1.29.8 throwing "_system_name: unbound variable" error on AWS under Packer #4694

Open
rnhurt opened this issue May 14, 2019 · 4 comments

Comments

@rnhurt
Copy link

rnhurt commented May 14, 2019

Description

RVM suddenly started throwing an "unbound variable" error while trying to install and use Ruby 2.3.4 on Amazon Linux. We first noticed the problem on May 8, 2019 and I believe it might be related to the latest RVM release. Ruby installs properly but when we try to "use" it (rvm --default use 2.3.4) we get this error.

Steps to reproduce

We are using Packer to build AWS images with RVM and Ruby 2.3.4 installed. Our process runs from a Jenkins job and has been working fine every Sunday for the past couple of years. During the course of building a new Jenkins environment last week we discovered that the Packer process was failing with a _system_name: unbound variable error and we thought it was something that we had done wrong. Investigating a bit more, we discovered that our latest Sunday job had failed in the same way.

  1. Configure Packer on AWS
  2. Install the latest RVM (on Packer on AWS)
  3. Install Ruby 2.3.4 with openSSL (yes | rvm install ruby-2.3.4 -- --with-openssl-dir=/etc/pki/tls
  4. Use the newly installed Ruby 2.3.4
  5. Get an unbound variable error

Expected behavior

We expected to see Ruby install and our Packer process continue as normal.

Actual behavior

The actual behavior was an error that we are able to replicate using 2 different AWS accounts and Jenkins instances.

https://gist.github.com/rnhurt/0363630689f2d2d3a94fb8903c2c6bc8
Here's a Gist that shows the bash script that we are running inside Packer and the output from Jenkins. The Jenkins DEBUG flag is turned on and shows the complete stack dump from RVM.

@rnhurt rnhurt changed the title /usr/local/rvm/scripts/functions/support: line 182: _system_name: unbound variable RVM 1.29.8 throwing "_system_name: unbound variable" error on AWS under Packer May 20, 2019
@rnhurt
Copy link
Author

rnhurt commented Jun 6, 2019

Rolling back to a previous RVM version (v1.29.7) seems to solve the problem.

@danie1Lin
Copy link

rollback to v1.29.7 still have problem

@danie1Lin
Copy link

danie1Lin commented Dec 26, 2020

I found that my script has set -u , so it will fail on executing rvm script.
if you really want to use set -u, you can wrap your script like this:

YOUR OTHER SCRIPT ...

set +u
YOUR SCRIPT RUN rvm
set -u

YOUR OTHER SCRIPT ...

@jakerobb
Copy link

jakerobb commented Jan 10, 2023

I encountered this too, using 1.29.12-next. It'd be nice if RVM's scripts could be updated such that they don't depend on undefined variables!

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

No branches or pull requests

3 participants