Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 984424

Summary: qpid-config does not throws correct exception when binding nonexisting exchange
Product: Red Hat Enterprise MRG Reporter: Zdenek Kraus <zkraus>
Component: qpid-toolsAssignee: Pavel Moravec <pmoravec>
Status: CLOSED ERRATA QA Contact: Michal Toth <mtoth>
Severity: low Docs Contact:
Priority: low    
Version: 2.4CC: eallen, jross, mtoth, pmoravec
Target Milestone: 3.1Keywords: EasyFix, Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qpid-tools-0.30-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-04-14 13:46:44 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:
Attachments:
Description Flags
Patch proposal
none
Patch proposal #2 eallen: review-

Description Zdenek Kraus 2013-07-15 08:19:29 UTC
Description of problem:
When binding nonexisting exchange to a queue, qpid-config failes with attribute error, instead of not-found exception from qmf agent.

Version-Release number of selected component (if applicable):
qpid-tools-0.22-3.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. bind a non existing exchange
qpid-config bind "asdf" queue 'x'


Actual results:
Failed: AttributeError: 'NoneType' object has no attribute 'type'

Expected results:
exception like with non existing queue
Failed: Exception: Exception from Agent: {u'error_code': 7, u'error_text': 'not-found: Bind failed. No such exchange: asdf (/builddir/build/BUILD/qpid-0.22/cpp/src/qpid/broker/Broker.cpp:1445)'}


Additional info:
binding non existing queue:
qpid-config bind "amq.topic" queue 'x'
Failed: Exception: Exception from Agent: {u'error_code': 7, u'error_text': 'not-found: Bind failed. No such queue: queue (/builddir/build/BUILD/qpid-0.22/cpp/src/qpid/broker/Broker.cpp:1445)'}

Comment 1 Zdenek Kraus 2013-07-15 08:48:43 UTC
Created attachment 773634 [details]
Patch proposal

Comment 2 Zdenek Kraus 2013-07-15 08:54:51 UTC
Created attachment 773641 [details]
Patch proposal #2

I have had a typo in previous patch. I'd manually recreated patch on the other machine, after testing on VM, and made a bad indentation.

Comment 3 Ernie 2013-07-15 15:18:04 UTC
This patch is correct. It avoids the bad assumption that the exchange is valid and allows the correct exception to be raised:

Comment 4 Pavel Moravec 2014-07-01 12:23:54 UTC
Committed revision 1607061.

Thanks Zdenek for the patch.

Comment 5 Ernie 2014-09-02 13:31:48 UTC
Comment on attachment 773641 [details]
Patch proposal #2

Removing old review request. The patch was reviewed and committed a while back.

Comment 7 Michal Toth 2014-10-21 13:53:22 UTC
Correct error message is thrown as expected, about non-existing exchange.

$ qpid-config bind "asdf" queue 'x'
Failed: Exception: Exception from Agent: {u'error_code': 7, u'error_text': 'not-found: Exchange not found: asdf (/builddir/build/BUILD/qpid-cpp-0.30/src/qpid/broker/ExchangeRegistry.cpp:144)'}

Verified on
qpid-tools-0.30-1.el6
qpid-cpp-server-0.30-2.el6

Comment 9 errata-xmlrpc 2015-04-14 13:46:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2015-0805.html