Skip navigation
5999 Views 6 Replies Latest reply: Apr 5, 2011 7:35 AM by tornado RSS
daveborg98 Rank: White Belt 8 posts since
Oct 8, 2009
Currently Being Moderated

Sep 23, 2010 12:13 PM

Multi-Graph Report error after 3.0.2 upgrade

I have a few multi-graph reports that I previously created in version 2.5 and are now broken in version 3.0.2. When I try to look at them or edit them, I get an error that shows:

 

Type:
Value: collection_items      

 

Is there a way for me to fix this or will I have to rebuild them?

  • tornado Rank: White Belt 28 posts since
    Jan 20, 2010
    Currently Being Moderated
    1. Oct 5, 2010 8:09 AM (in response to daveborg98)
    Re: Multi-Graph Report error after 3.0.2 upgrade

    Have the same problem upgrading 2.5.1 to 3.0.2

  • tornado Rank: White Belt 28 posts since
    Jan 20, 2010
    Currently Being Moderated
    2. Oct 5, 2010 8:27 AM (in response to tornado)
    Re: Multi-Graph Report error after 3.0.2 upgrade

    A bit more details.

     

    Error applies only to the reports created in 2.5.1. New reports are OK

     

    Output from event.log when error occures:

     

    ------
    2010-10-05T14:11:04 ERROR Zope.SiteErrorLog 1286280664.210.243797753544 http://zenoss-test.some.domain:8080/zport/dmd/Reports/Multi-Graph%20Reports/Cisco_devices_summary/CoreSwitchesTotals/viewMultiGraphReport
    Traceback (innermost last):
      Module ZPublisher.Publish, line 127, in publish
      Module ZPublisher.mapply, line 77, in mapply
      Module ZPublisher.Publish, line 47, in call_object
      Module Shared.DC.Scripts.Bindings, line 324, in __call__
      Module Shared.DC.Scripts.Bindings, line 361, in _bindAndExec
      Module Products.CMFCore.FSPageTemplate, line 240, in _exec
      Module Products.CMFCore.FSPageTemplate, line 180, in pt_render
      Module Products.PageTemplates.PageTemplate, line 80, in pt_render
      Module zope.pagetemplate.pagetemplate, line 115, in pt_render
      Module zope.tal.talinterpreter, line 271, in __call__
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 888, in do_useMacro
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 533, in do_optTag_tal
      Module zope.tal.talinterpreter, line 518, in do_optTag
      Module zope.tal.talinterpreter, line 513, in no_tag
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 888, in do_useMacro
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 533, in do_optTag_tal
      Module zope.tal.talinterpreter, line 518, in do_optTag
      Module zope.tal.talinterpreter, line 513, in no_tag
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 954, in do_defineSlot
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 533, in do_optTag_tal
      Module zope.tal.talinterpreter, line 518, in do_optTag
      Module zope.tal.talinterpreter, line 513, in no_tag
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 531, in do_optTag_tal
      Module zope.tal.talinterpreter, line 513, in no_tag
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 946, in do_defineSlot
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 533, in do_optTag_tal
      Module zope.tal.talinterpreter, line 518, in do_optTag
      Module zope.tal.talinterpreter, line 513, in no_tag
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 946, in do_defineSlot
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 533, in do_optTag_tal
      Module zope.tal.talinterpreter, line 518, in do_optTag
      Module zope.tal.talinterpreter, line 513, in no_tag
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 533, in do_optTag_tal
      Module zope.tal.talinterpreter, line 518, in do_optTag
      Module zope.tal.talinterpreter, line 513, in no_tag
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 888, in do_useMacro
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 533, in do_optTag_tal
      Module zope.tal.talinterpreter, line 518, in do_optTag
      Module zope.tal.talinterpreter, line 513, in no_tag
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 888, in do_useMacro
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 533, in do_optTag_tal
      Module zope.tal.talinterpreter, line 518, in do_optTag
      Module zope.tal.talinterpreter, line 513, in no_tag
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 946, in do_defineSlot
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 533, in do_optTag_tal
      Module zope.tal.talinterpreter, line 518, in do_optTag
      Module zope.tal.talinterpreter, line 513, in no_tag
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 978, in do_onError_tal
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 533, in do_optTag_tal
      Module zope.tal.talinterpreter, line 518, in do_optTag
      Module zope.tal.talinterpreter, line 513, in no_tag
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
      Module Products.PageTemplates.Expressions, line 195, in evaluateStructure
      Module zope.tales.tales, line 696, in evaluate
       - URL: file:/opt/zenoss/Products/ZenModel/skins/zenmodel/viewPerformanceDetail.pt
       - Line 85, Column 0
       - Expression:    - Names:
          {'container': ,
           'context': ,
           'default': ,
           'here': ,
           'loop': {},
           'nothing': None,
           'options': {'args': ()},
           'repeat': ,
           'request': ,
           'root': ,
           'template': ,
           'traverse_subpath': [],
           'user': }
      Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
       - __traceback_info__: here.dmd.error_handler(error)
      Module PythonExpr, line 1, in   Module zope.tal.talinterpreter, line 965, in do_onError_tal
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 533, in do_optTag_tal
      Module zope.tal.talinterpreter, line 518, in do_optTag
      Module zope.tal.talinterpreter, line 513, in no_tag
      Module zope.tal.talinterpreter, line 343, in interpret
      Module zope.tal.talinterpreter, line 819, in do_loop_tal
      Module zope.tales.tales, line 682, in setRepeat
      Module zope.tales.tales, line 696, in evaluate
       - URL: file:/opt/zenoss/Products/ZenModel/skins/zenmodel/viewPerformanceDetail.pt
       - Line 85, Column 0
       - Expression:    - Names:
          {'container': ,
           'context': ,
           'default': ,
           'here': ,
           'loop': {},
           'nothing': None,
           'options': {'args': ()},
           'repeat': ,
           'request': ,
           'root': ,
           'template': ,
           'traverse_subpath': [],
           'user': }
      Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
       - __traceback_info__: here.getDefaultGraphDefs(drange=drange)
      Module PythonExpr, line 1, in   Module Products.ZenModel.MultiGraphReport, line 262, in getDefaultGraphDefs
      Module Products.ZenModel.Collection, line 197, in getDevicesAndComponents
      Module Products.ZenModel.Collection, line 180, in getItems
    AttributeError: collection_items
    
  • tornado Rank: White Belt 28 posts since
    Jan 20, 2010
    Currently Being Moderated
    3. Oct 5, 2010 9:13 AM (in response to tornado)
    Re: Multi-Graph Report error after 3.0.2 upgrade

    Problem is located and a workaround is found.

     

     

    The problem is that in 2.5.1 the name of the "Multi-Graph Report" collection attribute is "items", but in 3.0.2 - "collection_items".

    The problem is even worse, because it's not possible to rename this attribute: "items may not be renamed"

     

     

    The workaround for me is:

    Go to http://zenoss.site:8080/zport/manage

     

    • browse to dmd -> Reports -> Multi-Graph Reports.
    • click on the desired report
    • in right frame click on the "collections" -> "desired collection" -> "items"
    • Select all the items and press "Copy"
    • return one level up and from the "Select type to add..." drop-down menu select "ToManyContRelationship"
    • enter "collection_items" as an ID...
    • click on it and press "Paste" button

     

    It's OK fot some small reports, but unacceptable for the big installations (some of my reports has up to 20 collections and a tens of items in it)

     

    If someone could prepare a script to fix that, it will be appreciated.

  • cparlette ZenossEmployee 4 posts since
    Jul 10, 2009
    Currently Being Moderated
    5. Mar 18, 2011 11:43 AM (in response to daveborg98)
    Re: Multi-Graph Report error after 3.0.2 upgrade

    This error comes from the fact that the migration step at http://dev.zenoss.com/trac/browser/trunk/Products/ZenModel/migrate/renameCollectionItemsRelations.py doesn't go into subfolders under the Multi-Graph Reports, so it only converts reports at the base folder to use collection_items.  Here is a zendmd script that will recurse through the subfolders and make the proper changes:

     

     

    from Acquisition import aq_base
    from Products.ZenRelations.ToManyContRelationship import ToManyContRelationship
    reportclass = dmd.Reports._getOb('Multi-Graph Reports')
    for organizer in reportclass.getSubOrganizers():
        for report in organizer.reports():
            try:
                rptcolls = report.collections
            except AttributeError:
                continue
            for coll in rptcolls():
                rel = coll.items
                if isinstance(rel, ToManyContRelationship):
                    obs = []
                    for ob in rel():
                        obs.append(aq_base(ob))
                        remote_rel = ob.collection
                        remote_rel._remove(coll)
                        rel._remove(ob)
                    coll._delObject('items')
                    coll.buildRelations()
                    newrel = coll.collection_items.primaryAq()
                    for ob in obs:
                        newrel._setObject(ob.getId(), ob)
                        ob = newrel._getOb(ob.getId())
                        print ob.__primary_parent__
                        assert ob.__primary_parent__ == newrel
                        assert ob.collection() == coll
                        assert ob in newrel()
    commit()

  • tornado Rank: White Belt 28 posts since
    Jan 20, 2010
    Currently Being Moderated
    6. Apr 5, 2011 7:35 AM (in response to cparlette)
    Re: Multi-Graph Report error after 3.0.2 upgrade

    Super!!

    It works!

     

    Chris, Thank you a lot!

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points