Repairing Poskey Errors

From Zenoss Wiki
Jump to: navigation, search

POSKeyError tracebacks occur when objects have references to non-existing objects. When this occurs for relationships, the FindPosKeyError script can be used to locate objects that are the causes of the POSKeyError tracebacks.


The FindPosKeyErrors script can be found at https://github.com/hackeys/zenoss.git instructions for FindPosKeyError script

Here are the commands to install the FindPosKeyError script:

 root # chown zenoss:zenoss FindPosKeyError
 root # su - zenoss
 zenoss $ chmod u+x FindPosKeyError


Here are a few sample runs of 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 ZenRelationship objects, there's a high likelihood that it is the _objects attribute that is corrupted. When FindPosKeyError is run with the '--fixrels' flag, it will fix most ZenRelationship objects.