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

Bug #1583841 reported by Katherine Rossiter
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Jon Grimm
cloud-init (Ubuntu)

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][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][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][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][DEBUG]: finish: modules-config/config-chef: FAIL: running config-chef with frequency once-per-instance
May 19 23:41:39 ubuntu [CLOUDINIT][WARNING]: Running module chef (<module 'cloudinit.config.cc_chef' from '/usr/lib/python3/dist-packages/cloudinit/config/'>) failed
May 19 23:41:39 ubuntu [CLOUDINIT][DEBUG]: Running module chef (<module 'cloudinit.config.cc_chef' from '/usr/lib/python3/dist-packages/cloudinit/config/'>) failed#012Traceback (most rec
ent call last):#012 File "/usr/lib/python3/dist-packages/cloudinit/", line 739, in _run_modules#012 freq=freq)#012 File "/usr/lib/python3/dist-packages/cloudinit/", line 70, in run#0
12 return, functor, args, freq, clear_on_fail)#012 File "/usr/lib/python3/dist-packages/cloudinit/", line 199, in run#012 results = functor(*args)#012 File "/usr/l
ib/python3/dist-packages/cloudinit/config/", line 257, in handle#012 run = install_chef(cloud, chef_cfg, log)#012 File "/usr/lib/python3/dist-packages/cloudinit/config/", 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/", 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/", line 75, in install_packages#012 self.package_command('install', pkgs=pk
glist)#012 File "/usr/lib/python3/dist-packages/cloudinit/distros/", line 176, in package_command#012 args=(cmd,), kwargs={'env': e, 'capture': False})#012 File "/usr/lib/python3/dist-packag
es/cloudinit/", line 2040, in log_time#012 ret = func(*args, **kwargs)#012 File "/usr/lib/python3/dist-packages/cloudinit/", 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
  Installed: (none)
  Candidate: 1:2.3.0+1
  Version table:
     1:2.3.0+1 500
        500 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

Tags: chef ruby
Scott Moser (smoser)
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)
Changed in cloud-init:
assignee: nobody → Jon Grimm (jgrimm)
Revision history for this message
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  
Everyone can see this information.

Other bug subscribers