zenoss

zenoss was not running (the web was not available @port 8080)

 zenoss]# /etc/init.d/zenoss status
Daemon: zeoctl program running; pid=11840
Daemon: zopectl daemon manager not running
Daemon: zenhub program running; pid=11849
Daemon: zenping program running; pid=11856
Daemon: zensyslog program running; pid=11865
Daemon: zenstatus program running; pid=11871
Daemon: zenactions program running; pid=11880
Daemon: zentrap program running; pid=11888
Daemon: zenmodeler program running; pid=11909
Daemon: zenperfsnmp program running; pid=11923
Daemon: zencommand program running; pid=11933
Daemon: zenprocess program running; pid=11947
Daemon: zenwin program running; pid=11957
Daemon: zeneventlog program running; pid=11968
Daemon: zenwinmodeler program running; pid=11977

@debug

zopectl> status
daemon manager running; daemon process not running
zopectl> debug
Starting debugger (the name "app" is bound to the top-level Zope object)
2008-06-18 08:38:04 WARNING OFS.Application Duplicate Product name
After loading Product 'Five' from '/opt/zenoss/Products',
I skipped the one in '/opt/zenoss/lib/python/Products'.

2008-06-18 08:38:04 ERROR Zope Could not import Products.ZenEvents
Traceback (most recent call last):
  File "/opt/zenoss/lib/python/OFS/Application.py", line 695, in import_product
    product=__import__(pname, global_dict, global_dict, silly)
  File "/opt/zenoss/Products/ZenEvents/__init__.py", line 24, in ?
    from MySqlEventManager import MySqlEventManager, addMySqlEventManager, \
  File "/opt/zenoss/Products/ZenEvents/MySqlEventManager.py", line 22, in ?
    from EventManagerBase import EventManagerBase
  File "/opt/zenoss/Products/ZenEvents/EventManagerBase.py", line 47, in ?
    from EventCommand import EventCommand
  File "/opt/zenoss/Products/ZenEvents/EventCommand.py", line 16, in ?
    from Products.ZenModel.ZenModelRM import ZenModelRM
  File "/opt/zenoss/Products/ZenModel/ZenModelRM.py", line 35, in ?
    from Products.ZenRelations.ImportRM import ImportRM
  File "/opt/zenoss/Products/ZenRelations/ImportRM.py", line 36, in ?
    from Products.ZenUtils.ZCmdBase import ZCmdBase
  File "/opt/zenoss/Products/ZenUtils/ZCmdBase.py", line 30, in ?
    defaultCacheDir = zenPath('var')
  File "/opt/zenoss/Products/ZenUtils/Utils.py", line 544, in zenPath
    return os.path.join(os.environ['ZENHOME'], *args)
  File "/usr/lib/python2.4/UserDict.py", line 17, in __getitem__
    def __getitem__(self, key): return self.data[key]
KeyError: 'ZENHOME'
Traceback (most recent call last):
  File "", line 1, in ?
  File "/opt/zenoss/lib/python/Zope2/__init__.py", line 51, in app
    startup()
  File "/opt/zenoss/lib/python/Zope2/__init__.py", line 47, in startup
    _startup()
  File "/opt/zenoss/lib/python/Zope2/App/startup.py", line 57, in startup
    DB = configuration.dbtab.getDatabase('/', is_root=1)
  File "/opt/zenoss/lib/python/DBTab/DBTab.py", line 96, in getDatabase
    db = self._createDatabase(name, is_root)
  File "/opt/zenoss/lib/python/DBTab/DBTab.py", line 113, in _createDatabase
    db = factory.open()
  File "/opt/zenoss/lib/python/Zope2/Startup/datatypes.py", line 163, in open
    DB = self.createDB()
  File "/opt/zenoss/lib/python/Zope2/Startup/datatypes.py", line 160, in createDB
    return ZODBDatabase.open(self)
  File "/opt/zenoss/lib/python/ZODB/config.py", line 97, in open
    storage = section.storage.open()
  File "/opt/zenoss/lib/python/ZODB/config.py", line 153, in open
    read_only_fallback=self.config.read_only_fallback)
  File "/opt/zenoss/lib/python/ZEO/ClientStorage.py", line 314, in __init__
    self._cache.open()
  File "/opt/zenoss/lib/python/ZEO/cache.py", line 112, in open
    self.fc.scan(self.install)
  File "/opt/zenoss/lib/python/ZEO/cache.py", line 835, in scan
    install(self.f, ent)
  File "/opt/zenoss/lib/python/ZEO/cache.py", line 121, in install
    o = Object.fromFile(f, ent.key, skip_data=True)
  File "/opt/zenoss/lib/python/ZEO/cache.py", line 630, in fromFile
    raise ValueError("corrupted record, oid")
ValueError: corrupted record, oid

This is a cache corruption when you kill -9 or had a unclean shutdown (like powefailure)

A solution is to clear cache

service zenoss stop
rm $zenoshome/var/zeo1-1.zec
service zenoss start