Failed dependency on chef_handler module
We might have an issue while provisioning boxes that use this very same module, which has chef_handler
external module as a dependency.
The problem is that Chef tries to access a non-existing directory:
Recipe: gitlab-prometheus::chef_client
* chef_gem[prometheus-client] action install[2017-06-23T12:00:01+00:00] INFO: Processing chef_gem[prometheus-client] action install (gitlab-prometheus::chef_client line 10)
(up to date)
* cookbook_file[/var/chef/handlers/prometheus_handler.rb] action create[2017-06-23T12:00:02+00:00] INFO: Processing cookbook_file[/var/chef/handlers/prometheus_handler.rb] action create (gitlab-prometheus::chef_client line 16)
* Parent directory /var/chef/handlers does not exist.
================================================================================
Error executing action `create` on resource 'cookbook_file[/var/chef/handlers/prometheus_handler.rb]'
================================================================================
Chef::Exceptions::EnclosingDirectoryDoesNotExist
------------------------------------------------
Parent directory /var/chef/handlers does not exist.
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/gitlab-prometheus/recipes/chef_client.rb:20:in `from_file'
/var/chef/cache/cookbooks/gitlab-prometheus/recipes/node_exporter.rb:3:in `from_file'
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/gitlab-prometheus/recipes/chef_client.rb
16: cookbook_file path do
17: source handler
18: mode '0755'
19: action :nothing
20: end.run_action(:create)
21:
22: chef_handler 'PrometheusHandler' do
23: source path
24: arguments textfile
25: action :nothing
26: end.run_action(:enable)
Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/gitlab-prometheus/recipes/chef_client.rb:16:in `from_file'
cookbook_file("/var/chef/handlers/prometheus_handler.rb") do
provider Chef::Provider::CookbookFile
action [:nothing]
retries 0
retry_delay 2
default_guard_interpreter :default
source "prometheus_handler.rb"
declared_type :cookbook_file
cookbook_name "gitlab-prometheus"
recipe_name "chef_client"
owner nil
group nil
mode "0755"
path "/var/chef/handlers/prometheus_handler.rb"
verifications []
end
Platform:
---------
x86_64-linux
================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/gitlab-prometheus/recipes/node_exporter.rb
================================================================================
Chef::Exceptions::EnclosingDirectoryDoesNotExist
------------------------------------------------
cookbook_file[/var/chef/handlers/prometheus_handler.rb] (gitlab-prometheus::chef_client line 16) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /var/chef/handlers does not exist.
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/gitlab-prometheus/recipes/chef_client.rb:20:in `from_file'
/var/chef/cache/cookbooks/gitlab-prometheus/recipes/node_exporter.rb:3:in `from_file'
Relevant File Content:
----------------------
/var/chef/cache/cookbooks/gitlab-prometheus/recipes/chef_client.rb:
13:
14: # `run_action` causes this to be executed in the first phase of the chef-client
15: # run, so that the handler is installed as soon as possible.
16: cookbook_file path do
17: source handler
18: mode '0755'
19: action :nothing
20>> end.run_action(:create)
21:
22: chef_handler 'PrometheusHandler' do
23: source path
24: arguments textfile
25: action :nothing
26: end.run_action(:enable)
27:
Platform:
---------
x86_64-linux
Running handlers:
[2017-06-23T12:00:02+00:00] ERROR: Running exception handlers
Running handlers complete
[2017-06-23T12:00:02+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 15 seconds
[2017-06-23T12:00:02+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2017-06-23T12:00:02+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-06-23T12:00:02+00:00] ERROR: cookbook_file[/var/chef/handlers/prometheus_handler.rb] (gitlab-prometheus::chef_client line 16) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /var/chef/handlers does not exist.
[2017-06-23T12:00:02+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
A few hours ago an issue was also created for that very same problem on the main cookbook
: