Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot_read_enabled_plugins_file - eacces #182

Closed
dpetzel opened this issue Dec 13, 2014 · 5 comments

Comments

Projects
None yet
5 participants
@dpetzel
Copy link

commented Dec 13, 2014

I'm not sure this is specifically an issue with the cookbook, but wanted to at least throw this out here for discussion.

Some systems have restrictive umasks (such as 0077). On these systems we get the exception below.

The umask by itself isn't so much the issue, but its seems the rabbitmq-plugins actually alters the state of this file as you can see in this output. If I alter the umask to 0022 for the current shell and run the command things work well.

So a "fix" could be to set the umask on the execute resource in the provider. Based on the docs it appears this can bet set just for the context of the resource so we wouldn't need to play with the system configured umask.

[root@hostname ~]# ls -alh /etc/rabbitmq/enabled_plugins 
-rw------- 1 root root 23 Dec 13 00:12 /etc/rabbitmq/enabled_plugins
[root@hostname ~]# chmod 644 /etc/rabbitmq/enabled_plugins 
[root@hostname ~]# ls -alh /etc/rabbitmq/enabled_plugins 
-rw-r--r-- 1 root root 23 Dec 13 00:12 /etc/rabbitmq/enabled_plugins
[root@hostname ~]# rabbitmq-plugins enable rabbitmq_management
Plugin configuration unchanged.

Applying plugin configuration to rabbit@hostname... failed.
Error: {cannot_read_enabled_plugins_file,"/etc/rabbitmq/enabled_plugins",
           eacces}
[root@hostname ~]# ls -alh /etc/rabbitmq/enabled_plugins 
-rw------- 1 root root 23 Dec 13 00:14 /etc/rabbitmq/enabled_plugins
       STDERR: Error: {cannot_read_enabled_plugins_file,"/etc/rabbitmq/enabled_plugins",
           eacces}
       ---- End output of rabbitmq-plugins enable rabbitmq_management ----
       Ran rabbitmq-plugins enable rabbitmq_management returned 2


       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cache/cookbooks/rabbitmq/providers/plugin.rb

        35:     execute "rabbitmq-plugins enable #{new_resource.plugin}" do
        36:       Chef::Log.info "Enabling RabbitMQ plugin '#{new_resource.plugin}'."
        37:       environment 'PATH' => "#{ENV['PATH']}:/usr/lib/rabbitmq/bin"
        38:       new_resource.updated_by_last_action(true)
        39:     end
        40:   end



       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/rabbitmq/providers/plugin.rb:35:in `block in class_from_file'

       execute("rabbitmq-plugins enable rabbitmq_management") do
         action "run"
         retries 0
         retry_delay 2
         guard_interpreter :default
         command "rabbitmq-plugins enable rabbitmq_management"
         backup 5
         environment {"PATH"=>"/sbin:/bin:/usr/sbin:/usr/bin:/opt/chef/embedded/bin:/opt/chef/embedded/bin:/usr/local/sbin:/usr/local/bin:/usr/lib/rabbitmq/bin"}
         returns 0
         cookbook_name "rabbitmq"
       end

@cmluciano

This comment has been minimized.

Copy link
Collaborator

commented Feb 26, 2015

Added via #219

@cmluciano

This comment has been minimized.

Copy link
Collaborator

commented Apr 7, 2015

#219 has been merged

@cmluciano cmluciano closed this Apr 7, 2015

@cpanato

This comment has been minimized.

Copy link

commented Mar 24, 2016

I upgraded rabbit to 3.6.1 and I'm getting this error when try to enable the management plugin

Applying plugin configuration to rabbit@cccc... failed
Error: {cannot_read_enabled_plugins_file,"/etc/rabbitmq/enabled_plugins",eacces}

[root@xegvkbr744 panato]# ls -la /etc/rabbitmq/enabled_plugins
-rw-r----- 1 root root 23 Mar 24 15:28 /etc/rabbitmq/enabled_plugins
@michaelklishin

This comment has been minimized.

Copy link
Member

commented Mar 24, 2016

EACCESS is pretty unambiguous: RabbitMQ tries to read /etc/rabbitmq/enabled_plugins (which is an Erlang term file which contains the list of enabled plugins) and fails to do that due to insufficient permissions.

@piyushjalan02

This comment has been minimized.

Copy link

commented Apr 20, 2019

Switch to rabbitmq user and then enable plugin:

$su - rabbitmq
$rabbitmq-plugins enable rabbitmq_management

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.