Bug 984424 - qpid-config does not throws correct exception when binding nonexisting exchange
qpid-config does not throws correct exception when binding nonexisting exchange
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-tools (Show other bugs)
2.4
Unspecified Unspecified
low Severity low
: 3.1
: ---
Assigned To: Pavel Moravec
Michal Toth
: EasyFix, Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-15 04:19 EDT by Zdenek Kraus
Modified: 2015-04-14 09:46 EDT (History)
4 users (show)

See Also:
Fixed In Version: qpid-tools-0.30-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-04-14 09:46:44 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Apache JIRA QPID-5863 None None None Never

  None (edit)
Description Zdenek Kraus 2013-07-15 04:19:29 EDT
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 04:48:43 EDT
Created attachment 773634 [details]
Patch proposal
Comment 2 Zdenek Kraus 2013-07-15 04:54:51 EDT
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 11:18:04 EDT
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 08:23:54 EDT
Committed revision 1607061.

Thanks Zdenek for the patch.
Comment 5 Ernie 2014-09-02 09:31:48 EDT
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 09:53:22 EDT
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 09:46:44 EDT
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.