刀引导返回“日志级别必须是以下之一:debug,:info,:warn,:error或:fatal”

时间:2013-11-13 03:48:44

标签: chef chef-solo knife

引导捆绑VM时

$ knife bootstrap localhost --ssh-user vagrant --ssh-password vagrant --ssh-port 2222 --sudo

引导过程返回以下异常:

Bootstrapping Chef on localhost
localhost /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/mixlib-log-1.4.1/lib/mixlib/log.rb:97:in `level=': Log level must be one of :debug, :info, :warn, :error, or :fatal (ArgumentError)
localhost   from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.2/lib/chef/application.rb:117:in `configure_logging'
localhost   from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.2/lib/chef/application/client.rb:242:in `configure_logging'
localhost   from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.2/lib/chef/application.rb:63:in `reconfigure'
localhost   from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.2/lib/chef/application/client.rb:197:in `reconfigure'
localhost   from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.2/lib/chef/application.rb:68:in `run'
localhost   from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.2/bin/chef-client:26:in `<top (required)>'
localhost   from /usr/bin/chef-client:23:in `load'
localhost   from /usr/bin/chef-client:23:in `<main>'

我刚刚更新了我的厨师版:

$ knife -v
Chef 11.8.0

这是厨师的错误吗?

4 个答案:

答案 0 :(得分:3)

我遇到了这个确切的问题,我告诉bootstrap安装的版本是10.30.2。

但是,在我的本地计算机上运行的Chef版本是11。

在我的本地计算机上安装了Chef版本10后,有关日志级别的错误消失了。

答案 1 :(得分:2)

错误跟踪表明它是从chef-client抛出的。所以你需要检查/etc/chef/client.rb

你需要一个条目,如:

log_level   :info

有关详细信息,请参阅文章About client.rb

答案 2 :(得分:2)

我找到了一个解决方法,我认为这是一个无法使用厨师/刀版11引导厨师10.x客户端的错误。

你可以把它放在你的knife.rb

chef_client_path 'chef-client -l info'

Chris Jerdonek在此发布了一个解决方法Knife bootstraping returns Log level must be one of

答案 3 :(得分:0)

对我来说,当我尝试使用刀具引导而不与knife.rb位于同一目录时,会出现此问题