Jobs failing trying to install jobs

When running a job on a build node the job will fail as the delivery-truck coobook tries to install gems from rubygems.org. Our environment does not have access to the internet so I would like to use an internal gem repository. The chefdk installed on the build node is 1.2.22. The error I recieve is

‘’’

[2017-02-15T10:21:49-05:00] INFO: Run List is [recipe[build_cookbook::default]]
[2017-02-15T10:21:49-05:00] INFO: Run List expands to [build_cookbook::default]
[2017-02-15T10:21:49-05:00] INFO: Starting Chef Run for build-node1.xxx
[2017-02-15T10:21:49-05:00] INFO: Running start handlers
[2017-02-15T10:21:49-05:00] INFO: Start handlers complete.
[2017-02-15T10:21:49-05:00] INFO: HTTP Request Returned 404 Not Found: Object not found:
resolving cookbooks for run list: [“build_cookbook::default”]
[2017-02-15T10:21:49-05:00] INFO: Loading cookbooks [build_cookbook@0.1.0, delivery-truck@2.3.0, delivery-sugar@1.2.1]
Synchronizing Cookbooks:

  • build_cookbook (0.1.0)
  • delivery-truck (2.3.0)
  • delivery-sugar (1.2.1)
    Installing Cookbook Gems:

Running handlers:
[2017-02-15T10:21:50-05:00] ERROR: Running exception handlers
Running handlers complete
[2017-02-15T10:21:50-05:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 03 seconds
[2017-02-15T10:21:50-05:00] FATAL: Stacktrace dumped to /var/opt/delivery/workspace/automate.xxxxx/gse/coe/helloworld/master/build/unit/cache/chef-stacktrace.out
[2017-02-15T10:21:50-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-02-15T10:21:50-05:00] ERROR: Expected process to exit with [0], but received ‘17’
---- Begin output of bundle install ----
STDOUT: Don’t run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching source index from https://rubygems.org/
Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from xhttps://rubygems.org/
Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from xhttps://rubygems.org/
Retrying fetcher due to error (4/4): Bundler::HTTPError Could not fetch specs from xhttps://rubygems.org/
Could not fetch specs from https://rubygems.org/
STDERR:
---- End output of bundle install ----
Ran bundle install returned 17
[2017-02-15T10:21:50-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Chef Client failed
STDOUT:
STDERR:


Job ended at 2017-02-15T10:21:50-05:00 (ran in 8 seconds)
Chef Stacktrace
Generated at 2017-02-15 10:21:50 -0500
Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received ‘17’
---- Begin output of bundle install ----
STDOUT: Don’t run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching source index from xhttps://rubygems.org/
Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from xhttps://rubygems.org/
Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from xhttps://rubygems.org/
Retrying fetcher due to error (4/4): Bundler::HTTPError Could not fetch specs from xhttps://rubygems.org/
Could not fetch specs from xhttps://rubygems.org/
STDERR:
---- End output of bundle install ----
Ran bundle install returned 17
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/mixlib-shellout-2.2.7/lib/mixlib/shellout.rb:289:in invalid!' /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/mixlib-shellout-2.2.7/lib/mixlib/shellout.rb:276:inerror!’
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/mixin/shell_out.rb:99:in shell_out!' /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/cookbook/gem_installer.rb:58:inblock (2 levels) in install’
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/cookbook/gem_installer.rb:50:in open' /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/cookbook/gem_installer.rb:50:inblock in install’
/opt/chefdk/embedded/lib/ruby/2.3.0/tmpdir.rb:89:in mktmpdir' /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/cookbook/gem_installer.rb:49:ininstall’
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/cookbook/cookbook_collection.rb:60:in install_gems' /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/policy_builder/expand_node_object.rb:86:insetup_run_context’
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/client.rb:511:in setup_run_context' /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/client.rb:281:inrun’
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/application.rb:295:in block in fork_chef_client' /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/application.rb:283:infork’
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/application.rb:283:in fork_chef_client' /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/application.rb:248:inblock in run_chef_client’
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/local_mode.rb:44:in with_server_connectivity' /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/application.rb:236:inrun_chef_client’
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/application/client.rb:464:in sleep_then_run_chef_client' /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/application/client.rb:451:inblock in interval_run_chef_client’
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/application/client.rb:450:in loop' /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/application/client.rb:450:ininterval_run_chef_client’
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/application/client.rb:434:in run_application' /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/lib/chef/application.rb:59:inrun’
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31/bin/chef-client:26:in <top (required)>' /opt/chefdk/bin/chef-client:57:inload’
/opt/chefdk/bin/chef-client:57:in `‘
Lint Failed
’’’

Hi there – we have some documentation on using delivery-truck in an air-gapped environment here: https://docs.chef.io/delivery_truck.html#using-delivery-truck-in-air-gapped-environment

Hope that helps!

Cheers,
Megan

I check our private supermarket setting and it is setup as air gapped. The job is failing trying to install a gem from rubygems.org which isn’t indicated in the document.

Solved the issue. The latest delivery-sugar cookbook (1.2.1) was uploaded to our private supermarket and when the build_cookbook was run it would use this version. This version runs bundler to install the chef-vault gem which it tries to download from rubygems.org. The job would fail because the build nodes don’t have access to the internet. I reverted back to an earlier version of delivery-sugar and everything runs without error.

1 Like

I am having the same issue. What version of delivery-sugar did you go to?

delivery-sugar 1.1.3 solved the issue.

1 Like

Awesome, thanks for the reply @Franklin.teney. I can verify that reverting the deliver-sugar cookbook got me past the verify stage in an air-gapped environment as well.