Search code examples
amazon-web-servicesrubygemschef-infrachef-recipe

Error installing aws-sigv4 (1.0.2) via aws cookbook 7.2.1


I'm trying to use the aws cookbook version 7.2.1 so I can make use of the named_iam_capability option to the cloudformation_stack resource. This is so I can assign an IAM role to my instances that get launched. This is running on Ubuntu 14.04 LTS with Chef 12.19.36 but I get the below error.

Any ideas how I can fix this error?

31-Oct-2017 10:47:14    [2017-10-30T23:47:14+00:00] ERROR: Running exception handlers
31-Oct-2017 10:47:14    [2017-10-30T23:47:14+00:00] ERROR: Exception handlers complete
31-Oct-2017 10:47:14    [2017-10-30T23:47:14+00:00] FATAL: Stacktrace dumped to /home/bamboo/.chef/cache/chef-stacktrace.out
31-Oct-2017 10:47:14    [2017-10-30T23:47:14+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
31-Oct-2017 10:47:14    [2017-10-30T23:47:14+00:00] ERROR: Expected process to exit with [0], but received '5'
31-Oct-2017 10:47:14    ---- Begin output of bundle install ----
31-Oct-2017 10:47:14    STDOUT: Fetching gem metadata from https://rubygems.org/
31-Oct-2017 10:47:14    Fetching version metadata from https://rubygems.org/
31-Oct-2017 10:47:14    Resolving dependencies...
31-Oct-2017 10:47:14    
31-Oct-2017 10:47:14    Bundler::GemspecError: Could not read gem at /opt/chefdk/embedded/lib/ruby/gems/2.3.0/cache/aws-sigv4-1.0.2.gem. It may be corrupted.
31-Oct-2017 10:47:14    Using jmespath 1.3.1
31-Oct-2017 10:47:14    Using bundler 1.12.5
31-Oct-2017 10:47:14    An error occurred while installing aws-sigv4 (1.0.2), and Bundler cannot
31-Oct-2017 10:47:14    continue.
31-Oct-2017 10:47:14    Make sure that `gem install aws-sigv4 -v '1.0.2'` succeeds before bundling.
31-Oct-2017 10:47:14    STDERR: sudo: no tty present and no askpass program specified
31-Oct-2017 10:47:14    sudo: no tty present and no askpass program specified
31-Oct-2017 10:47:14    ---- End output of bundle install ----
31-Oct-2017 10:47:14    Ran bundle install returned 5
31-Oct-2017 10:47:14    [2017-10-30T23:47:14+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Solution

  • You need to run chef-client as root for some features to work correctly, including gem installs. Use sudo chef-client on most Linux-y systems.