Looks like after Deep Merge some resource/attributes are lost during provider execution, which broke recipe execution at all. In my case it's ssl_key_file and ssl_cert_file attributes.
I'm using postgresql 9.1 and chef-client v11.18.12, and main problem is nil param during symlink resource:
[2015-09-23T15:49:37+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2015-09-23T15:49:37+00:00] ERROR: postgresql[main] (paymantix::postgresql-slave line 84) had an error: TypeError: link[/var/lib/postgresql/9.1/main/server.key] (/var/chef/cache/cookbooks/postgresql_lwrp/providers/default.rb line 208) had an error: TypeError: can't convert nil into String
Stack trace:
Generated at 2015-09-23 15:49:37 +0000
TypeError: postgresql[main] (paymantix::postgresql-slave line 84) had an error: TypeError: link[/var/lib/postgresql/9.1/main/server.key] (/var/chef/cache/cookbooks/postgresql_lwrp/providers/default.rb line 208) had an error: TypeError: can't convert nil into String
/opt/chef/embedded/apps/chef/lib/chef/provider/link.rb:101:in `symlink'
/opt/chef/embedded/apps/chef/lib/chef/provider/link.rb:101:in `block in action_create'
/opt/chef/embedded/apps/chef/lib/chef/mixin/why_run.rb:52:in `call'
/opt/chef/embedded/apps/chef/lib/chef/mixin/why_run.rb:52:in `add_action'
/opt/chef/embedded/apps/chef/lib/chef/provider.rb:156:in `converge_by'
/opt/chef/embedded/apps/chef/lib/chef/provider/link.rb:100:in `action_create'
/opt/chef/embedded/apps/chef/lib/chef/provider.rb:121:in `run_action'
/opt/chef/embedded/apps/chef/lib/chef/resource.rb:648:in `run_action'
/opt/chef/embedded/apps/chef/lib/chef/runner.rb:49:in `run_action'
/opt/chef/embedded/apps/chef/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/opt/chef/embedded/apps/chef/lib/chef/runner.rb:81:in `each'
/opt/chef/embedded/apps/chef/lib/chef/runner.rb:81:in `block in converge'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection.rb:98:in `block in execute_each_resource'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection.rb:96:in `execute_each_resource'
/opt/chef/embedded/apps/chef/lib/chef/runner.rb:80:in `converge'
/opt/chef/embedded/apps/chef/lib/chef/provider/lwrp_base.rb:61:in `recipe_eval_with_update_check'
/opt/chef/embedded/apps/chef/lib/chef/provider/lwrp_base.rb:45:in `block in action'
/opt/chef/embedded/apps/chef/lib/chef/provider.rb:125:in `run_action'
/opt/chef/embedded/apps/chef/lib/chef/resource.rb:648:in `run_action'
/opt/chef/embedded/apps/chef/lib/chef/runner.rb:49:in `run_action'
/opt/chef/embedded/apps/chef/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/opt/chef/embedded/apps/chef/lib/chef/runner.rb:81:in `each'
/opt/chef/embedded/apps/chef/lib/chef/runner.rb:81:in `block in converge'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection.rb:98:in `block in execute_each_resource'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection.rb:96:in `execute_each_resource'
/opt/chef/embedded/apps/chef/lib/chef/runner.rb:80:in `converge'
/opt/chef/embedded/apps/chef/lib/chef/client.rb:345:in `converge'
/opt/chef/embedded/apps/chef/lib/chef/client.rb:431:in `do_run'
/opt/chef/embedded/apps/chef/lib/chef/client.rb:213:in `block in run'
/opt/chef/embedded/apps/chef/lib/chef/client.rb:207:in `fork'
/opt/chef/embedded/apps/chef/lib/chef/client.rb:207:in `run'
/opt/chef/embedded/apps/chef/lib/chef/application.rb:236:in `run_chef_client'
/opt/chef/embedded/apps/chef/lib/chef/application/client.rb:338:in `block in run_application'
/opt/chef/embedded/apps/chef/lib/chef/application/client.rb:327:in `loop'
/opt/chef/embedded/apps/chef/lib/chef/application/client.rb:327:in `run_application'
/opt/chef/embedded/apps/chef/lib/chef/application.rb:55:in `run'
/opt/chef/embedded/apps/chef/bin/chef-client:26:in `<top (required)>'
/usr/bin/chef-client:38:in `load'
/usr/bin/chef-client:38:in `<main>'
I add some logs output for debugging default provider near link, and i notice that ssl attributes lost after Deep Merge, here's code which i added before link resources:
...
not_if { ::File.exist?("/var/lib/postgresql/#{cluster_version}/#{cluster_name}/base") }
end
end
log("#{configuration['ssl_key_file']}")
log("#{configuration['ssl_cert_file']}")
log(node['postgresql']['defaults']['server']['configuration'])
log(new_resource.configuration)
log(configuration)
link "/var/lib/postgresql/#{cluster_version}/#{cluster_name}/server.key" do
to configuration['ssl_key_file']
not_if { cluster_version.to_f > 9.1 && ::File.exist?("/var/lib/postgresql/#{cluster_version}/#{cluster_name}/server.key") }
end
link "/var/lib/postgresql/#{cluster_version}/#{cluster_name}/server.crt" do
...
You can notice that attributes node['postgresql']['defaults']['server']['configuration'] have ssl_key_file and ssl_cert_file attributes values, we don't override it on resources and after merge there are no ssl_key_file and ssl_cert_file params at all.
I even try to set key file and cert resources into lwrp, in logs they are exists as attributes (as defaults), also in my lwrp resources (overridden) and after merge there are no attributes at all.
Hi!
Looks like after Deep Merge some resource/attributes are lost during provider execution, which broke recipe execution at all. In my case it's ssl_key_file and ssl_cert_file attributes.
I'm using postgresql 9.1 and chef-client v11.18.12, and main problem is nil param during symlink resource:
Stack trace:
I add some logs output for debugging default provider near link, and i notice that ssl attributes lost after Deep Merge, here's code which i added before link resources:
Here is output of each log execution
You can notice that attributes node['postgresql']['defaults']['server']['configuration'] have ssl_key_file and ssl_cert_file attributes values, we don't override it on resources and after merge there are no ssl_key_file and ssl_cert_file params at all.
I even try to set key file and cert resources into lwrp, in logs they are exists as attributes (as defaults), also in my lwrp resources (overridden) and after merge there are no attributes at all.