在资源'包[pgdg-centos93]'

时间:2016-02-02 12:47:59

标签: postgresql chef chef-recipe

环境

  • 厨师
  • CentOS的
  • POSTGRES
  • 滑轨

亚马逊云服务器

$ cat /etc/redhat-release 
CentOS release 6.7 (Final)

$ uname -a
Linux ip-10-0-0-250 2.6.32-504.8.1.el6.x86_64 #1 SMP Wed Jan 28 21:11:36 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

让一个Amazon CentOS实例睡了几个月,今天再次启动它。为了让所有东西都是最新的,"魔法"应该发生{语言)与sudo chef-client,至少是预期的。而就我目前的经验而言,厨师给我的项目带来的收益几乎超过了时间。 (注意:这是与个人经历相关的附带评论。)

这是我最近的头痛

Recipe: postgresql::yum_pgdg_postgresql
  * remote_file[/var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm] action create (up to date)
  * package[pgdg-centos93] action install
================================================================================
Error executing action `install` on resource 'package[pgdg-centos93]'
================================================================================


Chef::Exceptions::Exec
----------------------
rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm returned 2, expected 0


Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/postgresql/recipes/yum_pgdg_postgresql.rb

 43: package repo_rpm_package do
 44:   provider Chef::Provider::Package::Rpm
 45:   source "#{Chef::Config[:file_cache_path]}/#{repo_rpm_filename}"
 46:   action :install
 47: end



Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/postgresql/recipes/yum_pgdg_postgresql.rb:43:in `from_file'

package("pgdg-centos93") do
  provider Chef::Provider::Package::Rpm
  action [:install]
  retries 0
  retry_delay 2
  guard_interpreter :default
  package_name "pgdg-centos93"
  source "/var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm"
  version "9.3-1"
  cookbook_name "postgresql"
  recipe_name "yum_pgdg_postgresql"
end




Running handlers:
[2016-02-02T12:34:02+00:00] ERROR: Running exception handlers
Running handlers complete

[2016-02-02T12:34:02+00:00] ERROR: Exception handlers complete
[2016-02-02T12:34:02+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 8 resources updated in 42.119165396 seconds
[2016-02-02T12:34:03+00:00] ERROR: package[pgdg-centos93] (postgresql::yum_pgdg_postgresql line 43) had an error: Chef::Exceptions::Exec: rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm returned 2, expected 0
[2016-02-02T12:34:03+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

任何指针都受到最迫切的欢迎。我只是没有设法理解错误

更新

如建议

$ sudo rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm
[sudo] password for ed: 
    package pgdg-centos93-9.3-2.noarch (which is newer than pgdg-centos93-9.3-1.noarch) is already installed

以调试模式运行Chef

  * package[pgdg-centos93] action install[2016-02-02T14:05:16+00:00] INFO: Processing package[pgdg-centos93] action install (postgresql::yum_pgdg_postgresql line 43)
[2016-02-02T14:05:16+00:00] DEBUG: package[pgdg-centos93] checking rpm status
[2016-02-02T14:05:17+00:00] DEBUG: package[pgdg-centos93] checking install state
[2016-02-02T14:05:17+00:00] DEBUG: package[pgdg-centos93] current version is 9.3-2
[2016-02-02T14:05:17+00:00] DEBUG: Executing rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm
[2016-02-02T14:05:17+00:00] DEBUG: ---- Begin output of rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm ----
[2016-02-02T14:05:17+00:00] DEBUG: STDOUT: 
[2016-02-02T14:05:17+00:00] DEBUG: STDERR:  package pgdg-centos93-9.3-2.noarch (which is newer than pgdg-centos93-9.3-1.noarch) is already installed
[2016-02-02T14:05:17+00:00] DEBUG: ---- End output of rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm ----
[2016-02-02T14:05:17+00:00] DEBUG: Ran rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm returned 2

================================================================================
Error executing action `install` on resource 'package[pgdg-centos93]'
================================================================================


Chef::Exceptions::Exec
----------------------
rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm returned 2, expected 0
---- Begin output of rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm ----
STDOUT: STDERR:     package pgdg-centos93-9.3-2.noarch (which is newer than pgdg-centos93-9.3-1.noarch) is already installed
---- End output of rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm ----



Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/postgresql/recipes/yum_pgdg_postgresql.rb

 43: package repo_rpm_package do
 44:   provider Chef::Provider::Package::Rpm
 45:   source "#{Chef::Config[:file_cache_path]}/#{repo_rpm_filename}"
 46:   action :install
 47: end



Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/postgresql/recipes/yum_pgdg_postgresql.rb:43:in `from_file'

package("pgdg-centos93") do
  provider Chef::Provider::Package::Rpm
  action [:install]
  retries 0
  retry_delay 2
  guard_interpreter :default
  package_name "pgdg-centos93"
  source "/var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm"
  version "9.3-1"
  cookbook_name "postgresql"
  recipe_name "yum_pgdg_postgresql"
end



[2016-02-02T14:05:17+00:00] INFO: Running queued delayed notifications before re-raising exception
[2016-02-02T14:05:17+00:00] DEBUG: Re-raising exception: Chef::Exceptions::Exec - package[pgdg-centos93] (postgresql::yum_pgdg_postgresql line 43) had an error: Chef::Exceptions::Exec: rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm returned 2, expected 0
---- Begin output of rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm ----
STDOUT: STDERR:     package pgdg-centos93-9.3-2.noarch (which is newer than pgdg-centos93-9.3-1.noarch) is already installed
---- End output of rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm ----

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/command.rb:158:in `handle_command_failures'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/command.rb:104:in `run_command_and_return_stdout_stderr'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/command.rb:79:in `run_command'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/command.rb:171:in `run_command_with_systems_locale'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider/package/rpm.rb:98:in `install_package'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider/package.rb:82:in `block in action_install'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/why_run.rb:52:in `call'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/why_run.rb:52:in `add_action'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider.rb:155:in `converge_by'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider/package.rb:80:in `action_install'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider.rb:120:in `run_action'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource.rb:637:in `run_action'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:49:in `run_action'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:81:in `block (2 levels) in converge'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:81:in `each'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:81:in `block in converge'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection.rb:98:in `block in execute_each_resource'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection.rb:96:in `execute_each_resource'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:80:in `converge'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:345:in `converge'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:431:in `do_run'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:213:in `block in run'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:207:in `fork'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:207:in `run'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application.rb:217:in `run_chef_client'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application/client.rb:328:in `block in run_application'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application/client.rb:317:in `loop'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application/client.rb:317:in `run_application'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application.rb:67:in `run'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/bin/chef-client:26:in `<top (required)>'
  /usr/bin/chef-client:23:in `load'
  /usr/bin/chef-client:23:in `<main>'

Running handlers:
[2016-02-02T14:05:17+00:00] ERROR: Running exception handlers
Running handlers complete

