Bug 667423 - show command in qpid-tool fails when used for session objects
show command in qpid-tool fails when used for session objects
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp (Show other bugs)
1.3
Unspecified Unspecified
high Severity medium
: 1.3.2-RC2
: ---
Assigned To: Chuck Rolke
Frantisek Reznicek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-05 10:13 EST by Gordon Sim
Modified: 2015-11-15 20:13 EST (History)
6 users (show)

See Also:
Fixed In Version: qpid-tools-0.7.946106-12
Doc Type: Bug Fix
Doc Text:
The qpid-tool utility threw an exception and exited without displaying any data when it attempted to display an object which contained fields for optional data which did not contain defined values. With this update, qpid-tool no longer exits in such a situation, displays "absent" for objects with undefined data in optional fields, and thus is now able to display such objects properly.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-02-15 07:11:42 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Gordon Sim 2011-01-05 10:13:08 EST
Description of problem:

It is not possible to use qpid-tool to display session stats.

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

qpid-tools-0.7.946106-11.el5
qpid-cpp-server-0.7.946106-23.el5

How reproducible:

100%

Steps to Reproduce:
1. create an open session on a broker (e.g. run qpid-printevents in another console)
2. start qpid-tool
3. type: list sessions
4. pick one session id and type: show <id>
  
Actual results:

qpid: list session
Object Summary:
    ID   Created   Destroyed  Index
    ================================================================
    140  15:09:04  -          147.mrg15.lab.bos.redhat.com.30234.1
    161  15:09:23  -          147.mrg15.lab.bos.redhat.com.30244.1
qpid: show 140
Exception in do_show: <exceptions.TypeError instance at 0x2aaaac57eab8>

Expected results:

See list of statistics and properties for that session as per schema.

Additional info:
Comment 1 Chuck Rolke 2011-01-06 16:11:47 EST
Fixed upstream in r1056076.

Log:
qpid-tool throws
TypeError(unsupported operand types for /: 'NoneType' and 'int',")
when it shows a session.expireTime object with a missing value.
Some values are optional and are normally missing.
This patch prevents the exception and displays 'absent'.
Comment 2 Ken Giusti 2011-01-20 14:51:02 EST
Moved to mrg_1.3.0.x branch.
Released in qpid-tools-0.7.946106-12

http://mrg1.lab.bos.redhat.com/cgit/qpid.git/tag/?id=qpid-tools-0.7.946106-12
Comment 4 Chuck Rolke 2011-01-24 12:56:20 EST
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause

Attempt to display any object that contains optional data and the optional data is not present.

Consequence

Qpid-tool throws an exception and exits without displaying any data.

Fix

If the data being displayed is of type 'None' then display 'absent' else display what is usually displayed.

Result

Users will see complete displays of the requested object and Qpid-tool does not exit. Fields that caused the exception before this fix are displayed with a value of 'absent'.
Comment 5 Chuck Rolke 2011-01-24 13:08:51 EST
Example of the show command after the fix.

qpid: list session
Object Summary:
    ID   Created   Destroyed  Index
    ============================================================
    128  18:05:57  -          135.localhost.localdomain.4328.1

qpid: show 128
Object of type: org.apache.qpid.broker:session:_data
    Attribute          128
    =================================================
    vhostRef           135
    name               localhost.localdomain.4328.1
    channelId          1
    connectionRef      114
    detachedLifespan   0
    attached           True
    expireTime         absent
    maxClientRate      absent
    framesOutstanding  0
    TxnStarts          0
    TxnCommits         0
    TxnRejects         0
    TxnCount           0
    clientCredit       0
qpid:
Comment 6 Frantisek Reznicek 2011-01-25 04:45:09 EST
The issue has been resolved, tested on RHEL 4.8 / 5.6 i386 / x86_64 on packages:
python-qpid-0.7.946106-15.el5
qpid-cpp-client-0.7.946106-27.el5
qpid-cpp-client-devel-0.7.946106-27.el5
qpid-cpp-client-devel-docs-0.7.946106-27.el5
qpid-cpp-client-ssl-0.7.946106-27.el5
qpid-cpp-mrg-debuginfo-0.7.946106-27.el5
qpid-cpp-server-0.7.946106-27.el5
qpid-cpp-server-cluster-0.7.946106-27.el5
qpid-cpp-server-devel-0.7.946106-27.el5
qpid-cpp-server-ssl-0.7.946106-27.el5
qpid-cpp-server-store-0.7.946106-27.el5
qpid-cpp-server-xml-0.7.946106-27.el5
qpid-java-client-0.7.946106-14.el5
qpid-java-common-0.7.946106-14.el5
qpid-java-example-0.7.946106-14.el5
qpid-tools-0.7.946106-12.el5


-> VERIFIED
Comment 7 Douglas Silas 2011-02-09 14:07:10 EST
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,15 +1 @@
-Cause
+The qpid-tool utility threw an exception and exited without displaying any data when it attempted to display an object that contained optional, though missing, data. With this update, qpid-tool no longer exits in such a situation, displays "absent" for objects with optional-though-missing data, and thus is able to display objects with undefined optional data properly.-
-Attempt to display any object that contains optional data and the optional data is not present.
-
-Consequence
-
-Qpid-tool throws an exception and exits without displaying any data.
-
-Fix
-
-If the data being displayed is of type 'None' then display 'absent' else display what is usually displayed.
-
-Result
-
-Users will see complete displays of the requested object and Qpid-tool does not exit. Fields that caused the exception before this fix are displayed with a value of 'absent'.
Comment 8 Douglas Silas 2011-02-09 14:10:51 EST
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-The qpid-tool utility threw an exception and exited without displaying any data when it attempted to display an object that contained optional, though missing, data. With this update, qpid-tool no longer exits in such a situation, displays "absent" for objects with optional-though-missing data, and thus is able to display objects with undefined optional data properly.+The qpid-tool utility threw an exception and exited without displaying any data when it attempted to display an object which contained fields for optional data which, however, did not contain defined values. With this update, qpid-tool no longer exits in such a situation, displays "absent" for objects with undefined data in optional fields, and thus is now able to display such objects properly.
Comment 9 Douglas Silas 2011-02-09 14:11:57 EST
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-The qpid-tool utility threw an exception and exited without displaying any data when it attempted to display an object which contained fields for optional data which, however, did not contain defined values. With this update, qpid-tool no longer exits in such a situation, displays "absent" for objects with undefined data in optional fields, and thus is now able to display such objects properly.+The qpid-tool utility threw an exception and exited without displaying any data when it attempted to display an object which contained fields for optional data which did not contain defined values. With this update, qpid-tool no longer exits in such a situation, displays "absent" for objects with undefined data in optional fields, and thus is now able to display such objects properly.
Comment 10 errata-xmlrpc 2011-02-15 07:11:42 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0217.html

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