简体   繁体   English

厨师客户失败。 1秒内更新了0个资源-错误:参数数量错误(给定1,预期为3)

[英]Chef Client failed. 0 resources updated in 01 seconds - ERROR: wrong number of arguments (given 1, expected 3)

I am trying to run a simple Hazelcast cluster on Amazon EC2 following the official code sample , every step seems to be OK but when running vagrant up --provider=aws ( under the header "Let's do this thing" ) it fails as shown: 我正在尝试按照官方代码示例在Amazon EC2上运行一个简单的Hazelcast集群,每个步骤似乎都可以,但是在运行vagrant up --provider=aws (在标题为“让我们做这个事情”下)时,它失败,如图所示:

==> hazelcast2: - ohai (5.2.0)
==> hazelcast2: Installing Cookbook Gems:
==> hazelcast2: Compiling Cookbooks...
==> hazelcast2: [2017-10-24T20:03:06+00:00] INFO: The plugin path /etc/chef/ohai/plugins does not exist. Skipping...
==> hazelcast2: [2017-10-24T20:03:06+00:00] WARN: 
[DEPRECATION] Plugin at /tmp/vagrant-chef/ohai/cookbook_plugins/ohai/hint.rb is a version 6 plugin.     
Version 6 plugins will not be supported in Chef/Ohai 14. Please upgrade your plugin to version 7 plugin format. 
For more information visit here: docs.chef.io/ohai_custom.html
==> hazelcast2: 
==> hazelcast2: Running handlers:
==> hazelcast2: [2017-10-24T20:03:06+00:00] ERROR: Running exception handlers
==> hazelcast2: Running handlers complete
==> hazelcast2: 
==> hazelcast2: [2017-10-24T20:03:06+00:00] ERROR: Exception handlers complete
==> hazelcast2: Chef Client failed. 0 resources updated in 01 seconds
==> hazelcast2: [2017-10-24T20:03:06+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> hazelcast2: [2017-10-24T20:03:06+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
==> hazelcast2: [2017-10-24T20:03:06+00:00] ERROR: wrong number of arguments (given 1, expected 3)
==> hazelcast2: [2017-10-24T20:03:06+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully 
(exit code 1)
==> hazelcast2: An error occurred. The error will be shown after all tasks complete.
An error occurred while executing multiple actions in parallel.
Any errors that occurred are shown below.

An error occurred while executing the action on the 'hazelcast1' machine. 
Please handle this error then try again:

Chef never successfully completed! Any errors should be visible in the output above. 
Please fix your recipes so that they properly complete.

An error occurred while executing the action on the 'hazelcast2' machine. 
Please handle this error then try again:

Chef never successfully completed! Any errors should be visible in the output above. 
Please fix your recipes so that they properly complete.

/var/chef/cache/chef-stacktrace.out: /var/chef/cache/chef-stacktrace.out:

Generated at 2017-10-24 21:36:55 +0000
ArgumentError: wrong number of arguments (given 1, expected 3)
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.5.0/lib/ohai/dsl/plugin/versionvi.rb:27:in `initialize'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.5.0/lib/ohai/loader.rb:223:in `new'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.5.0/lib/ohai/loader.rb:223:in `load_v7_plugin'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.5.0/lib/ohai/loader.rb:93:in `block in load_additional'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.5.0/lib/ohai/loader.rb:90:in `collect'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.5.0/lib/ohai/loader.rb:90:in `load_additional'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.5.0/lib/ohai/system.rb:116:in `run_additional_plugins'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/run_context/cookbook_compiler.rb:119:in `compile_ohai_plugins'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/run_context/cookbook_compiler.rb:73:in `compile'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/run_context.rb:192:in `load'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/policy_builder/expand_node_object.rb:97:in `setup_run_context'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/client.rb:513:in `setup_run_context'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/client.rb:281:in `run'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application.rb:291:in `block in fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application.rb:279:in `fork'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application.rb:279:in `fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application.rb:244:in `block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/local_mode.rb:44:in `with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application.rb:232:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application/client.rb:469:in `sleep_then_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application/client.rb:458:in `block in interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application/client.rb:457:in `loop'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application/client.rb:457:in `interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application/client.rb:441:in `run_application'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application.rb:59:in `run'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application/solo.rb:225:in `run'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/bin/chef-solo:25:in `<top (required)>'
/usr/bin/chef-solo:58:in `load'
/usr/bin/chef-solo:58:in `<main>'

Ohai version: ohai -version Ohai: 13.5.0 Ohai版本:ohai -version Ohai:13.5.0

Java jdk not installed (when it should be according to the receipt): Java jdk未安装(应根据收据情况):

java -version
The program 'java' can be found in the following packages:
 * default-jre
 * gcj-5-jre-headless
 * openjdk-8-jre-headless
 * gcj-4.8-jre-headless
 * gcj-4.9-jre-headless
 * openjdk-9-jre-headless
Try: sudo apt install <selected package>

Following the Stacktrace I got to the point where I believe it has something to do with the fact that the function: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.5.0/lib/ohai/dsl/plugin/versionvi.rb:27:in `initialize': 在Stacktrace之后 ,我认为它与以下功能有关:/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.5.0/lib/ ohai / dsl / plugin / versionvi.rb:27:在'initialize'中:

def initialize(controller, plugin_path, plugin_dir_path)
          super(controller.data)
          @controller = controller
          @version = :version6
          @source = plugin_path
          @plugin_dir_path = plugin_dir_path
end

... requires 3 parameters and is called with only one in : /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.5.0/lib/ohai/loader.rb:223:in 'new' in the function: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.5.0/lib/ohai/loader.rb:223:in `load_v7_plugin' ... 需要3个参数,并且仅在以下一个中被调用 :/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.5.0/lib/ohai/loader.rb:223:in函数中的'new':/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.5.0/lib/ohai/loader.rb:223:在`load_v7_plugin'中

 def load_v7_plugin(plugin_class)
      plugin = plugin_class.new(@controller.data)
      collect_provides(plugin)
      plugin
 end

I repeated the steps on an Ubuntu 14.04 and on an Ubuntu 16.04 VM and I am still stuck with the same Error, any idea what I am doing wrong? 我在Ubuntu 14.04和Ubuntu 16.04 VM上重复了这些步骤,但仍然遇到相同的错误,知道我在做什么错吗?

PS I am just following the steps in the sample. PS我只是按照示例中的步骤。

Thank you 谢谢

The important bit is probably this: 重要的一点可能是:

[DEPRECATION] Plugin at /tmp/vagrant-chef/ohai/cookbook_plugins/ohai/hint.rb is a version 6 plugin.     
Version 6 plugins will not be supported in Chef/Ohai 14. Please upgrade your plugin to version 7 plugin format. 
For more information visit here: docs.chef.io/ohai_custom.html

Figure out what is installing that plugin and check if anything is in the same folder and is an invalid plugin. 找出正在安装该插件的内容,并检查是否在同一个文件夹中并且该插件无效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:arguments 的编号错误(给定 0,预期为 2) - Error: wrong number of arguments (given 0, expected 2) 参数数目错误(给定0,应为4) - wrong number of arguments (given 0, expected 4) 参数数目错误(给定1,预期为0) - wrong number of arguments (given 1, expected 0) 最小测试错误-ArgumentError:参数数量错误(给定1,预期为0) - Minitest Error - ArgumentError: wrong number of arguments (given 1, expected 0) Ruby web应用程序,得到“错误数量的参数(给定3,预期2)”错误 - Ruby webapplication, getting "wrong number of arguments (given 3, expected 2)" error Rails Graphql解决错误:参数数量错误(给定1,预期3) - Rails Graphql resolve error: wrong number of arguments (given 1, expected 3) Rails:ActionView::Template::Error(参数数量错误(给定 4,预期 0..1)): - Rails: ActionView::Template::Error (wrong number of arguments (given 4, expected 0..1)): Ruby错误:参数数量错误(给定4个,预期为0)(ArgumentError) - Ruby Error: wrong number of arguments (given 4, expected 0) (ArgumentError) 厨师:错误:ArgumentError:参数数量错误(1表示2) - chef: ERROR: ArgumentError: wrong number of arguments (1 for 2) ArgumentError 错误的参数数量(给定 0,预期为 1) - ArgumentError wrong number of arguments (given 0, expected 1)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM