Repairing Poskey Errors

From Zenoss Wiki
Revision as of 18:41, 15 July 2013 by PaVanGJakati (Talk | contribs)$7

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

POSKeyError tracebacks occur when objects have references tonon-existing objects. When this occurs for relationships, thefindposkeyerror script can be used to locate objects that are the causes of thePOSKeyError tracebacks. The other tool to find POSKeyErrors is zodbscan.


This is the locationof the zodbscan tool:


https://github.com/zenoss/zenoss.toolbox

https://github.com/wplu/zenoss.toolbox


Here are the commands toinstall and use the zodbscan script if connected to the internet:

 root # su - zenoss
 zenoss $easy_install zenoss.toolbox
 zenoss $ zodbscan |tee zodbscan.txt


Here are the commands toinstall and use the zodbscan script if not connected to the internet:

 # on a machineconnected to internet
 $ wget -Omaster.zip --no-check-certificate https://github.com/zenoss/zenoss.toolbox/archive/master.zip
 $ scp master.zipzenoss@zenoss-master:


 root atzenoss-master # su - zenoss
 zenoss $easy_install ./master.zip
 zenoss $ zodbscan |tee zodbscan.txt


Findposkeyerrors script Script can be found at https://github.com/hackeys/zenoss.git instructions for findposkeyerror script

Here are the commands toinstall the findposkeyerror script:

 root # chown zenoss:zenossfindposkeyerror
 root # su - zenoss
 zenoss $ chmod u+xfindposkeyerror


Here are a few sample runsof the script:

 zenoss $./findposkeyerror /zport/dmd/Monitors
 zenoss $./findposkeyerror --fixrels /zport/dmd/Monitors
 zenoss $./findposkeyerror /zport/dmd/ZenUsers
 zenoss $./findposkeyerror --fixrels /zport/dmd/ZenUsers
 zenoss $./findposkeyerror /zport/dmd/Devices
 zenoss $./findposkeyerror --fixrels /zport/dmd/Devices


For ZenRelationshipobjects, there's a high likelihood that it is the _objects attribute that iscorrupted. When findposkeyerror is run with the '--fixrels' flag, it willfix most ZenRelationship objects.