我正在尝试使用aws cookbook版本7.2.1,因此我可以使用cloudformation_stack资源的named_iam_capability选项。这样我就可以为启动的实例分配IAM角色。这是在Ubuntu 14.04 LTS和Chef 12.19.36上运行的,但我收到以下错误。
我有什么想法可以解决这个错误吗?
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)
答案 0 :(得分:0)
您需要以root身份运行chef-client
才能使某些功能正常工作,包括gem安装。在大多数Linux-y系统上使用sudo chef-client
。