cc_chef fails when using 'gems' installer because Ubuntu 16.04 no longer includes Ruby 1.8

Bug #1583841 reported by Katherine Rossiter on 2016-05-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
High
Jon Grimm
cloud-init (Ubuntu)
High
Unassigned

Bug Description

Ubuntu 16.04

# dpkg -l | grep cloud-init
ii cloud-init 0.7.7~bzr1212-0ubuntu1 all Init scripts for cloud instances
ii cloud-initramfs-copymods 0.27ubuntu1 all copy initramfs modules into root filesystem for later use
ii cloud-initramfs-dyn-netconf 0.27ubuntu1 all write a network interface file in /run for BOOTIF

Minimum Ruby version supported in Ubuntu 16.04 is Ruby 2.3.

Syslog output:

May 19 23:41:38 ubuntu [CLOUDINIT] util.py[DEBUG]: apt-update [eatmydata apt-get --option=Dpkg::Options::=--force-confold --option=Dpkg::options::=--force-unsafe-io --assume-yes --quiet update] took 20.50
1 seconds
May 19 23:41:38 ubuntu [CLOUDINIT] util.py[DEBUG]: Running command ['eatmydata', 'apt-get', '--option=Dpkg::Options::=--force-confold', '--option=Dpkg::options::=--force-unsafe-io', '--assume-yes', '--qui
et', 'install', 'ruby1.8', 'ruby1.8-dev', 'libopenssl-ruby1.8', 'rubygems1.8'] with allowed return codes [0] (shell=False, capture=False)
May 19 23:41:39 ubuntu [CLOUDINIT] util.py[DEBUG]: apt-install [eatmydata apt-get --option=Dpkg::Options::=--force-confold --option=Dpkg::options::=--force-unsafe-io --assume-yes --quiet install ruby1.8 r
uby1.8-dev libopenssl-ruby1.8 rubygems1.8] took 0.295 seconds
May 19 23:41:39 ubuntu [CLOUDINIT] handlers.py[DEBUG]: finish: modules-config/config-chef: FAIL: running config-chef with frequency once-per-instance
May 19 23:41:39 ubuntu [CLOUDINIT] util.py[WARNING]: Running module chef (<module 'cloudinit.config.cc_chef' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_chef.py'>) failed
May 19 23:41:39 ubuntu [CLOUDINIT] util.py[DEBUG]: Running module chef (<module 'cloudinit.config.cc_chef' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_chef.py'>) failed#012Traceback (most rec
ent call last):#012 File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 739, in _run_modules#012 freq=freq)#012 File "/usr/lib/python3/dist-packages/cloudinit/cloud.py", line 70, in run#0
12 return self._runners.run(name, functor, args, freq, clear_on_fail)#012 File "/usr/lib/python3/dist-packages/cloudinit/helpers.py", line 199, in run#012 results = functor(*args)#012 File "/usr/l
ib/python3/dist-packages/cloudinit/config/cc_chef.py", line 257, in handle#012 run = install_chef(cloud, chef_cfg, log)#012 File "/usr/lib/python3/dist-packages/cloudinit/config/cc_chef.py", line 296,
 in install_chef#012 install_chef_from_gems(ruby_version, chef_version, cloud.distro)#012 File "/usr/lib/python3/dist-packages/cloudinit/config/cc_chef.py", line 330, in install_chef_from_gems#012
distro.install_packages(get_ruby_packages(ruby_version))#012 File "/usr/lib/python3/dist-packages/cloudinit/distros/debian.py", line 75, in install_packages#012 self.package_command('install', pkgs=pk
glist)#012 File "/usr/lib/python3/dist-packages/cloudinit/distros/debian.py", line 176, in package_command#012 args=(cmd,), kwargs={'env': e, 'capture': False})#012 File "/usr/lib/python3/dist-packag
es/cloudinit/util.py", line 2040, in log_time#012 ret = func(*args, **kwargs)#012 File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 1704, in subp#012 cmd=args)#012cloudinit.util.Process
ExecutionError: Unexpected error while running command.#012Command: ['eatmydata', 'apt-get', '--option=Dpkg::Options::=--force-confold', '--option=Dpkg::options::=--force-unsafe-io', '--assume-yes', '--qu
iet', 'install', 'ruby1.8', 'ruby1.8-dev', 'libopenssl-ruby1.8', 'rubygems1.8']#012Exit code: 100#012Reason: -#012Stdout: ''#012Stderr: ''

# apt-cache policy ruby
ruby:
  Installed: (none)
  Candidate: 1:2.3.0+1
  Version table:
     1:2.3.0+1 500
        500 http://us-west-2.ec2.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

# apt-cache search ^ruby
rake - ruby make-like utility
ruby - Interpreter of object-oriented scripting language Ruby (default version)
ruby-all-dev - Ruby development environment (all versions supported in Debian)
ruby-dev - Header files for compiling extension modules for Ruby (default version)
ruby-did-you-mean - smart error messages for Ruby > 2.3
ruby-minitest - Ruby test tools supporting TDD, BDD, mocking, and benchmarking
ruby-net-telnet - telnet client library
ruby-power-assert - library showing values of variables and method calls in an expression
ruby-rrd - time-series data storage and display system (Ruby interfaces)
ruby-test-unit - unit testing framework for Ruby
ruby2.3 - Interpreter of object-oriented scripting language Ruby
ruby2.3-dev - Header files for compiling extension modules for the Ruby 2.3
ruby2.3-doc - Documentation for Ruby 2.3

Scott Moser (smoser) on 2016-06-03
Changed in cloud-init:
status: New → Confirmed
Changed in cloud-init (Ubuntu):
status: New → Confirmed
Changed in cloud-init:
importance: Undecided → High
Changed in cloud-init (Ubuntu):
importance: Undecided → High
Jon Grimm (jgrimm) on 2017-03-31
Changed in cloud-init:
assignee: nobody → Jon Grimm (jgrimm)
Jon Grimm (jgrimm) wrote :

Reproduced. Unfortunately, there's probably not a workaround in setting just setting (undocumented) 'ruby_version' in the config, as it seems to now require 'gcc' and possibly make as additional packages. I'd like to find someway to make this a bit less fragile to breaking, it would also be nice to make this work on debian and fedoras, but that'll probably have to wait for another day as I'd like to get things back to working state.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers