Bug 984424 - qpid-config does not throws correct exception when binding nonexisting exchange
Summary: qpid-config does not throws correct exception when binding nonexisting exchange
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-tools
Version: 2.4
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: 3.1
: ---
Assignee: Pavel Moravec
QA Contact: Michal Toth
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-15 08:19 UTC by Zdenek Kraus
Modified: 2015-04-14 13:46 UTC (History)
4 users (show)

Fixed In Version: qpid-tools-0.30-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-04-14 13:46:44 UTC
Target Upstream Version:


Attachments (Terms of Use)
Patch proposal (843 bytes, patch)
2013-07-15 08:48 UTC, Zdenek Kraus
no flags Details | Diff
Patch proposal #2 (844 bytes, patch)
2013-07-15 08:54 UTC, Zdenek Kraus
eallen: review-
Details | Diff


Links
System ID Priority Status Summary Last Updated
Apache JIRA QPID-5863 None None None Never
Red Hat Product Errata RHEA-2015:0805 normal SHIPPED_LIVE Red Hat Enterprise MRG Messaging 3.1 Release 2015-04-14 17:45:54 UTC

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


Note You need to log in before you can comment on or make changes to this bug.