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

Failing to create vhost and users #474

Closed
pvandervelde opened this issue Jan 30, 2018 · 3 comments
Closed

Failing to create vhost and users #474

pvandervelde opened this issue Jan 30, 2018 · 3 comments

Comments

@pvandervelde
Copy link

Issue: My cookbook installs RabbitMQ and the management console successfully. Additionally the recipe tries to create 2 vhosts and a user. The Chef run finishes successfully but once RabbitMQ is running the vhost and the user are nowhere to be found.

Version: 5.4.0
Recipe:

#
# INSTALL RABBITMQ
#

include_recipe 'rabbitmq::default'
include_recipe 'rabbitmq::mgmt_console'

service_name = 'rabbitmq-server'
#
# ALLOW RABBITMQ THROUGH THE FIREWALL
#

rabbitmq_http_port = node['rabbitmq']['http_port']
firewall_rule 'rabbitmq-http' do
  command :allow
  description 'Allow RabbitMQ HTTP traffic'
  dest_port rabbitmq_http_port
  direction :in
end

rabbitmq_amqp_port = node['rabbitmq']['amqp_port']
firewall_rule 'rabbitmq-amqp' do
  command :allow
  description 'Allow RabbitMQ AMQP traffic'
  dest_port rabbitmq_amqp_port
  direction :in
end

#
# PLUGINS
#

rabbitmq_plugin 'rabbitmq_auth_backend_ldap' do
  action :enable
end

#
# DEFAULT VHOSTS AND QUEUES
#

logs_vhost = 'logs'
rabbitmq_vhost logs_vhost do
  action :add
end

#
# CONNECT TO CONSUL
#

health_vhost = 'health'
rabbitmq_vhost health_vhost do
  action :add
end

rabbitmq_consul_test_user = 'consul'
rabbitmq_consul_test_password = 'c0nsul'
rabbitmq_user rabbitmq_consul_test_user do
  action :add
  password rabbitmq_consul_test_password
end

rabbitmq_user rabbitmq_consul_test_user do
  action :set_permissions
  permissions '.* .* .*'
  vhost [health_vhost]
end

Attributes:

default['rabbitmq']['version'] = '3.6.15'
default['rabbitmq']['amqp_port'] = 5672
default['rabbitmq']['http_port'] = 15_672

Chef log:

Recipe: rabbitmq::default
  * service[rabbitmq-server] action restart
    - restart service service[rabbitmq-server]
Recipe: rabbitmq::user_management
  * rabbitmq_user[guest] action add (up to date)
  * rabbitmq_user[guest] action set_tags
    * execute[rabbitmqctl set_user_tags guest ] action run
      - execute rabbitmqctl set_user_tags guest

  * rabbitmq_user[guest] action set_permissions (up to date)
Recipe: resource_queue::rabbitmq
  * firewall_rule[rabbitmq-http] action create

  * firewall_rule[rabbitmq-amqp] action create

  * rabbitmq_plugin[rabbitmq_auth_backend_ldap] action enable
    * execute[rabbitmq-plugins enable rabbitmq_auth_backend_ldap] action run
      - execute rabbitmq-plugins enable rabbitmq_auth_backend_ldap

  * rabbitmq_vhost[logs] action add
    * execute[rabbitmqctl add_vhost logs] action run
      - execute rabbitmqctl add_vhost logs

  * rabbitmq_vhost[health] action add
    * execute[rabbitmqctl add_vhost health] action run
      - execute rabbitmqctl add_vhost health

  * rabbitmq_user[consul] action add[2018-01-30T08:19:59+00:00] WARN: /tmp/packer-chef-solo/local-mode-cache/cache/cookbooks/rabbitmq/providers/user.rb:93:in `block (2 levels) in
    class_from_file': property password is declared in both execute[rabbitmqctl add_user consul] and #<#<Class:0x000000054d7d30>:0x000000033fd038>. Use new_resource.password instead. At /tmp/packer-ch
    ef-solo/local-mode-cache/cache/cookbooks/rabbitmq/providers/user.rb:93:in `block (2 levels) in class_from_file'

    * execute[rabbitmqctl add_user consul] action run
      - execute sensitive resource

  * rabbitmq_user[consul] action set_permissions
    * execute[rabbitmqctl set_permissions -p health consul ".*" ".*" ".*"] action run
      - execute rabbitmqctl set_permissions -p health consul ".*" ".*" ".*"

Other than including the default recipe and the mgmt_console recipe is there anything else that needs to be done in order to successfully create a vhost and a user?

@michaelklishin
Copy link
Member

Thank you for your time.

Team RabbitMQ uses GitHub issues for specific actionable items engineers can work on. This assumes two things:

  1. GitHub issues are not used for questions, investigations, root cause analysis, discussions of potential issues, etc (as defined by this team)
  2. We have a certain amount of information to work with

We get at least a dozen of questions through various venues every single day, often quite light on details.
At that rate GitHub issues can very quickly turn into a something impossible to navigate and make sense of even for our team. Because of that questions, investigations, root cause analysis, discussions of potential features are all considered to be mailing list material by our team. Please post this to rabbitmq-users.

Getting all the details necessary to reproduce an issue, make a conclusion or even form a hypothesis about what's happening can take a fair amount of time. Our team is multiple orders of magnitude smaller than the RabbitMQ community. Please help others help you by providing a way to reproduce the behavior you're
observing, or at least sharing as much relevant information as possible on the list:

  • Server, client library and plugin (if applicable) versions used
  • Server logs
  • A code example or terminal transcript that can be used to reproduce
  • Full exception stack traces (not a single line message)
  • rabbitmqctl status (and, if possible, rabbitmqctl environment output)
  • Other relevant things about the environment and workload, e.g. a traffic capture

Feel free to edit out hostnames and other potentially sensitive information.

When/if we have enough details and evidence we'd be happy to file a new issue.

Thank you.

@michaelklishin
Copy link
Member

See server logs and run convergence with Chef client log level set to debug. The resources in this cookbook may require a running node, which you may or may not have at a certain point during deployment. A more convenient way to pre-create vhosts, users, permissions and such is to import a definitions file (introduced in #472).

@michaelklishin
Copy link
Member

Definitions export and import is documented in RabbitMQ guides.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants