Skip navigation
1 2 3 Previous Next 15289 Views 37 Replies Latest reply: May 10, 2013 4:07 PM by Shane Scott RSS
jshardlow Rank: Green Belt 98 posts since
Jun 12, 2008
Currently Being Moderated

Jan 23, 2012 5:23 AM

2.5.2 -> 3.0.3 ZenPack removal problem

Hi,

 

I'm attempting to upgrade a test 2.5.2 box (CentOS 5.5 x86) to 3.0.3, but one of our home grown ZenPacks is stopping the upgrade as it's not compatible. The problem is that I can't uninstall it. I've tried via the GUI which does nothing and the command line:

 

$ zenpack --remove=Device_Server_Linux_Class

ERROR: zenpack command failed. Reason: ObjectNotFound: object <ZenPackManager at ZenPackManager> was not found on <ToOneRelationship at manager>

I've also tried via zendmd:

 

$ zendmd

<snip>

>>> dmd.ZenPackManager.packs._delObject('Device_Server_Linux_Class')

2012-01-23 09:50:38 WARNING OFS.Uninstalled Could not import class 'HttpMonitorDataSource' from module 'Products.HttpMonitor.datasources.HttpMonitorDataSource'

Traceback (most recent call last):

  File "<console>", line 1, in ?

  File "/opt/zenoss/Products/ZenRelations/ToManyRelationshipBase.py", line 79, in _delObject

    self.removeRelation(obj)

  File "/opt/zenoss/Products/ZenRelations/RelationshipBase.py", line 109, in removeRelation

    self._remoteRemove(obj)

  File "/opt/zenoss/Products/ZenRelations/ToManyContRelationship.py", line 177, in _remoteRemove

    rel._remove(self.__primary_parent__)

  File "/opt/zenoss/Products/ZenRelations/ToOneRelationship.py", line 91, in _remove

    raise ObjectNotFound( "object %s was not found on %s" % (obj, self))

ObjectNotFound: object <ZenPackManager at ZenPackManager> was not found on <ToOneRelationship at manager>

>>>

 

