大厨验证错误无效!':预期进程退出[0],但收到'1'

时间:2016-02-26 07:08:30

标签: chef

在运行厨师验证时出错

Running verification for component 'berkshelf'
Running verification for component 'test-kitchen'
Running verification for component 'tk-policyfile-provisioner'
Running verification for component 'chef-client'
Running verification for component 'chef-dk'
Running verification for component 'chef-provisioning'
Running verification for component 'chefspec'
Running verification for component 'generated-cookbooks-pass-chefspec'
Running verification for component 'rubocop'
Running verification for component 'fauxhai'
Running verification for component 'knife-spork'
Running verification for component 'kitchen-vagrant'
Running verification for component 'package installation'
Running verification for component 'openssl'
Running verification for component 'inspec'
................./opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.2.6/lib/mixlib/shellout.rb:289:in `invalid!': Expected process to exit with [0], but received '1' (Mixlib::ShellOut::ShellCommandFailed)
---- Begin output of /usr/local/bin/ohai -v ----
STDOUT: 
STDERR: /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'chef-config' (= 12.8.0) - did find: [chef-config-12.7.2] (Gem::LoadError)
Checked in 'GEM_PATH=/Users/saddam/.chefdk/gem/ruby/2.1.0:/opt/chefdk/embedded/lib/ruby/gems/2.1.0', execute `gem env` for more information
from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:328:in `to_spec'
from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
from /usr/local/bin/ohai:4:in `<main>'
---- End output of /usr/local/bin/ohai -v ----
Ran /usr/local/bin/ohai -v returned 1
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.2.6/lib/mixlib/shellout.rb:276:in `error!'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-dk-0.11.2/lib/chef-dk/component_test.rb:99:in `block in sh!'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-dk-0.11.2/lib/chef-dk/component_test.rb:99:in `tap'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-dk-0.11.2/lib/chef-dk/component_test.rb:99:in `sh!'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-dk-0.11.2/lib/chef-dk/command/verify.rb:358:in `block (2 levels) in <class:Verify>'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-dk-0.11.2/lib/chef-dk/component_test.rb:78:in `instance_eval'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-dk-0.11.2/lib/chef-dk/component_test.rb:78:in `run_smoke_test'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-dk-0.11.2/lib/chef-dk/command/verify.rb:475:in `block (2 levels) in invoke_tests'

我想在最新版本的2.2.3中添加一个我安装ruby的东西

3 个答案:

答案 0 :(得分:3)

似乎当前的Omnibus安装程序捆绑了(或期望)错误版本的chef-config。

更复杂的是,chef-config-12.8.0还没有在rubygems.org上

以下是我如何解决这个问题

git clone https://github.com/chef/chef.git
cd chef/chef-config
/opt/chefdk/embedded/bin/gem build chef-config.gemspec
/opt/chefdk/embedded/bin/gem install chef-config-12.8.0.gem

答案 1 :(得分:0)

我遇到了类似的问题:

[root @ invalid!':预期进程以[0]退出,但收到'1'(Mixlib :: ShellOut :: ShellCommandFailed) ----开始输出/ usr / bin / ohai -v ---- STDOUT: STDERR:/opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:319:into_specs':找不到'chef-config'(= 12.8.0) - 找到了:[厨师-config-12.7.2](Gem :: LoadError) 选中'GEM_PATH = / root / .chefdk / gem / ruby​​ / 2.1.0:/opt/chefdk/embedded/lib/ruby/gems/2.1.0',执行PHANTOMJS_EXECUTABLE以获取更多信息         来自/opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:328:in gem env gem'         来自/ usr / bin / ohai:4:to_spec' from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:65:in错误!'         来自/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-dk-0.11.2/lib/chef-dk/component_test.rb:99:in <main>' ---- End output of /usr/bin/ohai -v ---- Ran /usr/bin/ohai -v returned 1 from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.2.6/lib/mixlib/shellout.rb:276:in点击'         来自/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-dk-0.11.2/lib/chef-dk/component_test.rb:99:in block in sh!' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-dk-0.11.2/lib/chef-dk/component_test.rb:99:in块(2个级别) )'在'         来自/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-dk-0.11.2/lib/chef-dk/component_test.rb:78:in sh!' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-dk-0.11.2/lib/chef-dk/command/verify.rb:358:in run_smoke_test'         来自/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-dk-0.11.2/lib/chef-dk/command/verify.rb:475:in`block(2 levels)in invoke_tests'

答案 2 :(得分:0)

您可以更新到最新版本:

curl https://omnitruck.chef.io/install.sh | sudo bash -s -- -c current -P chefdk

https://github.com/chef/chef-dk

或编辑ohai脚本:sudo vi /usr/bin/ohai12.8.0替换为12.7.2

https://github.com/chef/chef-dk/issues/718