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

Environment
Chef
CentOS
PostGres
Rails
Amazon cloud server
$ 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
Put an Amazon CentOS instance to sleep for a couple of months and started it again today. To bring everything up-to-date, the "magic" should happen (figure of speech) with sudo chef-client, at least that was what was expected. And to my current experience for this particular , Chef has brought to my project almost more overhead than gain in time. (NOTE: This is a side comment related to a personal experience.)
Here is my latest headache
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)
Any pointers are most desperately welcomed. I just don't manage to understand the ERROR
UPDATE
As suggested
$ 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
Running Chef in debug mode
* 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 ~]$
UPDATE 2
Removed package pgdg-centos93-9.3-2.noarch which was newer than the one Chef was trying to install
yum remove pgdg-centos93-9.3-2.noarch
then ran sudo chef-client -l debug again.
Ran into another blocking issue that once resolved takes me to the first problem I had. So I am going in circles. Will validate the one helpful answer because, I believe that there is no easy solution to my problem.

The error is that the command rpm -U /var/chef/cache/pgdg-centos93-9.3-1.noarch.rpm has an exit code of 2, which indicates there was an error. Either run that command by hand to see the error details or run chef-client -l debug to enable Chef's debug-level output which will include the stdout and stderr from the subprocess.
So your broader question: Chef is not magic nor is it a Platform-as-a-Service on its own. Chef itself offers fairly basic primitives like package installs and templated config files, and in general those just do what they say on the tin. When you start either building your own complex cookbooks or using the community cookbooks you can get much more turn-key magic like "add this to your run list and out pops a PostgreSQL server" but with that complexity comes a lot more bugs. Community cookbooks especially are of widely varying quality and you should always check if something is from an author you personally or institutionally trust and if not probably read all the code in it and make sure you like it. Same basic process as with any software development environment when you start consuming external tools/libraries/gems/packages/etc.

Related

/opt/gitlab/embedded/bin/ruby: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

I'm trying to install gitlab-ce on my raspberry pi 4B, 4GB model. My operating system is Raspberry Pi OS Lite 64bit.
Installer taken from here
There was an error running gitlab-ctl reconfigure:
Multiple failures occurred:
* Mixlib::ShellOut::ShellCommandFailed occurred in Chef Infra Client run: runit_service[gitlab-kas] (gitlab-kas::enable line 121) had an error: Mixlib::ShellOut::ShellCommandFailed: ruby_block[restart_log_service] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/runit/libraries/provider_runit_service.rb line 65) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /opt/gitlab/embedded/bin/sv restart /opt/gitlab/service/gitlab-kas/log ----
STDOUT: timeout: run: /opt/gitlab/service/gitlab-kas/log: (pid 21560) 34s, got TERM
STDERR:
---- End output of /opt/gitlab/embedded/bin/sv restart /opt/gitlab/service/gitlab-kas/log ----
Ran /opt/gitlab/embedded/bin/sv restart /opt/gitlab/service/gitlab-kas/log returned 1
* Mixlib::ShellOut::ShellCommandFailed occurred in delayed notification: execute[clear the gitlab-rails cache] (gitlab::gitlab-rails line 477) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '127'
---- Begin output of /opt/gitlab/bin/gitlab-rake cache:clear ----
STDOUT:
STDERR: /opt/gitlab/embedded/bin/ruby: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
---- End output of /opt/gitlab/bin/gitlab-rake cache:clear ----
Ran /opt/gitlab/bin/gitlab-rake cache:clear returned 127
* Mixlib::ShellOut::ShellCommandFailed occurred in delayed notification: runit_service[gitlab-kas] (gitlab-kas::enable line 121) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /opt/gitlab/embedded/bin/sv restart /opt/gitlab/service/gitlab-kas ----
STDOUT: timeout: run: /opt/gitlab/service/gitlab-kas: (pid 21561) 65s, got TERM
STDERR:
---- End output of /opt/gitlab/embedded/bin/sv restart /opt/gitlab/service/gitlab-kas ----
Ran /opt/gitlab/embedded/bin/sv restart /opt/gitlab/service/gitlab-kas returned 1
*Update: Distro info:
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
The installation scripts for the Raspberry Pi only work on debian buster. Notice the distro/version specified for the package is raspbian/buster:
However, you have installed the newer bullseye version of raspbian:
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
In order to use this install script, you'll need to use the legacy debian buster release for Raspberry PI OS.

