Personal tools
You are here: Home Documentation How To's Beware the ZMI Cut and Paste buttons

Beware the ZMI Cut and Paste buttons

by T. Kim Nguyen last modified Apr 04, 2011 11:38 AM

You'll regret using them if you have more than one ZODB mount point.

Bad Problem

Recently one of our primary production Zopes went down very early in the morning, immediately after the nightly zeopack and backup.  

The reason why?  The day before I'd created a script inside a contained Plone site, then, realizing it needed to be at the root of the Zope, I used the Cut and Paste buttons to move the script.  The way the ZMI "moves" objects is that it actually creates a reference to the object's original location.  

The problem? The zeopack removes what it thinks are old/unneeded objects, and so as soon as the Zope restarted it looked for that script in its original location, could not find it, and refused to complete the startup.

The lesson?  Do not use Copy and Paste buttons in the ZMI to move objects, especially if you are moving them between ZODB mount points.

In our case, we have a main Data.fs that doesn't contain much, then for each set of ten Plone sites we create a sites1 folder/ZODB mount point (Sites1.fs), sites2 (Sites2.fs), etc.

Helpful Hints

More info on this error and workarounds/fixes is available on this delightfully detailed and helpful page here:

http://plonechix.blogspot.com/2009/12/definitive-guide-to-poskeyerror.html

Avoidance

This problem is another reason why we need to continue removing site owners from the Administrators group and into a less dangerous Site Owners group.  

Recent versions of Plone 4 have a more nuanced set of groups and associated roles to manage these out of the box.

The error message

This is the error message we got on startup:
Traceback (most recent call last):
  File "/opt/Plone-3.1-01/zeocluster/parts/zope2/lib/python/Zope2/Startup/run.py", line 56, in ?
    run()
  File "/opt/Plone-3.1-01/zeocluster/parts/zope2/lib/python/Zope2/Startup/run.py", line 21, in run
    starter.prepare()
  File "/opt/Plone-3.1-01/zeocluster/parts/zope2/lib/python/Zope2/Startup/__init__.py", line 102, in prepare
    self.startZope()
  File "/opt/Plone-3.1-01/zeocluster/parts/zope2/lib/python/Zope2/Startup/__init__.py", line 278, in startZope
    Zope2.startup()
  File "/opt/Plone-3.1-01/zeocluster/parts/zope2/lib/python/Zope2/__init__.py", line 47, in startup
    _startup()
  File "/opt/Plone-3.1-01/zeocluster/parts/zope2/lib/python/Zope2/App/startup.py", line 102, in startup
    OFS.Application.initialize(application)
  File "/opt/Plone-3.1-01/zeocluster/parts/zope2/lib/python/OFS/Application.py", line 309, in initialize
    initializer.initialize()
  File "/opt/Plone-3.1-01/zeocluster/parts/zope2/lib/python/OFS/Application.py", line 330, in initialize
    self.install_cp_and_products()
  File "/opt/Plone-3.1-01/zeocluster/parts/zope2/lib/python/OFS/Application.py", line 350, in install_cp_and_products
    app._setObject('Control_Panel', cpl)
  File "/opt/Plone-3.1-01/zeocluster/parts/zope2/lib/python/ZODB/Connection.py", line 761, in setstate
    self._setstate(obj)
  File "/opt/Plone-3.1-01/zeocluster/parts/zope2/lib/python/ZODB/Connection.py", line 819, in _setstate
    self._reader.setGhostState(obj, p)
  File "/opt/Plone-3.1-01/zeocluster/parts/zope2/lib/python/ZODB/serialize.py", line 604, in setGhostState
    state = self.getState(pickle)
  File "/opt/Plone-3.1-01/zeocluster/parts/zope2/lib/python/ZODB/serialize.py", line 597, in getState
    return unpickler.load()
  File "/opt/Plone-3.1-01/zeocluster/parts/zope2/lib/python/ZODB/serialize.py", line 479, in _persistent_load
    return self.loaders[reference_type](self, *args)
  File "/opt/Plone-3.1-01/zeocluster/parts/zope2/lib/python/ZODB/serialize.py", line 540, in load_multi_oid
    conn = self._conn.get_connection(database_name)
  File "/opt/Plone-3.1-01/zeocluster/parts/zope2/lib/python/ZODB/Connection.py", line 328, in get_connection
    new_con = self._db.databases[database_name].open(
KeyError: 'sites1'
 
 
Document Actions
  • Print this
  • Bookmarks