transport_url without trailing '/' considered virtual host 'None'

Bug #1798241 reported by Eric K
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.messaging
Fix Released
High
Ken Giusti

Bug Description

It appears that in oslo-messaging 9.0.1, a transport_url without trailing '/' gets interpreted as virtual host 'None' and leads to connection refusal. I'm not sure whether this is a bug or intended behavior, but it does appear to be a new behavior beginning in 9.0.1.

The new behavior appears to be introduced by this change:
https://github.com/openstack/oslo.messaging/commit/b0d3bfceb8ea5d2574651e24e347be55f63c3fca?diff=split#diff-0dabf284596ae79f183fc9eee20b4d9cL493

Specifically in the referenced line, where a ```url.virtual_host is None``` case previously took the default value of '/' from the rabbit_virtual_host option, now it gets cast into the string 'None'.

Here's an example failure from Congress gate:
Congress log:
ERROR oslo.messaging._drivers.impl_rabbit [-] Unable to connect to AMQP server on 149.202.175.37:5672 after inf tries: Connection.open: (530) NOT_ALLOWED - access to vhost 'None' refused for user 'stackrabbit': NotAllowed: Connection.open: (530) NOT_ALLOWED - access to vhost 'None' refused for user 'stackrabbit'
(http://logs.openstack.org/67/609767/1/check/congress-devstack-api-mysql/dfd6391/logs/screen-congress-api.txt.gz#_Oct_11_17_49_37_422957)

Rabbitmq log:
=ERROR REPORT==== 11-Oct-2018::17:49:37 ===
Error on AMQP connection <0.2389.0> (149.202.175.37:34424 -> 149.202.175.37:5672 - congress-server:4570:4cacc83b-7189-4627-9338-56323831bde7, user: 'stackrabbit', state: opening):
access to vhost 'None' refused for user 'stackrabbit'
(http://logs.openstack.org/67/609767/<email address hidden>)

-----
olso-messaging version: 9.0.1 according to upper constraints master branch
messaging server: rabbitmq
Platform: ubuntu 16.04
Config: transport_url = rabbit://stackrabbit:secretrabbit@149.202.175.37:5672
(http://logs.openstack.org/67/609767/1/check/congress-devstack-api-mysql/dfd6391/logs/etc/congress/congress.conf.txt.gz)

Eric K (ekcs)
no longer affects: congress
Ken Giusti (kgiusti)
Changed in oslo.messaging:
assignee: nobody → Ken Giusti (kgiusti)
Ken Giusti (kgiusti)
Changed in oslo.messaging:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Ken Giusti (kgiusti) wrote :

Yep, this is broken.

Previously all transport url values had a '/' appended automagically by oslo.messaging. This causes the connection to be scoped to the default rabbit vhost "/".

Now if a transport_url is configured without a trailing '/' (e.g. rabbit://host:5672) oslo.messaging won't append the trailing /. This is a behavioral change.

For now a workaround is to add a trailing '/' to the transport_url configuration value.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.messaging (master)

Fix proposed to branch: master
Review: https://review.openstack.org/611683

Changed in oslo.messaging:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.messaging (master)

Reviewed: https://review.openstack.org/611683
Committed: https://git.openstack.org/cgit/openstack/oslo.messaging/commit/?id=92b4080654b9ecb68250905e45eec65f41e5b161
Submitter: Zuul
Branch: master

commit 92b4080654b9ecb68250905e45eec65f41e5b161
Author: Kenneth Giusti <email address hidden>
Date: Thu Oct 18 11:41:23 2018 -0400

    Use '/' for the vhost if the transport_url has no trailing '/'

    This change https://review.openstack.org/#/c/599912/ accidentally
    removed setting the virtual host to '/' if none were provided in the
    transport_url configuration option.

    Closes-Bug: #1798241
    Change-Id: I2dbcec3f77eb7cc513350b00ea020cc8faaecec1

Changed in oslo.messaging:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.messaging 9.1.1

This issue was fixed in the openstack/oslo.messaging 9.1.1 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.