Unable to debug in rubymine with rspec

When running rubymine debug getting Test framework quit unexpectedly error.
Testing started at 11:41 AM ...
/bin/bash -c "env RBENV_VERSION=2.7.0 /home/workstation/.rbenv/libexec/rbenv exec bundle exec ruby /home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/ruby-debug-ide-0.8.0.beta19/bin/rdebug-ide --key-value --step-over-in-blocks --disable-int-handler --evaluation-timeout 10 --evaluation-control --time-limit 100 --memory-limit 0 --rubymine-protocol-extensions --port 41145 --host 0.0.0.0 --dispatcher-port 37297 -- /home/workstation/.rbenv/versions/2.7.0/bin/rspec /home/workstation/workspace/railsprojects/labx/spec/requests/api/v1/sellers_request_spec.rb --require teamcity/spec/runner/formatter/teamcity/formatter --format 'Spec::Runner::Formatter::TeamcityFormatter' --example 'Api::V1::Sellers POST register'"
/home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/debase-0.3.0.beta19/lib/debase.rb:7:in `require': cannot load such file -- debase_internals (LoadError)
from /home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/debase-0.3.0.beta19/lib/debase.rb:7:in `<top (required)>'
from /home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/ruby-debug-ide-0.8.0.beta19/lib/ruby-debug-ide.rb:9:in `require'
from /home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/ruby-debug-ide-0.8.0.beta19/lib/ruby-debug-ide.rb:9:in `<top (required)>'
from /home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/ruby-debug-ide-0.8.0.beta19/bin/rdebug-ide:8:in `require_relative'
from /home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/ruby-debug-ide-0.8.0.beta19/bin/rdebug-ide:8:in `<main>'
Process finished with exit code 1
Versions
ruby: 2.7.0, rspec-rails: 4.0.0.pre, rails: 6-0-stable, Rubymine
2019.3.1
Only debug is failing if I run tests normally without debug it works fine. What could be the issue?

Dynamically bootstrapping Bare-Metal Nodes to Chef during Kickstart Post Script

