Bug 771642 - Cumin generates application error: AttributeError: 'int' object has no attribute 'name', wallabyoperations.py line 420
Summary: Cumin generates application error: AttributeError: 'int' object has no attrib...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: cumin
Version: 2.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 2.1.1
: ---
Assignee: Trevor McKay
QA Contact: Stanislav Graf
URL:
Whiteboard:
Depends On:
Blocks: 748735 765607
TreeView+ depends on / blocked
 
Reported: 2012-01-04 12:53 UTC by Stanislav Graf
Modified: 2012-02-06 18:19 UTC (History)
4 users (show)

Fixed In Version: cumin-0.1.5184-1
Doc Type: Bug Fix
Doc Text:
Cause Following a host link from the Inventory page will open a summary page for the host. The Configuration tab depends on data encoded in the URL which may have become stale. Consequence Selecting the Configuration tab can cause an exception when host data in the URL is stale. Fix Check to see that host data in the URL is valid before generating the Configuration tab. Notify the user and direct them back to the Inventory page if stale data is detected. Result The exceptional condition is caught early and handled. The user is notified with a message, and can navigate away from the Configuration tab normally.
Clone Of:
Environment:
Last Closed: 2012-02-06 18:19:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch for WallabyOperations.get_tag_names to check for name attribute (1.25 KB, application/octet-stream)
2012-01-04 17:09 UTC, Trevor McKay
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 748735 0 unspecified CLOSED Cumin generates application error: TypeError: len() of unsized object from cumin/objectframe.py, line 298 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHSA-2012:0100 0 normal SHIPPED_LIVE Moderate: MRG Grid security, bug fix, and enhancement update 2012-02-06 23:15:47 UTC

Internal Links: 748735

Description Stanislav Graf 2012-01-04 12:53:35 UTC
Description of problem:
I was doing reproduction of Bug 748735
I was using cumin with condor/qpidd/sesame/wallaby.
Reproduction done according to Bug 748735, comment 4

Then I have got this message:
"There is no content to display for the chosen host.  This may be due to the
sesame system being down."

Select overview several times, the same message. Wait 5 minutes, still the
same. Select Configuration -> ERROR

Version-Release number of selected component (if applicable):
RHEL 5.7 i386/x86_64
RHEL 6.2 i386/x86_64
MRG 2.1.x, cumin-0.1.5180-1

How reproducible:
100%

Steps to Reproduce:
1. Install cumin with condor/qpidd/sesame/wallaby.
2. Bug 748735, comment 4
3. Select overview several times, the same message. Wait 5 minutes, still the
same. Select Configuration -> ERROR
  
Actual results:
Cumin generates error.

Expected results:
Cumin works.

Additional info:

Comment 2 Stanislav Graf 2012-01-04 13:02:19 UTC
Created attachment 550679 [details]
detailed cumin report

Comment 3 Trevor McKay 2012-01-04 17:05:20 UTC
I should have included this comment here, I put it on 748735

"Well,

  we can catch the error by putting some type assertion checks in the
wallabyoperations code.  At this line, the value passed in is expected to be
either a string (the name of a wallaby node) or a node object.  Instead, it is
apparently an int.

 The question remains, why are we getting an int here?"

Attaching a fix in a patch file for testing...

Comment 4 Trevor McKay 2012-01-04 17:09:02 UTC
Created attachment 550730 [details]
Patch for WallabyOperations.get_tag_names to check for name attribute


This patch will check for a name attribute in get_tag_names.  If the node name can't be determined a debug level log message will be issued and an empty list will be returned as a result.

Comment 5 Stanislav Graf 2012-01-05 10:09:48 UTC
After cumin's restart:
(selected) hostname changed:
Inventory › System '8'

Overview:
There is no content to display for the chosen host.  This may be due to the sesame system being down.

Configuration:
Tags:

Logfile for configuration:
3398 2012-01-05 11:02:32,119 INFO Request GET /index.html?frame=main.inventory.system;main.m=inventory;main.inventory.m=system;main.inventory.system.m=view;main.inventory.system.id=7;main.inventory
.system.view.body.m=configuration
3398 2012-01-05 11:02:32,122 DEBUG WallabyOperations: 0.455276012421 seconds to refresh groups
3398 2012-01-05 11:02:32,123 DEBUG WallabyOperations: groups list updated (4 items)
3398 2012-01-05 11:02:32,124 DEBUG WallabyOperations: refreshing tags
3398 2012-01-05 11:02:32,125 DEBUG WallabyOperations: tags list updated (0 items)
3398 2012-01-05 11:02:32,126 DEBUG WallabyOperations: 0.00106692314148 seconds to refresh tags
3398 2012-01-05 11:02:32,126 DEBUG WallabyOperations: total refresh processing time 2.06622982025
3398 2012-01-05 11:02:32,127 DEBUG WallabyOperations: cache thread sleeping for 5 seconds
3398 2012-01-05 11:02:32,150 DEBUG WallabyOperations: get_tag_names(), parameter 'node' yields no name, returning []

