Chef:安装java失败

时间:2017-05-23 08:53:26

标签: chef

我的配置是:

node.default['java']['install_flavor'] = 'oracle'
node.default['java']['jdk_version'] = '8'
node.default['java']['oracle']['accept_oracle_download_terms'] = true

include_recipe 'java'

我从厨师客户那里收到此消息:

digitalocean_droplet.web (chef):
digitalocean_droplet.web (chef):     ================================================================================
digitalocean_droplet.web (chef):     Error executing action `install` on resource 'java_ark[jdk]'
digitalocean_droplet.web (chef):     ================================================================================

digitalocean_droplet.web (chef):     SystemExit
digitalocean_droplet.web (chef):     ----------
digitalocean_droplet.web (chef):     exit

digitalocean_droplet.web (chef):     Cookbook Trace:
digitalocean_droplet.web (chef):     ---------------
digitalocean_droplet.web (chef):     /var/chef/cache/cookbooks/java/providers/ark.rb:168:in `block (2 levels) in class_from_file'
digitalocean_droplet.web (chef):     /var/chef/cache/cookbooks/java/providers/ark.rb:145:in `block in class_from_file'

digitalocean_droplet.web (chef):     Resource Declaration:
digitalocean_droplet.web (chef):     ---------------------
digitalocean_droplet.web (chef):     # In /var/chef/cache/cookbooks/java/recipes/oracle.rb
digitalocean_droplet.web (chef):
digitalocean_droplet.web (chef):      59: java_ark 'jdk' do
digitalocean_droplet.web (chef):      60:   url tarball_url
digitalocean_droplet.web (chef):      61:   default node['java']['set_default']
digitalocean_droplet.web (chef):      62:   checksum tarball_checksum
digitalocean_droplet.web (chef):      63:   app_home java_home
digitalocean_droplet.web (chef):      64:   bin_cmds bin_cmds
digitalocean_droplet.web (chef):      65:   alternatives_priority node['java']['alternatives_priority']
digitalocean_droplet.web (chef):      66:   retries node['java']['ark_retries']
digitalocean_droplet.web (chef):      67:   retry_delay node['java']['ark_retry_delay']
digitalocean_droplet.web (chef):      68:   connect_timeout node['java']['ark_timeout']
digitalocean_droplet.web (chef):      69:   use_alt_suffix node['java']['use_alt_suffix']
digitalocean_droplet.web (chef):      70:   reset_alternatives node['java']['reset_alternatives']
digitalocean_droplet.web (chef):      71:   download_timeout node['java']['ark_download_timeout']
digitalocean_droplet.web (chef):      72:   proxy node['java']['ark_proxy']
digitalocean_droplet.web (chef):      73:   action :install
digitalocean_droplet.web (chef):      74:   notifies :write, 'log[jdk-version-changed]', :immediately
digitalocean_droplet.web (chef):      75: end
digitalocean_droplet.web (chef):      76:
digitalocean_droplet.web (chef):      77: if node['java']['set_default'] && platform_family?('debian')
digitalocean_droplet.web (chef):      78:   include_recipe 'java::default_java_symlink'
digitalocean_droplet.web (chef):      79: end
digitalocean_droplet.web (chef):      80:
digitalocean_droplet.web (chef):
digitalocean_droplet.web (chef):     Compiled Resource:
digitalocean_droplet.web (chef):     ------------------
digitalocean_droplet.web (chef):     # Declared in /var/chef/cache/cookbooks/java/recipes/oracle.rb:59:in `from_file'
digitalocean_droplet.web (chef):
digitalocean_droplet.web (chef):     java_ark("jdk") do
digitalocean_droplet.web (chef):       action [:install]
digitalocean_droplet.web (chef):       supports {:report=>true, :exception=>true}
digitalocean_droplet.web (chef):       retries 0
digitalocean_droplet.web (chef):       retry_delay 2
digitalocean_droplet.web (chef):       default_guard_interpreter :default
digitalocean_droplet.web (chef):       declared_type :java_ark
digitalocean_droplet.web (chef):       cookbook_name "java"
digitalocean_droplet.web (chef):       recipe_name "oracle"
digitalocean_droplet.web (chef):       url "http://download.oracle.com/otn-pub/java/jdk/8u40-b26/jdk-8u40-linux-x64.tar.gz"
digitalocean_droplet.web (chef):       default true
digitalocean_droplet.web (chef):       checksum "da1ad819ce7b7ec528264f831d88afaa5db34b7955e45422a7e380b1ead6b04d"
digitalocean_droplet.web (chef):       app_home "/usr/lib/jvm/java"
digitalocean_droplet.web (chef):       bin_cmds ["appletviewer", "apt", "ControlPanel", "extcheck", "idlj", "jar", "jarsigner", "java"
, "javac", "javadoc", "javafxpackager", "javah", "javap", "javaws", "jcmd", "jconsole", "jcontrol", "jdb", "jdeps", "jhat", "jinfo", "
jjs", "jmap", "jmc", "jps", "jrunscript", "jsadebugd", "jstack", "jstat", "jstatd", "jvisualvm", "keytool", "native2ascii", "orbd", "p
ack200", "policytool", "rmic", "rmid", "rmiregistry", "schemagen", "serialver", "servertool", "tnameserv", "unpack200", "wsgen", "wsim
port", "xjc"]
digitalocean_droplet.web (chef):       alternatives_priority 1062
digitalocean_droplet.web (chef):       connect_timeout 600
digitalocean_droplet.web (chef):       use_alt_suffix true
digitalocean_droplet.web (chef):       reset_alternatives true
digitalocean_droplet.web (chef):       download_timeout 600
digitalocean_droplet.web (chef):       owner "root"
digitalocean_droplet.web (chef):     end
digitalocean_droplet.web (chef):
digitalocean_droplet.web (chef):     Platform:
digitalocean_droplet.web (chef):     ---------
digitalocean_droplet.web (chef):     x86_64-linux

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

Generated at 2017-05-23 07:39:11 +0000
SystemExit: java_ark[jdk] (java::oracle line 59) had an error: SystemExit: exit
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:368:in `exit'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:368:in `fatal!'
/var/chef/cache/cookbooks/java/providers/ark.rb:168:in `block (2 levels) in class_from_file'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/mixin/why_run.rb:52:in `add_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider.rb:176:in `converge_by'
/var/chef/cache/cookbooks/java/providers/ark.rb:145:in `block in class_from_file'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/lwrp_base.rb:86:in `instance_eval'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/lwrp_base.rb:86:in `block in action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider.rb:145:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource.rb:622:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:69:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:97:in `block (2 levels) in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:97:in `each'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:97:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:96:in `converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/client.rb:670:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/client.rb:665:in `catch'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/client.rb:665:in `converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/client.rb:704:in `converge_and_save'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/client.rb:284:in `run'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:295:in `block in fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:283:in `fork'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:283:in `fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:248:in `block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/local_mode.rb:44:in `with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:236:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:450:in `loop'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:450:in `interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:434:in `run_application'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:59:in `run'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/bin/chef-client:26:in `<top (required)>'
/bin/chef-client:57:in `load'
/bin/chef-client:57:in `<main>'

>>>> Caused by SystemExit: exit
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:368:in `exit'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:368:in `fatal!'
/var/chef/cache/cookbooks/java/providers/ark.rb:168:in `block (2 levels) in class_from_file'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/mixin/why_run.rb:52:in `add_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider.rb:176:in `converge_by'
/var/chef/cache/cookbooks/java/providers/ark.rb:145:in `block in class_from_file'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/lwrp_base.rb:86:in `instance_eval'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/lwrp_base.rb:86:in `block in action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider.rb:145:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource.rb:622:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:69:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:97:in `block (2 levels) in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:97:in `each'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:97:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
"/var/chef/cache/chef-stacktrace.out" [noeol] 86L, 8707C

/var/chef/cache的内容是:

ls -lh /var/chef/cache/
total 32K
-rw-r--r--  1 root root    4 May 23 07:38 chef-client-running.pid
-rw-r-----  1 root root 8.6K May 23 07:39 chef-stacktrace.out
drwxr-xr-x 27 root root 4.0K May 23 07:38 cookbooks
-rw-r--r--  1 root root   52 May 23 07:38 data_collector_metadata.json
-rw-r--r--  1 root root 7.0K May 23 07:39 jdk-8u40-linux-x64.tar.gz

我已尝试直接访问下载网址http://download.oracle.com/otn-pub/java/jdk/8u40-b26/jdk-8u40-linux-x64.tar.gz

enter image description here

1 个答案:

答案 0 :(得分:0)

它解决了我更新java cookbook(link

的问题