[2016-02-02T14:05:17+00:00] ERROR: Exception handlers complete
[2016-02-02T14:05:17+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2016-02-02T14:05:17+00:00] DEBUG: Chef::Exceptions::Exec: package[pgdg-centos93] (postgresql::yum_pgdg_postgresql line 43) had an error: Chef::Exceptions::Exec: rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm returned 2, expected 0
---- Begin output of rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm ----
STDOUT: STDERR:     package pgdg-centos93-9.3-2.noarch (which is newer than pgdg-centos93-9.3-1.noarch) is already installed
---- End output of rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm ----

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/command.rb:158:in `handle_command_failures'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/command.rb:104:in `run_command_and_return_stdout_stderr'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/command.rb:79:in `run_command'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/command.rb:171:in `run_command_with_systems_locale'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider/package/rpm.rb:98:in `install_package'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider/package.rb:82:in `block in action_install'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/why_run.rb:52:in `call'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/why_run.rb:52:in `add_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider.rb:155:in `converge_by'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider/package.rb:80:in `action_install'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider.rb:120:in `run_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource.rb:637:in `run_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:49:in `run_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:81:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:81:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection.rb:98:in `block in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection.rb:96:in `execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:80:in `converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:345:in `converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:431:in `do_run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:213:in `block in run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:207:in `fork'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:207:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application.rb:217:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application/client.rb:328:in `block in run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application/client.rb:317:in `loop'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application/client.rb:317:in `run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application.rb:67:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/bin/chef-client:26:in `<top (required)>'
/usr/bin/chef-client:23:in `load'
/usr/bin/chef-client:23:in `<main>'
Chef Client failed. 8 resources updated in 42.825243439 seconds
[2016-02-02T14:05:17+00:00] INFO: Sending resource update report (run-id: ac041d25-eba7-4865-a20a-d16ffa60acef)
[2016-02-02T14:05:17+00:00] DEBUG: {"action"=>"end", "resources"=>[{"type"=>"ruby_block", "name"=>"run-iptables-resources-early", "id"=>"run-iptables-resources-early", "after"=>{}, "before"=>{}, "duration"=>"16183", "delta"=>"", "result"=>"run", "cookbook_name"=>"simple_iptables", "cookbook_version"=>"0.6.0"}, {"type"=>"package", "name"=>"pgdg-centos93", "id"=>"pgdg-centos93", "after"=>{:version=>"9.3-1", :options=>nil}, "before"=>{:version=>"9.3-2", :options=>nil}, "duration"=>"961", "delta"=>"", "result"=>"install", "cookbook_name"=>"postgresql", "cookbook_version"=>"3.4.0"}], "status"=>"failure", "run_list"=>"[\"role[website]\"]", "total_res_count"=>"27", "data"=>{"exception"=>{"class"=>"#<Chef::Exceptions::Exec: package[pgdg-centos93] (postgresql::yum_pgdg_postgresql line 43) had an error: Chef::Exceptions::Exec: rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm returned 2, expected 0\n---- Begin output of rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm ----\nSTDOUT: STDERR: \tpackage pgdg-centos93-9.3-2.noarch (which is newer than pgdg-centos93-9.3-1.noarch) is already installed\n---- End output of rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm ----\n>", "message"=>"package[pgdg-centos93] (postgresql::yum_pgdg_postgresql line 43) had an error: Chef::Exceptions::Exec: rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm returned 2, expected 0\n---- Begin output of rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm ----\nSTDOUT: STDERR: \tpackage pgdg-centos93-9.3-2.noarch (which is newer than pgdg-centos93-9.3-1.noarch) is already installed\n---- End output of rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm ----\n", "backtrace"=>"[\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/command.rb:158:in `handle_command_failures'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/command.rb:104:in `run_command_and_return_stdout_stderr'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/command.rb:79:in `run_command'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/command.rb:171:in `run_command_with_systems_locale'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider/package/rpm.rb:98:in `install_package'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider/package.rb:82:in `block in action_install'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/why_run.rb:52:in `call'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/why_run.rb:52:in `add_action'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider.rb:155:in `converge_by'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider/package.rb:80:in `action_install'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider.rb:120:in `run_action'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource.rb:637:in `run_action'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:49:in `run_action'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:81:in `block (2 levels) in converge'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:81:in `each'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:81:in `block in converge'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection.rb:98:in `block in execute_each_resource'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection.rb:96:in `execute_each_resource'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:80:in `converge'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:345:in `converge'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:431:in `do_run'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:213:in `block in run'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:207:in `fork'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:207:in `run'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application.rb:217:in `run_chef_client'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application/client.rb:328:in `block in run_application'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application/client.rb:317:in `loop'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application/client.rb:317:in `run_application'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application.rb:67:in `run'\",\"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/bin/chef-client:26:in `<top (required)>'\",\"/usr/bin/chef-client:23:in `load'\",\"/usr/bin/chef-client:23:in `<main>'\"]", "description"=>{"title"=>"Error executing action `install` on resource 'package[pgdg-centos93]'", "sections"=>[{"Chef::Exceptions::Exec"=>"rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm returned 2, expected 0\n---- Begin output of rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm ----\nSTDOUT: STDERR: \tpackage pgdg-centos93-9.3-2.noarch (which is newer than pgdg-centos93-9.3-1.noarch) is already installed\n---- End output of rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm ----\n"}, {"Resource Declaration:"=>"# In /var/chef/cache/cookbooks/postgresql/recipes/yum_pgdg_postgresql.rb\n\n 43: package repo_rpm_package do\n 44:   provider Chef::Provider::Package::Rpm\n 45:   source \"\#{Chef::Config[:file_cache_path]}/\#{repo_rpm_filename}\"\n 46:   action :install\n 47: end\n"}, {"Compiled Resource:"=>"# Declared in /var/chef/cache/cookbooks/postgresql/recipes/yum_pgdg_postgresql.rb:43:in `from_file'\n\npackage(\"pgdg-centos93\") do\n  provider Chef::Provider::Package::Rpm\n  action [:install]\n  retries 0\n  retry_delay 2\n  guard_interpreter :default\n  package_name \"pgdg-centos93\"\n  source \"/var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm\"\n  version \"9.3-1\"\n  cookbook_name \"postgresql\"\n  recipe_name \"yum_pgdg_postgresql\"\nend\n"}]}}}, "start_time"=>"2016-02-02 14:04:41 +0000", "end_time"=>"2016-02-02 14:05:17 +0000"}
[2016-02-02T14:05:17+00:00] DEBUG: Sending compressed run data...
[2016-02-02T14:05:17+00:00] DEBUG: Signing the request as ec2-production-web
[2016-02-02T14:05:17+00:00] DEBUG: String to sign: 'Method:POST
Hashed Path:ZNfsXWm0ScG9Y7tct4xU2t8Ruc4=
X-Ops-Content-Hash:JebmaJ0FR9SKdg1Whn6EXf9AjeY=
X-Ops-Timestamp:2016-02-02T14:05:17Z
X-Ops-UserId:ec2-production-web'
Header hash: {"X-Ops-Sign"=>"algorithm=sha1;version=1.0;", "X-Ops-Userid"=>"ec2-production-web", "X-Ops-Timestamp"=>"2016-02-02T14:05:17Z", "X-Ops-Content-Hash"=>"JebmaJ0FR9SKdg1Whn6EXf9AjeY=", "X-Ops-Authorization-1"=>"i25tlVgWl76JsqbNZFU9HKNBWbeIUUdOOIkInmsgw4cPI8zctpzNRZi9e5JF", "X-Ops-Authorization-2"=>"flygf7pnwtIH0UFpUJSukmHAklqGL2pQlMy3oRoSxQhzvYTW+njD4SznjEY/", "X-Ops-Authorization-3"=>"Cf0nkNUkf0mlch5oTiU9PD6md/irpT0IIv+fYCBS1HRoYpbiJVWuYqHchgOo", "X-Ops-Authorization-4"=>"Ir0DnFtZ4SFucPATkHWQMxx/c1tAY1sSoQZv02kceDJVPuMAarRI8gKzOQ6+", "X-Ops-Authorization-5"=>"Z6TBmJWXVqdRU4CAvjihr87hVadAYQQZURuQCEwsnxFUnxDZkrz1jDV+PnhQ", "X-Ops-Authorization-6"=>"uXPPOgdI5DuF45RvJfoFO8AvTkg+QCEwkqwCAY+e3w=="}
[2016-02-02T14:05:17+00:00] DEBUG: Initiating POST to https://api.opscode.com/organizations/[filtered]/reports/nodes/ec2-production-web/runs/ac041d25-eba7-4865-a20a-d16ffa60acef
[2016-02-02T14:05:17+00:00] DEBUG: ---- HTTP Request Header Data: ----
[2016-02-02T14:05:17+00:00] DEBUG: X-Ops-Reporting-Protocol-Version: 0.1.0
[2016-02-02T14:05:17+00:00] DEBUG: Content-Encoding: gzip
[2016-02-02T14:05:17+00:00] DEBUG: X-OPS-SIGN: algorithm=sha1;version=1.0;
[2016-02-02T14:05:17+00:00] DEBUG: X-OPS-USERID: ec2-production-web
[2016-02-02T14:05:17+00:00] DEBUG: X-OPS-TIMESTAMP: 2016-02-02T14:05:17Z
[2016-02-02T14:05:17+00:00] DEBUG: X-OPS-CONTENT-HASH: JebmaJ0FR9SKdg1Whn6EXf9AjeY=
[2016-02-02T14:05:17+00:00] DEBUG: X-OPS-AUTHORIZATION-1: i25tlVgWl76JsqbNZFU9HKNBWbeIUUdOOIkInmsgw4cPI8zctpzNRZi9e5JF
[2016-02-02T14:05:17+00:00] DEBUG: X-OPS-AUTHORIZATION-2: flygf7pnwtIH0UFpUJSukmHAklqGL2pQlMy3oRoSxQhzvYTW+njD4SznjEY/
[2016-02-02T14:05:17+00:00] DEBUG: X-OPS-AUTHORIZATION-3: Cf0nkNUkf0mlch5oTiU9PD6md/irpT0IIv+fYCBS1HRoYpbiJVWuYqHchgOo
[2016-02-02T14:05:17+00:00] DEBUG: X-OPS-AUTHORIZATION-4: Ir0DnFtZ4SFucPATkHWQMxx/c1tAY1sSoQZv02kceDJVPuMAarRI8gKzOQ6+
[2016-02-02T14:05:17+00:00] DEBUG: X-OPS-AUTHORIZATION-5: Z6TBmJWXVqdRU4CAvjihr87hVadAYQQZURuQCEwsnxFUnxDZkrz1jDV+PnhQ
[2016-02-02T14:05:17+00:00] DEBUG: X-OPS-AUTHORIZATION-6: uXPPOgdI5DuF45RvJfoFO8AvTkg+QCEwkqwCAY+e3w==
[2016-02-02T14:05:17+00:00] DEBUG: HOST: api.opscode.com:443
[2016-02-02T14:05:17+00:00] DEBUG: X-REMOTE-REQUEST-ID: ac041d25-eba7-4865-a20a-d16ffa60acef
[2016-02-02T14:05:17+00:00] DEBUG: Content-Length: 1391
[2016-02-02T14:05:17+00:00] DEBUG: ---- End HTTP Request Header Data ----
[2016-02-02T14:05:18+00:00] DEBUG: ---- HTTP Status and Header Data: ----
[2016-02-02T14:05:18+00:00] DEBUG: HTTP 1.1 200 OK
[2016-02-02T14:05:18+00:00] DEBUG: content-type: application/json
[2016-02-02T14:05:18+00:00] DEBUG: date: Tue, 02 Feb 2016 14:05:18 GMT
[2016-02-02T14:05:18+00:00] DEBUG: server: openresty/1.9.3.1
[2016-02-02T14:05:18+00:00] DEBUG: content-length: 2
[2016-02-02T14:05:18+00:00] DEBUG: connection: Close
[2016-02-02T14:05:18+00:00] DEBUG: ---- End HTTP Status/Header Data ----
[2016-02-02T14:05:18+00:00] ERROR: package[pgdg-centos93] (postgresql::yum_pgdg_postgresql line 43) had an error: Chef::Exceptions::Exec: rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm returned 2, expected 0
---- Begin output of rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm ----
STDOUT: STDERR:     package pgdg-centos93-9.3-2.noarch (which is newer than pgdg-centos93-9.3-1.noarch) is already installed
---- End output of rpm  -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm ----

[2016-02-02T14:05:18+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[ed@ip-10-0-0-250 ~]$ 

更新2

删除了比一个Chef尝试安装

更新的包pgdg-centos93-9.3-2.noarch
yum remove pgdg-centos93-9.3-2.noarch

然后再次运行sudo chef-client -l debug

进入另一个阻塞问题,一旦解决,就会把我带到第一个问题。所以我要进入圈子。将验证一个有用的答案,因为,我相信我的问题没有简单的解决方案。

1 个答案:

答案 0 :(得分:2)

错误是命令rpm -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm的退出代码为2,表示存在错误。手动运行该命令以查看错误详细信息或运行chef-client -l debug以启用Chef的调试级输出,该输出将包括子进程中的stdout和stderr。

所以你的更广泛的问题:厨师不是魔术,也不是它自己的平台即服务。 Chef本身提供相当基本的原语,如包安装和模板化配置文件,一般来说,那些只是做他们在锡上说的话。当您开始构建自己的复杂烹饪书或使用社区烹饪书时,您可以获得更多的交钥匙魔术,例如“将其添加到您的运行列表中并弹出PostgreSQL服务器”,但这种复杂性带来了更多错误。社区食谱特别是质量差异很大,你应该经常检查某些东西是来自你个人或机构信任的作者,如果不是,可能会阅读其中的所有代码,并确保你喜欢它。当您开始使用外部工具/库/ gems / packages /等时,与任何软件开发环境相同的基本过程。