shedd / duckpan-vagrant

Vagrant + Chef virtual development environment for DuckDuckGo (http://duckduckhack.com)
Apache License 2.0
5 stars 5 forks source link

Cache dependencies #13

Open shedd opened 10 years ago

shedd commented 10 years ago

An issue with Module::Data (http://cpansearch.perl.org/src/KENTNL/Module-Data-0.007/Changes) blocked successful creation of the Vagrant environment. This was initially difficult to diagnose - it presented itself as a generic Chef error:

[2013-11-20T06:18:55+00:00] DEBUG: Re-raising exception: TypeError - can't convert nil into String
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/formatters/error_inspectors/resource_failure_inspector.rb:96:in `+'
  /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/formatters/error_inspectors/resource_failure_inspector.rb:96:in `format_line'
  /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/formatters/error_inspectors/resource_failure_inspector.rb:70:in `recipe_snippet'
  /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/formatters/error_inspectors/resource_failure_inspector.rb:63:in `loop'
  /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/formatters/error_inspectors/resource_failure_inspector.rb:63:in `recipe_snippet'
  /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/formatters/error_inspectors/resource_failure_inspector.rb:43:in `add_explanation'
  /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/formatters/error_mapper.rb:72:in `resource_failed'
  /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/formatters/base.rb:157:in `resource_failed'
  /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/event_dispatch/dispatcher.rb:29:in `resource_failed'
  /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/event_dispatch/dispatcher.rb:29:in `each'
  /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/event_dispatch/dispatcher.rb:29:in `resource_failed'

Only by patching Chef to avoid the nil error were we able to see that the issue was in fact an error with Module::Data:

! Installing Module::Data failed. See /home/vagrant/.cpanm/work/1384929078.27801/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Module 'Module::Data' is not installed
! Bailing out the installation for App-DuckPAN-0.132.
---- End output of su -l vagrant -c 'bash -l -i -c "perl duckpan-install.pl"' ----
Ran su -l vagrant -c 'bash -l -i -c "perl duckpan-install.pl"' returned 1

Need to look into caching or otherwise stabilizing the dependencies for the environment to avoid these types of intermittant failures.