0
votes

I am working on a chef environment with below versions

OS & Version details are as below:

  • Chef Server - RHEL7
  • Chef Workstation - Windows 7 Professional
  • Chef node : Windows 2016 Server Datacenter
  • Chef Development Kit Version: 3.3.23
  • chef-client version: 14.14.25
  • berks version: 7.0.6
  • kitchen version: 1.23.2
  • inspec version: 2.2.112

I am running a chef-client on a node which is configured during initial run installing chef gems failed with below errors.

On checking it was not able to connect to ruby site to install gems, but my server has active internet connection. I got these details from Bundle Install Not Working

Installing Cookbook Gems:

Running handlers:
[2019-10-17T19:09:35+08:00] ERROR: Running exception handlers
Running handlers complete
[2019-10-17T19:09:35+08:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 05 minutes 13 seconds
[2019-10-17T19:09:35+08:00] INFO: Sending resource update report (run-id: 942e7eaa-14c0-487d-8a6c-6d96a49c99ff)
[2019-10-17T19:09:36+08:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
[2019-10-17T19:09:36+08:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2019-10-17T19:09:36+08:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received
 '17'
---- Begin output of bundle install ----
STDOUT: Fetching source index from https://www.rubygems.org/

Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from https://www.rubygems.org/
Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from https://www.rubygems.org/
Retrying fetcher due to error (4/4): Bundler::HTTPError Could not fetch specs from https://www.rubygems.org/
Could not fetch specs from https://www.rubygems.org/
STDERR:
---- End output of bundle install ----
Ran bundle install returned 17 

Can it be DNS issue? I have active internet connection from the server and can land on ruby site manually.

Is there a way I can manually install ruby/cookbook gems?

1

1 Answers

2
votes

Can it be DNS issue? I have active internet connection from the server and can land on ruby site manually.

if you are running chef-client on a node, then what the server has to do with "active internet connection". you should verify that an internet connection is available on the node itself.

Is there a way I can manually install ruby/cookbook gems?

sure you can. if you wish to install a rubygem into chef embedded ruby (same as chef_gem resource), then use gem with chef embedded ruby.

$ /opt/chef/bin/gem install <rubygem-name>

otherwise, you can install it to the ruby system as usuall (same as gem_package resource)

$ gem install <rubygem-name>

i also advise you to run chef-client with debug log level to get more information about the problem

$ chef-client --log_level debug