I'm working on some automation to build my bare-metal hosts. The automation goes through a kickstart script to install CentOS 7.3, wrapping up by running some post-kickstart install scripts. One of these scripts does the necessary work to install the Chef package, copy over the certs I need, generate the appropriate files, join the node the the org, place it in an appropriate environment and role and then finally run a chef-client.
Everything seems to be working up until I get to the point where I run my chef-client --once command, which is failing on its first run. When I manually login to the box after the fact and run a manual chef-client, I have no issue, runs just fine. The only thing in my run-list is chef-client::default and chef-client::config. Chef Version 19.33.36.
Here is the snippet of bash code where I am bootstrapping to my org and then running chef-client:
cd /opt/chef/bin/
chef-client -c /etc/chef/client.rb
echo "---------------------------------------" >> /tmp/build.log
echo "chef-client -c /etc/chef/client.rb" >> /tmp/build.log
echo "---------------------------------------" >> /tmp/build.log
(cd /etc/chef && /usr/bin/knife node environment set $HOST $CHEF_ENV)
echo "---------------------------------------" >> /tmp/build.log
echo "/usr/bin/knife node environment set $HOST $CHEF_ENV" >> /tmp/build.log
echo "---------------------------------------" >> /tmp/build.log
(cd /etc/chef && /usr/bin/knife node run_list set $HOST role[$CHEF_ROLE])
echo "---------------------------------------" >> /tmp/build.log
echo "/usr/bin/knife node run_list set $HOST role[$CHEF_ROLE]" >>
/tmp/build.log
echo "---------------------------------------" >> /tmp/build.log
CHEF_RUN_OUTPUT=`chef-client --once`
echo "---------------------------------------" >> /tmp/build.log
echo "chef-client --once" >> /tmp/build.log
echo "---------------------------------------" >> /tmp/build.log
echo $CHEF_RUN_OUTPUT >> /tmp/build.log
Here is the log of what is occurring after my post script finishes:
From /var/log/chef/client.log:
[2017-08-18T10:51:51-05:00] INFO: Processing directory[/var/run/chef] action create (chef-client::systemd_service line 56)
[2017-08-18T10:51:51-05:00] INFO: directory[/var/run/chef] created directory /var/run/chef
[2017-08-18T10:51:51-05:00] INFO: directory[/var/run/chef] owner changed to 0
[2017-08-18T10:51:51-05:00] INFO: directory[/var/run/chef] group changed to 0
[2017-08-18T10:51:51-05:00] INFO: Processing directory[/var/cache/chef] action create (chef-client::systemd_service line 56)
[2017-08-18T10:51:51-05:00] INFO: directory[/var/cache/chef] created directory /var/cache/chef
[2017-08-18T10:51:51-05:00] INFO: directory[/var/cache/chef] owner changed to 0
[2017-08-18T10:51:51-05:00] INFO: directory[/var/cache/chef] group changed to 0
[2017-08-18T10:51:51-05:00] INFO: Processing directory[/var/lib/chef] action create (chef-client::systemd_service line 56)
[2017-08-18T10:51:51-05:00] INFO: directory[/var/lib/chef] created directory /var/lib/chef
[2017-08-18T10:51:51-05:00] INFO: directory[/var/lib/chef] owner changed to 0
[2017-08-18T10:51:51-05:00] INFO: directory[/var/lib/chef] group changed to 0
[2017-08-18T10:51:51-05:00] INFO: Processing directory[/var/log/chef] action create (chef-client::systemd_service line 56)
[2017-08-18T10:51:51-05:00] INFO: Processing directory[/etc/chef] action create (chef-client::systemd_service line 56)
[2017-08-18T10:51:51-05:00] INFO: Processing template[/etc/sysconfig/chef-client] action create (chef-client::systemd_service line 27)
[2017-08-18T10:51:51-05:00] INFO: template[/etc/sysconfig/chef-client] created file /etc/sysconfig/chef-client
[2017-08-18T10:51:51-05:00] INFO: template[/etc/sysconfig/chef-client] updated file contents /etc/sysconfig/chef-client
[2017-08-18T10:51:51-05:00] INFO: template[/etc/sysconfig/chef-client] mode changed to 644
[2017-08-18T10:51:51-05:00] INFO: Processing systemd_unit[chef-client.service] action create (chef-client::systemd_service line 56)
[2017-08-18T10:51:51-05:00] INFO: Processing file[/etc/systemd/system/chef-client.service] action create (dynamically defined)
[2017-08-18T10:51:51-05:00] INFO: Running queued delayed notifications before re-raising exception
[2017-08-18T10:51:51-05:00] INFO: template[/etc/sysconfig/chef-client] sending restart action to service[chef-client] (delayed)
[2017-08-18T10:51:51-05:00] INFO: Processing service[chef-client] action restart (chef-client::systemd_service line 62)
[2017-08-18T10:51:51-05:00] INFO: service[chef-client] restarted
[2017-08-18T10:51:51-05:00] ERROR: Running exception handlers
[2017-08-18T10:51:51-05:00] ERROR: Exception handlers complete
[2017-08-18T10:51:51-05:00] INFO: Sending resource update report (run-id: 2a04bb13-bd0e-4fec-b6e0-093bd0bb3ab7)
[2017-08-18T10:51:51-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2017-08-18T10:51:51-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-08-18T10:51:51-05:00] ERROR: systemd_unit[chef-client.service] (chef-client::systemd_service line 56) had an error: Chef::Exceptions::ValidationFailed: file[/etc/systemd/system/chef-client.service] (dynamically defined) had an error: Chef::Exceptions::ValidationFailed: Proposed content for /etc/systemd/system/chef-client.service failed verification #<Chef::Resource::File::Verification:0x000000028b2200>
[2017-08-18T10:51:51-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
From the chef-stacktrace.out:
>>>> Caused by Chef::Exceptions::ValidationFailed: Proposed content for /etc/systemd/system/chef-client.service failed verification #<Chef::Resource::File::Verification:0x000000028b2200>
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider/file.rb:352:in `block in do_validate_content'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider/file.rb:350:in `each'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider/file.rb:350:in `do_validate_content'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider/file.rb:151:in `action_create'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider.rb:145:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/resource.rb:622:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider/systemd_unit.rb:198:in `manage_unit_file'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider/systemd_unit.rb:60:in `block in action_create'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/mixin/why_run.rb:52:in `add_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider.rb:176:in `converge_by'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider/systemd_unit.rb:59:in `action_create'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider.rb:145:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/resource.rb:622:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/runner.rb:69:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/runner.rb:97:in `block (2 levels) in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/runner.rb:97:in `each'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/runner.rb:97:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/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.33/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.33/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/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.33/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.33/lib/chef/runner.rb:96:in `converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/client.rb:670:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/client.rb:665:in `catch'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/client.rb:665:in `converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/client.rb:704:in `converge_and_save'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/client.rb:284:in `run'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application.rb:295:in `block in fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application.rb:283:in `fork'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application.rb:283:in `fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application.rb:248:in `block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/local_mode.rb:44:in `with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application.rb:236:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/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.33/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.33/lib/chef/application/client.rb:450:in `loop'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application/client.rb:450:in `interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application/client.rb:434:in `run_application'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application.rb:59:in `run'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/bin/chef-client:26:in `<top (required)>'
/usr/bin/chef-client:57:in `load'
Adding in the chef-client -l debug level logs for further analysis:
[2017-08-23T11:11:19-05:00] DEBUG: Initiating POST to https://chef001/organizations/baremetal-sh-npe/reports/nodes/node/runs/61604df2-38ea-4d3d-9be3-3d93ef8187bc
[2017-08-23T11:11:19-05:00] DEBUG: ---- HTTP Request Header Data: ----
[2017-08-23T11:11:19-05:00] DEBUG: X-Ops-Reporting-Protocol-Version: 0.1.0
[2017-08-23T11:11:19-05:00] DEBUG: Content-Encoding: gzip
[2017-08-23T11:11:19-05:00] DEBUG: X-Ops-Server-API-Version: 1
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-SIGN: algorithm=sha1;version=1.1;
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-USERID: t9301bmh1001
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-TIMESTAMP: 2017-08-23T16:11:19Z
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-CONTENT-HASH: khFZ3GcjogWXzfxs5/c8VQOIK/0=
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-AUTHORIZATION-1: A3v+4H3vj4baFTprTLXLW9rEUP5qOSu95VC3oXJi8A0GUPqP8D1JK+Fn4C/k
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-AUTHORIZATION-2: Mksf+LkEIyV+RpNZ/qoRUFeKk90HIViK6+bU31GAkZLArr0aNJHEaBQTOmq7
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-AUTHORIZATION-3: zEWHWKHPDdw7coQ4VSi/uqQML20K2fSB5e5mRffnqdHu8cYafmzOEXM/dBcR
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-AUTHORIZATION-4: ozK/ATHfxqK/h3PpEdetfNDRsoLF3z2dsNeBepArtOkpVbi900UkANib1CFD
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-AUTHORIZATION-5: K4nMY8HbS6SLAjzwZR9+k6WojXwM5Ea5w5o5QKfAvLyAvQJjjOBRh1IIPC+m
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-AUTHORIZATION-6: mnggHfPZWY3Nat12n6DVR/dFz+xStrPe7P799ZHivA==
[2017-08-23T11:11:19-05:00] DEBUG: HOST: chef001.target.com:443
[2017-08-23T11:11:19-05:00] DEBUG: X-REMOTE-REQUEST-ID: 61604df2-38ea-4d3d-9be3-3d93ef8187bc
[2017-08-23T11:11:19-05:00] DEBUG: Content-Length: 2092
[2017-08-23T11:11:19-05:00] DEBUG: ---- End HTTP Request Header Data ----
[2017-08-23T11:11:19-05:00] DEBUG: ---- HTTP Status and Header Data: ----
[2017-08-23T11:11:19-05:00] DEBUG: HTTP 1.1 200 OK
[2017-08-23T11:11:19-05:00] DEBUG: server: openresty/1.11.2.1
[2017-08-23T11:11:19-05:00] DEBUG: date: Wed, 23 Aug 2017 16:11:19 GMT
[2017-08-23T11:11:19-05:00] DEBUG: content-type: application/json
[2017-08-23T11:11:19-05:00] DEBUG: content-length: 2
[2017-08-23T11:11:19-05:00] DEBUG: connection: close
[2017-08-23T11:11:19-05:00] DEBUG: ---- End HTTP Status/Header Data ----
[2017-08-23T11:11:19-05:00] DEBUG: Audit Reports are disabled. Skipping sending reports.
[2017-08-23T11:11:19-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2017-08-23T11:11:19-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-08-23T11:11:19-05:00] DEBUG: Chef::Exceptions::ValidationFailed: systemd_unit[chef-client.service] (chef-client::systemd_service line 56) had an error: Chef::Exceptions::ValidationFailed: file[/etc/systemd/system/chef-client.service] (dynamically defined) had an error: Chef::Exceptions::Valida tionFailed: Proposed content for /etc/systemd/system/chef-client.service failed verification #<Chef::Resource::File::Verification:0x000000063fa808>
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/file.rb:352:in `block in do_validate_content'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/file.rb:350:in `each'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/file.rb:350:in `do_validate_content'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/file.rb:151:in `action_create'
/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/provider/systemd_unit.rb:198:in `manage_unit_file'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/systemd_unit.rb:60:in `block in action_create'
/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'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/systemd_unit.rb:59:in `action_create'
/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)>'
/usr/bin/chef-client:57:in `load'
/usr/bin/chef-client:57:in `<main>'
>>>> Caused by Chef::Exceptions::ValidationFailed: Proposed content for /etc/systemd/system/chef-client.service failed verification #<Chef::Resource:: File::Verification:0x000000063fa808>
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/file.rb:352:in `block in do_validate_content'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/file.rb:350:in `each'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/file.rb:350:in `do_validate_content'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/file.rb:151:in `action_create'
/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/provider/systemd_unit.rb:198:in `manage_unit_file'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/systemd_unit.rb:60:in `block in action_create'
/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'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/systemd_unit.rb:59:in `action_create'
/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)>'
/usr/bin/chef-client:57:in `load'
/usr/bin/chef-client:57:in `<main>'
[2017-08-23T11:11:19-05:00] ERROR: systemd_unit[chef-client.service] (chef-client::systemd_service line 56) had an error: Chef::Exceptions::Validation Failed: file[/etc/systemd/system/chef-client.service] (dynamically defined) had an error: Chef::Exceptions::ValidationFailed: Proposed content for /et c/systemd/system/chef-client.service failed verification #<Chef::Resource::File::Verification:0x000000063fa808>
[2017-08-23T11:11:20-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Any thoughts on why my first run is going south? My intention is to have the node placed in it's appropriate env and role, and then for the box to run all the appropriate recipes associated with the env/role.
Thanks!
You would need to use the full path, but just use knife bootstrap and it will take care of this.

Chef install of readline package fails on Ubuntu 14.04

I am trying get PostgreSQL (server) installed on an Ubuntu node using Chef:
Role definition (roles/base_server.rb):
run_list(
"recipe[apt]",
"recipe[postgres::server]"
)
default_attributes(
postgresql: {
version: "9.3.4",
config: {
shared_buffers_mb: "12000"
}
}
Setup
System: Ubuntu 14.04 LTS (GNU/Linux 3.13.0-24-generic x86_64)
Chef-Version: 11.14.6
Postgres Cookbook: [3.4.1] (https://github.com/hw-cookbooks/postgresql)
Running the bootstrap command
knife bootstrap IPADDRESS -x USER -r 'role[base_server]' --sudo
Results in the following error:
* package[readline] action install
* No version specified, and no candidate version available for readline
================================================================================
Error executing action `install` on resource 'package[readline]'
================================================================================
Chef::Exceptions::Package
-------------------------
No version specified, and no candidate version available for readline
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/postgres/recipes/build.rb
29: package package_name do
30: action :install
31: end
32: end
Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/postgres/recipes/build.rb:29:in `block in from_file'
package("readline") do
action [:install]
retries 0
retry_delay 2
guard_interpreter :default
package_name "readline"
timeout 900
cookbook_name "postgres"
recipe_name "build"
end
I already tried to fix this by installing the readline libraries manually, but no success. Has anyone an idea how to solve this?
As mentioned by StephenKing, the issue isn't with Chef, it is that the package really doesn't exist. You'll need to fix your recipe code to use the correct package name.

Chef-Solo "undefined method `[]' for nil:NilClass"

I just installed a fresh CentOS 6.3 VM and disabled SELinux. Below is the exact script that I ran to install Ruby, Chef Solo, and attempted to provision the VM:
#!/bin/bash
#
# Install Chef-Solo if it doesn't exist, then provision the server.
#
CHEF_FILE="https://dl.dropbox.com/u/4204671/LiquidCompass/lc-chef.tar.gz"
if [ "$#" -eq 0 ]; then
echo "You must provide the type of server this is. (Eg: production-api, qa-api, development)"
exit 1
fi
if [ ! -x "/usr/bin/chef-solo" ]; then
rpm -Uvh http://rbel.frameos.org/rbel6
yum install -y ruby ruby-devel ruby-ri ruby-rdoc ruby-shadow gcc gcc-c++ automake autoconf make curl dmidecode
cd /tmp
curl -O http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz
tar zxf rubygems-1.8.10.tgz
cd rubygems-1.8.10
ruby setup.rb --no-format-executable
gem install chef --no-ri --no-rdoc
fi
if [ -d "/etc/chef" ]; then
rm -rf /etc/chef
fi
if [ -d "/tmp/lc-chef" ]; then
rm -rf /tmp/lc-chef*
fi
mkdir /etc/chef
echo "file_cache_path \"/tmp/lc-chef/chef-solo\"
cookbook_path \"/tmp/lc-chef/cookbooks\"
role_path \"/tmp/lc-chef/roles\"
json_attribs \"/etc/chef/node.json\"" > /etc/chef/solo.rb
echo "{
\"name\": \"$1\",
\"normal\": {
\"company\": \"Liquid Compass LLC\",
\"tags\": []
},
\"chef_environment\": \"_default\",
\"run_list\": [
\"role[$1]\"
]
}" > /etc/chef/node.json
cd /tmp
curl -O $CHEF_FILE
tar zxf lc-chef.tar.gz
chef-solo -c /etc/chef/solo.rb
Unfortunately, right as the script runs I receive:
[2012-12-05T17:39:27-07:00] INFO: Start handlers complete.
================================================================================
Recipe Compile Error in /tmp/lc-chef/cookbooks/liquidcompass/recipes/php.rb
================================================================================
NoMethodError
-------------
undefined method `[]' for nil:NilClass
Cookbook Trace:
---------------
/tmp/lc-chef/cookbooks/liquidcompass/recipes/php.rb:20:in `from_file'
Relevant File Content:
----------------------
/tmp/lc-chef/cookbooks/liquidcompass/recipes/php.rb:
13: # Unless required by applicable law or agreed to in writing, software
14: # distributed under the License is distributed on an "AS IS" BASIS,
15: # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16: # See the License for the specific language governing permissions and
17: # limitations under the License.
18: #
19:
20>> php_url = "http://us.php.net/distributions/php-#{node['php']['version']}.tar.gz"
21: node.set['php']['prefix'] = "/opt/php-#{node['php']['version']}"
22: node.set['php']['conf_path'] = "#{node['php']['dir']}/php.ini"
23: node.set['php']['configure_flags'] = [
24: "--prefix=#{node['php']['prefix']}",
25: "--with-config-file-path=#{node['php']['dir']}",
26: "--with-config-file-scan-dir=#{node['php']['dir']}/conf.d",
27: "--with-curl",
28: "--with-pear",
29: "--with-gd",
So it looks like it's choking on trying to load node['php']['version']. This is defined in my /tmp/lc-chef/cookbooks/liquidcompass/attributes/default.rb with:
default['php']['version'] = "5.4.9"
So it appears that Chef is either not loading the attributes file, or something else is wrong. Not exactly sure how to find this out or not.
Running:
RubyGems 1.8.10
Chef 10.16.2
Best regards,
Andrew
By the way, this is the stack trace:
Generated at Wed Dec 05 17:39:27 -0700 2012
NoMethodError: undefined method `[]' for nil:NilClass
/tmp/lc-chef/cookbooks/liquidcompass/recipes/php.rb:20:in `from_file'
/usr/lib64/ruby/gems/1.8/gems/chef-10.16.2/bin/../lib/chef/cookbook_version.rb:558:in `load_recipe'
/usr/lib64/ruby/gems/1.8/gems/chef-10.16.2/bin/../lib/chef/mixin/language_include_recipe.rb:46:in `load_recipe'
/usr/lib64/ruby/gems/1.8/gems/chef-10.16.2/bin/../lib/chef/mixin/language_include_recipe.rb:33:in `include_recipe'
/usr/lib64/ruby/gems/1.8/gems/chef-10.16.2/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `each'
/usr/lib64/ruby/gems/1.8/gems/chef-10.16.2/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `include_recipe'
/usr/lib64/ruby/gems/1.8/gems/chef-10.16.2/bin/../lib/chef/run_context.rb:79:in `load'
/usr/lib64/ruby/gems/1.8/gems/chef-10.16.2/bin/../lib/chef/run_context.rb:75:in `each'
/usr/lib64/ruby/gems/1.8/gems/chef-10.16.2/bin/../lib/chef/run_context.rb:75:in `load'
/usr/lib64/ruby/gems/1.8/gems/chef-10.16.2/bin/../lib/chef/client.rb:198:in `setup_run_context'
/usr/lib64/ruby/gems/1.8/gems/chef-10.16.2/bin/../lib/chef/client.rb:418:in `do_run'
/usr/lib64/ruby/gems/1.8/gems/chef-10.16.2/bin/../lib/chef/client.rb:176:in `run'
/usr/lib64/ruby/gems/1.8/gems/chef-10.16.2/bin/../lib/chef/application.rb:140:in `run_chef_client'
/usr/lib64/ruby/gems/1.8/gems/chef-10.16.2/bin/../lib/chef/application/solo.rb:224:in `run_application'
/usr/lib64/ruby/gems/1.8/gems/chef-10.16.2/bin/../lib/chef/application/solo.rb:216:in `loop'
/usr/lib64/ruby/gems/1.8/gems/chef-10.16.2/bin/../lib/chef/application/solo.rb:216:in `run_application'
/usr/lib64/ruby/gems/1.8/gems/chef-10.16.2/bin/../lib/chef/application.rb:72:in `run'
/usr/lib64/ruby/gems/1.8/gems/chef-10.16.2/bin/chef-solo:25
/usr/bin/chef-solo:19:in `load'
/usr/bin/chef-solo:19
Default attributes work fine in Chef Solo
I'm not sure what's happening inside your cookbook - but it is an issue with your code, not with Chef. As a simple example, check this out:
https://gist.github.com/adamhjk/6141718
chef solo does not support default attributes.
You're going to need to put together a node.json under your nodes directory which lists the attributes in .json form.
So in your case:
{
"php": {
"version": "5.4.9"
}
}
If you want to use default attributes/any attributes in .rb format, you're going to need to use chef-server/chef-client.