rackspace-cookbooks / platformstack

Rackspace Base Stack via Chef
Other
4 stars 6 forks source link

rest-client installation breaking chef-run #195

Closed kgeorgak closed 9 years ago

kgeorgak commented 9 years ago

We have stumbled across the following issue: without any change to our base code or the version of upstream cookbooks we depend the chef run started breaking on the 24/04/2015:

         * chef_gem[rest-client] action install

           ================================================================================
           Error executing action `install` on resource 'chef_gem[rest-client]'
           ================================================================================

           Mixlib::ShellOut::ShellCommandFailed
           ------------------------------------
           Expected process to exit with [0], but received '1'
           ---- Begin output of /opt/chef/embedded/bin/gem install rest-client -q --no-rdoc --no-ri -v "1.8.0" ----
           STDOUT: Building native extensions.  This could take a while...
           STDERR: ERROR:  Error installing rest-client:
                ERROR: Failed to build gem native extension.

        /opt/chef/embedded/bin/ruby -r ./siteconf20150325-7069-hmrtsk.rb extconf.rb
           checking for main() in -lstdc++... *** extconf.rb failed ***
           Could not create Makefile due to some reason, probably lack of necessary
           libraries and/or headers.  Check the mkmf.log file for more details.  You may
           need configuration options.

           Provided configuration options:
                --with-opt-dir
                --with-opt-include
                --without-opt-include=${opt-dir}/include
                --with-opt-lib
                --without-opt-lib=${opt-dir}/lib
                --with-make-prog
                --without-make-prog
                --srcdir=.
                --curdir
                --ruby=/opt/chef/embedded/bin/ruby
                --with-stdc++lib
                --without-stdc++lib
           /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
           You have to install development tools first.
                from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:552:in `try_link0'
                from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:567:in `try_link'
                from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:753:in `try_func'
                from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:984:in `block in have_library'
                from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:929:in `block in checking_for'
                from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
                from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:321:in `open'
                from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
                from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:321:in `open'
                from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
                from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:928:in `checking_for'
                from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:979:in `have_library'
                from extconf.rb:2:in `<main>'

           extconf failed, exit code 1

           Gem files will remain installed in /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/unf_ext-0.0.6 for inspection.
           Results logged to /opt/chef/embedded/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/unf_ext-0.0.6/gem_make.out
           ---- End output of /opt/chef/embedded/bin/gem install rest-client -q --no-rdoc --no-ri -v "1.8.0" ----
           Ran /opt/chef/embedded/bin/gem install rest-client -q --no-rdoc --no-ri -v "1.8.0" returned 1

           Cookbook Trace:
           ---------------
           /tmp/kitchen/cache/cookbooks/platformstack/recipes/public_info.rb:14:in `from_file'
           /tmp/kitchen/cache/cookbooks/platformstack/recipes/rackops_rolebook.rb:21:in `block in from_file'
           /tmp/kitchen/cache/cookbooks/platformstack/recipes/rackops_rolebook.rb:20:in `each'
           /tmp/kitchen/cache/cookbooks/platformstack/recipes/rackops_rolebook.rb:20:in `from_file'
           /tmp/kitchen/cache/cookbooks/repo_app/recipes/default.rb:33:in `from_file'

           Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cache/cookbooks/platformstack/recipes/public_info.rb

            12: chef_gem 'rest-client' do
            13:   action :nothing
            14: end.run_action(:install)
            15: 
            16: # Load the ohai recipe to populate node['ohai']
            17: include_recipe 'ohai'
            18: 
            19: # Fail in a slightly more descriptive manner than the directory block below
            20: #  if the plugin directory is unset.
            21: if node['ohai'] && node['ohai']['plugin_path'].nil?
            22:   fail 'ERROR: Ohai plugin path not set'
            23: end
            24: 

This seems to happen only on Centos images. If you log in to the test box and manually do a "groupinstall" of "Development Tools" and "Development Libraries" the issue goes away however I couldn't find a way of installing these groups of packages before the rest-client installation (even if the package installation is the first thing on my recipe).

I am using platformstack 3.0.4. I can see that the repo version of platformstack has removed the rest-client installation but hasn't bumped the version yet. The supermarket version (which I am using) still has the rest-client installation.

I guess that a way to go around it for now will be to get platformstack from the repo (haven't tried it yet) however I thought I should raise this in case the issue indicates the need to push a newer version to sm sooner?

As to why this suddenly started happening I assume that something changed in the rest-client that required compilation?

martinb3 commented 9 years ago

Thank you for reporting this. To elaborate a bit, this is CentOS 6.5? Can you supply the cloud image ID that was used to build the server that fails?

kgeorgak commented 9 years ago

This was failing with Vagrant and RS cloud alike. The version of CentOS was 6.5 and the image ID was 68d5cc64-cb68-4275-9ede-9b062f7be070

martinb3 commented 9 years ago

I've released v3.1.0 of platformstack so that this may be worked around. Thank you!