Details:
There is no content to display

-----

So I need to go back to Inventory and select the proper host again to see meaningful information. Proper solution is probably inform user, that selected host (System '8') is no longer there (via yellow message with dissmiss) and move back to the root of Inventory tab.

Comment 6 Trevor McKay 2012-01-09 19:53:29 UTC
Update,

  This error will occur anytime that a user drills into a system from the Inventory tab when Sesame data is available, the user remains in the set of tabs below the drill down, and the id cumin has for the Sesame object becomes stale.

  The id can become stale if cumin is restarted, or if the Sesame agent is stopped long enough for an object deletion to arrive through QMF.

  When either of the above to conditions occur, cumin has a URL that contains a system.id field that is no longer valid.  The "Configuration" tab attempts to dereference the system.id and uses the result as an argument to retrieve tag info.

Comment 7 Trevor McKay 2012-01-09 20:36:17 UTC
Fixed in revision 5184.

Include the patch attached to this BZ as a fix for the general case, since get_tag_names is called in more than 1 place and we don't want more exceptions.

Modify the code when entering the Configuration tab to check for a case of stale Sesame data and display an error banner rather than an exception (or a blank tag list, which the above patch would do).  Inform the user that they should visit the Inventory tab and try again.

Comment 9 Trevor McKay 2012-01-10 00:52:32 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
    Following a host link from the Inventory page will open a summary page for the host.  The Configuration tab depends on data encoded in the URL which may have become stale.

Consequence
    Selecting the Configuration tab can cause an exception when host data in the URL is stale.

Fix
    Check to see that host data in the URL is valid before generating the Configuration tab.  Notify the user and direct them back to the Inventory page if stale data is detected.

Result
    The exceptional condition is caught early and handled. The user is notified with a message, and can navigate away from the Configuration tab normally.

Comment 10 Trevor McKay 2012-01-10 01:34:26 UTC
Note on testing,

  Descending from the Inventory page into the Overview/Configuration/Details page encodes host information in two different ways.

  For a system that is known to Wallaby, but has no Sesame agent running, the Configuration tab will be populated based on the host name (sytem.id in the URL will be a hostname string)

  For a system that has Sesame running, the Configuration tab will be populated based on a Cumin id for the Sesame object (system.id in the URL will be an int).

  When testing for this error, both types of hosts should be tested.

Comment 12 Stanislav Graf 2012-01-11 11:21:48 UTC
Verify:
RHEL5 i386/x86_64
cumin-0.1.5184-1.el5.noarch

RHEL6 i386/x86_64
cumin-0.1.5184-1.el6.noarch

Cumin id for the Sesame object, Restart cumin
---------------------------------------------
1. Install cumin with condor/qpidd/sesame/wallaby.
2. Navigate to Inventory::<choose a node>
3. Configuration tab will be populated based on Cumin id for the Sesame object (system.id in the URL will be an int).
4. Restart cumin
5. Right after cumin restarts (ie:  it is listening on port 45672 again), hit
Refresh in your browser
6. Overview: "There is no content to display for the chosen host.  This may be due to the sesame system being down."
7. Configuration: "Host data may have changed.  Return to the Inventory page and try again"
8. Details: "There is no content to display"
9. Return to the Inventory page and try again - OK

Cumin id for the Sesame object, Stop sesame
-------------------------------------------
1. Install cumin with condor/qpidd/sesame/wallaby.
2. Navigate to Inventory::<choose a node>
3. Cumin id for the Sesame object (system.id in the URL will be an int).
4. Stop sesame
5. Right after cumin restarts (ie:  it is listening on port 45672 again), hit
Refresh in your browser
6. Overview: "There is no content to display for the chosen host.  This may be due to the sesame system being down."
7. Configuration: "Host data may have changed.  Return to the Inventory page and try again"
8. Details: "There is no content to display"
9. Return to the Inventory page and try again
10. Configuration tab will be populated based on the host name (sytem.id in the URL
will be a hostname string)

Host name, Restart cumin
------------------------
1. Install cumin with condor/qpidd/(no sesame)/wallaby.
2. Navigate to Inventory::<choose a node>
3. Configuration tab will be populated based on the host name (sytem.id in the URL
will be a hostname string)
4. Grid::Configuration - add tag to this host (the same as system.id)
5. Navigate to Inventory::<choose a node>
6. Restart cumin
7. Right after cumin restarts (ie:  it is listening on port 45672 again), hit
Refresh in your browser
8. Everything looks fine (like before restart).



VERIFIED

Comment 13 errata-xmlrpc 2012-02-06 18:19:11 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.

http://rhn.redhat.com/errata/RHSA-2012-0100.html


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