You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The plugin provider actions send notifications before the plugins are actually enabled/disabled. This is due to new_resource.updated_by_last_action(true) being executed within the execute resource block.
This problem occurs when trying to download rabbitmqadmin utility from the management plugin. To download this util, one must:
enable plugin
restart rabbitmq-server
download the utility from the management plugin webserver on port 15672
Here is my code:
rabbitmq_plugin "rabbitmq_management" do
action :enable
notifies :restart, "service[#{node['rabbitmq']['service_name']}]", :immediately # must restart before we can download
end
remote_file "/usr/local/bin/rabbitmqadmin" do
source "http://localhost:15672/cli/rabbitmqadmin"
mode "0755"
retries 10 # extremely large non-deterministic wait/retry for rabbitmq_management to start serving pages
action :create
end
This code is intermittently failing, with the remote_file giving up after 10 retries. The problem is that the service restart action is occurring before the execute run action. Here is the chef-client output showing the restart happening first:
Recipe: wrapper_cookbook::rabbitmq
* rabbitmq_plugin[rabbitmq_management] action enable
Recipe: rabbitmq::default
* service[rabbitmq-server] action restart
- restart service service[rabbitmq-server]
Recipe: <Dynamically Defined Resource>
* execute[rabbitmq-plugins enable rabbitmq_management] action runThe following plugins have been enabled:
mochiweb
webmachine
rabbitmq_web_dispatch
amqp_client
rabbitmq_management_agent
rabbitmq_management
Plugin configuration has changed. Restart RabbitMQ for changes to take effect.
- execute rabbitmq-plugins enable rabbitmq_management
Recipe: wrapper_cookbook::rabbitmq
* remote_file[/usr/local/bin/rabbitmqadmin] action create
- create new file /usr/local/bin/rabbitmqadmin
================================================================================
Error executing action `create` on resource 'remote_file[/usr/local/bin/rabbitmqadmin]'
================================================================================
Errno::ECONNREFUSED
-------------------
Connection refused - Connection refused connecting to http://localhost:15672/cli/rabbitmqadmin, giving up
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/wrapper_cookbook/recipes/rabbitmq.rb
44: remote_file "/usr/local/bin/rabbitmqadmin" do
45: source "http://localhost:15672/cli/rabbitmqadmin"
46: mode "0755"
47: retries 10 # extremely large non-deterministic wait/retry for rabbitmq_management to start serving pages
48: action :create
49: end
The text was updated successfully, but these errors were encountered:
caryp
pushed a commit
to caryp-contrib/rabbitmq
that referenced
this issue
Sep 17, 2014
tl;dr;
The plugin provider actions send notifications before the plugins are actually enabled/disabled. This is due to
new_resource.updated_by_last_action(true)
being executed within theexecute
resource block.See https://github.com/kennonkwok/rabbitmq/blob/master/providers/plugin.rb#L42
details
This problem occurs when trying to download
rabbitmqadmin
utility from the management plugin. To download this util, one must:Here is my code:
This code is intermittently failing, with the
remote_file
giving up after 10 retries. The problem is that theservice
restart action is occurring before theexecute
run action. Here is the chef-client output showing the restart happening first:The text was updated successfully, but these errors were encountered: