Bug 667423

Summary: show command in qpid-tool fails when used for session objects
Product: Red Hat Enterprise MRG Reporter: Gordon Sim <gsim>
Component: qpid-cppAssignee: Chuck Rolke <crolke>
Status: CLOSED ERRATA QA Contact: Frantisek Reznicek <freznice>
Severity: medium Docs Contact:
Priority: high    
Version: 1.3CC: esammons, freznice, iboverma, jneedle, kgiusti, tross
Target Milestone: 1.3.2-RC2   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 12:11:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gordon Sim 2011-01-05 15:13:08 UTC
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 21:11:47 UTC
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 19:51:02 UTC
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 17:56:20 UTC
    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 18:08:51 UTC
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 09:45:09 UTC
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 19:07:10 UTC
    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 19:10:51 UTC
    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 19:11:57 UTC
    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 12:11:42 UTC
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