2017-04-24 8 views
0

chef_clientがレシピを実行しているときにエラーメッセージが表示されます。Chef:未定義のメソッド `platform_version '

未定義のメソッド `platform_version」私はレシピがCentOSの/ 7、バージョンウィット実行しようとした

1611.01限り、私はそれが私のことを言っています把握することができましたおよび1703.01。ここに完全なトレースを見ることができます:

==> default: ================================================================================ 
==> default: Recipe Compile Error in /var/chef/cache/cookbooks/living-development/recipes/default.rb 
==> default: ================================================================================ 
==> default: 
==> default: NoMethodError 
==> default: ------------- 
==> default: undefined method `platform_version' for #<Chef::Node::Attribute:0x00000004f4f480> 
==> default: 
==> default: Cookbook Trace: 
==> default: --------------- 
==> default: /var/chef/cache/cookbooks/mongodb3/recipes/package_repo.rb:26:in `from_file' 
==> default: /var/chef/cache/cookbooks/mongodb3/recipes/default.rb:20:in `from_file' 
==> default: /var/chef/cache/cookbooks/living-development/recipes/mongodb.rb:9:in `from_file' 
==> default: /var/chef/cache/cookbooks/living-development/recipes/default.rb:11:in `from_file' 
==> default: 
==> default: Relevant File Content: 
==> default: ---------------------- 
==> default: /var/chef/cache/cookbooks/mongodb3/recipes/package_repo.rb: 
==> default: 
==> default: 19: 
==> default: 20: pkg_major_version = node['mongodb3']['version'].to_f # eg. 3.0, 3.2 
==> default: 21: 
==> default: 22: # Setup default package version attribute to install 
==> default: 23: pkg_version = node['mongodb3']['version'] 
==> default: 24: case node['platform_family'] 
==> default: 25: when 'rhel', 'fedora' 
==> default: 26>>  pkg_version = "#{node['mongodb3']['version']}-1.el#{node.platform_version.to_i}" # ~FC019 
==> default: 27:  if node['platform'] == 'amazon' 
==> default: 28:  pkg_version = "#{node['mongodb3']['version']}-1.amzn1" # ~FC019 
==> default: 29:  end 
==> default: 30: end 
==> default: 31: 
==> default: 32: # Setup default package repo url attribute for each platform family or platform 
==> default: 33: case node['platform'] 
==> default: 34: when 'redhat', 'oracle','centos', 'fedora' # ~FC024 
==> default: 35:  pkg_repo = "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/#{pkg_major_version}/#{node['kernel']['machine'] =~ /x86_64/ ? 'x86_64' : 'i686'}" 
==> default: 
==> default: System Info: 
==> default: ------------ 
==> default: chef_version=13.0.118 
==> default: platform=centos 
==> default: platform_version=7.3.1611 
==> default: ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux] 
==> default: program_name=chef-client worker: ppid=12132;start=09:52:48; 
==> default: executable=/opt/chef/bin/chef-client 
==> default: 
==> default: Running handlers: 
==> default: [2017-04-24T09:53:06+00:00] ERROR: Running exception handlers 
==> default: Running handlers complete 
==> default: [2017-04-24T09:53:06+00:00] ERROR: Exception handlers complete 
==> default: Chef Client failed. 0 resources updated in 18 seconds 
==> default: [2017-04-24T09:53:06+00:00] INFO: Sending resource update report (run-id: 30b10346-fc52-4aac-86cd-f76ccd8e0576) 
==> default: [2017-04-24T09:53:07+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out 
==> default: [2017-04-24T09:53:07+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report 
==> default: [2017-04-24T09:53:07+00:00] ERROR: undefined method `platform_version' for #<Chef::Node::Attribute:0x00000004f4f480> 
==> default: [2017-04-24T09:53:07+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) 
Chef never successfully completed! Any errors should be visible in the 
output above. Please fix your recipes so that they properly complete. 

アイデア? AROUND

WORK:

config.vm.provision "chef_client" do |chef| 
    ... 
    chef.version = '12.19.36' 
end 

答えて

3

私たちは、コードがnode["platform_version"]に更新する必要がシェフ13内のノードの属性のメソッドの構文を削除しました。

+0

これまでに解決するための回避策はありますか? – Jordi

+0

確かに、シェフ12にロールバックしてください。シェフ13はとても新しく、すべてのコミュニティの料理本が更新されているわけではありません。 – coderanger

+0

私は特別なシェフのバージョンを指定していません。私はそれが最新の安定したバージョンを取得しようとしていると思います。それを指定する方法はありますか? – Jordi

関連する問題