Difference between revisions of "Repairing Poskey Errors"

From Zenoss Wiki
Jump to: navigation, search
(PosKey Error Fixture)
(10 intermediate revisions by 7 users not shown)
Line 1: Line 1:
Sometimes, the Zope Object Database that stores all your devices and components will have a data integrity issue. This can manifest itself in a number of ways, but the end result is that Zenoss will have trouble dealing with certain devices in your system, and you may not be able to remove the device in the UI. The zenoss.toolbox can be used to troubleshoot ZODB issues. The following Zenoss Knowledge Base articles details use of the zenoss.toolbox:
 
  
[https://support.zenoss.com/hc/en-us/articles/203117595 How do I Install and Use the zenoss.toolbox Package?]
+
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.
  
[https://support.zenoss.com/hc/en-us/articles/203118075 How do I use zencatalogscan to detect and fix unresolvable object references in catalogs?]
+
  
[https://support.zenoss.com/hc/en-us/articles/203118175 How do I use zodbscan to Scan zodb for Dangling References?]
+
This is the locationof the zodbscan tool:
  
[https://support.zenoss.com/hc/en-us/articles/203117795 How do I use findposkeyerror to detect and fix POSKeyErrors in zodb?]
+
  
[https://support.zenoss.com/hc/en-us/articles/203121165 How do I use zenrelationscan to scan/fix ZenRelations]
+
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.

Revision as of 18:41, 15 July 2013

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.