On both this box (and a yet-untouched prod box) I can't even select the ZenPack in the GUI as it thows an error. So restoring from backup isn't much of an option as it's previously broken.

 

  •   Module zope.tales.tales, line 696, in evaluate
    URL: file:/opt/zenoss/Products/ZenModel/skins/zenmodel/viewPackDetail.pt
    Line 135, Column 4
    Expression: <PythonExpr container.dmd.ZenTableManager.getBatch(tableName,objects,sortedHeader='getPrimaryDmdId')>
    Names:{'container': <ZentinelPortal at /zport>, 'context': <ZenPack at /zport/dmd/ZenPackManager/packs/Device_Server_Linux_Class>, 'default': <object object at 0xb7f15538>, 'here': <ZenPack at /zport/dmd/ZenPackManager/packs/Device_Server_Linux_Class>, 'loop': {}, 'nothing': None, 'options': {'args': ()}, 'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xac866cc>, 'request': <HTTPRequest, URL=http://lqzen01:8080/zport/dmd/ZenPackManager/packs/Device_Server_Linux_Class>, 'root': <Application at >, 'template': <FSPageTemplate at /zport/viewPackDetail used for /zport/dmd/ZenPackManager/packs/Device_Server_Linux_Class>, 'traverse_subpath': [], 'user': <PropertiedUser 'admin'>}
  •   Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
    __traceback_info__: container.dmd.ZenTableManager.getBatch(tableName,objects,sortedHeader='getPrimaryDmdId')
  •   Module PythonExpr, line 1, in <expression>

Anyone got an idea of how to get round this. I've noticed a few similar posts over the past year or two, but they don't seem to end in a solution.

 

Thanks in advance!

  • jmp242 ZenossMaster 4,060 posts since
    Mar 7, 2007
    Currently Being Moderated
    1. Jan 23, 2012 11:40 AM (in response to jshardlow)
    Re: 2.5.2 -> 3.0.3 ZenPack removal problem


    Off the cuff, something Hackman238 has said in the IRC channel might help:

    lepri_     for zope

    lepri_     a monitor for zope

    12:08     lepri_     this is the complete error

    lepri_     INFO zen.Relations: Ignoring unresolvable object '<persistent broken ZenPacks.community.ZopeMonitor.ZenPack instance '\x00\x00\x00\x00\x00\x03\xa2\x83'>

    rmatte     sounds like you don't have your relations properly defined in your pack

    12:09     rmatte     are you actually coding any skins/UI components?

    12:10     Hackman238     lepri_: Was the ZopeMonitor installed, removed then reinstalled?

    12:11     lepri_     Hackman238: yes

    Hackman238     lepri_: make sure the pack is installed

    Hackman238     lepri_: then open zendmd as the zenoss user on the zenmaster

    12:12     Hackman238     lepri_: run the following to rebuild the zenpack persistance catalog

    Hackman238     from Products.ZCatalog.ProgressHandler import StdoutHandler

    Hackman238     dmd.zenPackPersistence.refreshCatalog(clear=1,pghandler=StdoutHandler())

    Hackman238     commit()

     

    If not, I'll try and get him to take a look at this thread.

     

    --

    James Pulver

    ZCA Member

    LEPP Computer Group

    Cornell University

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    4. Feb 2, 2012 6:03 AM (in response to jshardlow)
    Re: 2.5.2 -> 3.0.3 ZenPack removal problem

    jshardlow:

     

    As the zenoss user please run zenpack --list and post the result.

     

    Best,

    --Shane (Hackman238)

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    6. Feb 2, 2012 6:34 AM (in response to jshardlow)
    Re: 2.5.2 -> 3.0.3 ZenPack removal problem

    jshardlow:

     

    *rubs eyes in astonishment and sits back* I can't say I've ever seen a pack named that way. Any idea how that ended up in there?

     

    Anyway, the first thing I'd try is a zenchkrels -x1 -r as the zenoss user on the zenoss master. Depending on the instance size it could take a while. If it stops with trace like messages, post them. It's safe and won't interrrupt production activities.

     

     

    Best,

    --Shane (Hackman238)

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    8. Feb 2, 2012 9:44 AM (in response to jshardlow)
    Re: 2.5.2 -> 3.0.3 ZenPack removal problem

    jshardlow:

     

    Yeah that's not related to the problem but it needs to be fixed.

     

    In zendmd:

     

    dmd.ZenUsers.getUsers():

        user.messages.removeRelation()

     

     

    commit()

     

    Then rerun zenchkrels -x1 -r

     

    Best,

    --Shane

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    10. Feb 2, 2012 10:09 AM (in response to jshardlow)
    Re: 2.5.2 -> 3.0.3 ZenPack removal problem

    jshardlow:

     

    Ack. My bad, I missed part of the code.

     

    In zendmd:

     

    for user in dmd.ZenUsers.getUsers():

        user.messages.removeRelation()

     

     

    commit()

     

    --Shane

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    12. Feb 2, 2012 11:04 AM (in response to jshardlow)
    Re: 2.5.2 -> 3.0.3 ZenPack removal problem

    jshardlow:

     

    Hum. Okay, let's work around that.

     

    In zendmd:

     

    packs = None

    if hasattr(dmd, 'ZenPackManager'):

        packs = dmd.ZenPackManager.packs

    else:

        packs = dmd.packs

     

     

    for pack in packs():

        try:

            unused = pack.primaryAq()

            print "%s is fine." % (pack.id,)

        except AttributeError:

            print "Problem with %s ZenPack. Forcing removal." % (pack.id,)

            packs._remove(pack)

     

     

    commit()

     

    Any 'Problem' remarks or trace?

     

    --Shane

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    13. Feb 2, 2012 11:15 AM (in response to Shane Scott)
    Re: 2.5.2 -> 3.0.3 ZenPack removal problem

    jshardlow:

     

    Please download the following patch ( http://dev.zenoss.com/trac/changeset/25901?format=diff&new=25901 ) and apply it.

     

    Afterwards in zendmd:

     

    for user in dmd.ZenUsers.getUsers():

        user.messages.removeRelation()

     

     

     

    commit()

    commit()

     

    This should fix that messageQueue issue and prevent it from happening again.

     

    --Shane

1 2 3 Previous Next

More Like This

  • Retrieving data ...

Legend

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