Bug 1175428

Summary: packstack doesn't configure rabbitmq to allow non-localhost connections to 'guest' user
Product: [Community] RDO Reporter: Richard W.M. Jones <rjones>
Component: openstack-packstackAssignee: Lukas Bezdicka <lbezdick>
Status: CLOSED CURRENTRELEASE QA Contact: yeylon <yeylon>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: aortega, derekh, ichavero, lbezdick, srevivo, yeylon
Target Milestone: ---   
Target Release: Juno   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-packstack-2014.2-0.13.dev1395.gaabe0a2.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-30 23:10:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Richard W.M. Jones 2014-12-17 17:57:59 UTC
Description of problem:

In Rawhide, packstack incorrectly configures rabbitmq.  Since
rabbitmq 3.3.0, the 'guest' user is only allowed to connect
from localhost by default.  Since packstack doesn't adjust the
configuration properly, this means that it won't work with this
new version of rabbitmq.

As a result you see lots of errors like this in the rabbitmq
logs:

=ERROR REPORT==== 17-Dec-2014::17:52:49 ===
closing AMQP connection <0.430.0> (192.168.122.121:55486 -> 192.168.122.121:5672):
{handshake_error,starting,0,
                 {amqp_error,access_refused,
                             "AMQPLAIN login refused: user 'guest' can only connect via localhost",
                             'connection.start_ok'}}

and lots of errors like this in the cinder logs:

2014-12-17 17:53:18.453 6257 ERROR oslo.messaging._drivers.impl_rabbit [req-6135f15d-4b02-48f0-a8e7-a371cfcfbbd4 f074021e0d2d43619faf471ec24b34b3 d204b5453655422bbac00b8090fe8f9f - - -] AMQP server 192.168.122.121:5672 closed the connection. Check login credentials: Socket closed

The bug and fixes are described here:

https://ask.openstack.org/en/question/48329/openstack-juno-using-rdo-fails-installation-amqp-server-closed-the-connection/
https://bugs.launchpad.net/devstack/+bug/1343354

Version-Release number of selected component (if applicable):

rabbitmq-server-3.4.2-1.fc22.noarch
openstack-packstack-2014.2-0.12.dev1370.ge46bee1.fc22.noarch

How reproducible:

100%

Steps to Reproduce:
1. Run 'packstack --allinone'

Workaround:

After packstack fails, manually edit /etc/rabbitmq/rabbitmq.config
removing everything and adding just:

[
  {rabbit, [{loopback_users, []}]}
].

Then do:

sudo systemctl restart rabbitmq-server

and continue packstack.

Comment 1 Richard W.M. Jones 2014-12-17 18:16:45 UTC
Also a good idea to chattr -i /etc/rabbitmq/rabbitmq.config
so that puppet cannot change it back again.

It would be good to get a more permanent fix for this ...

Comment 2 Richard W.M. Jones 2014-12-17 18:29:02 UTC
Make that:

chattr +i /etc/rabbitmq/rabbitmq.config

Comment 3 Richard W.M. Jones 2014-12-17 18:36:00 UTC
The proper fix was to add the line marked with a '+' sign to
/usr/lib/python2.7/site-packages/packstack/puppet/templates/amqp.pp :

  class { 'rabbitmq':
    port                => hiera('CONFIG_AMQP_CLIENTS_PORT'),
    ssl_management_port => hiera('CONFIG_AMQP_SSL_PORT'),
    ssl                 => hiera('CONFIG_AMQP_ENABLE_SSL'),
    ssl_cert            => hiera('CONFIG_AMQP_SSL_CERT_FILE'),
    ssl_key             => hiera('CONFIG_AMQP_SSL_KEY_FILE'),
    default_user        => hiera('CONFIG_AMQP_AUTH_USER'),
    default_pass        => hiera('CONFIG_AMQP_AUTH_PASSWORD'),
    package_provider    => 'yum',
    admin_enable        => false,
    config_variables    => {
        'tcp_listen_options'  => "[binary,{packet, raw},{reuseaddr, true},{backlog, 128},{nodelay, true},{exit_on_close, false},{keepalive, true}]",
+	'loopback_users' => "[]"
    }