[Migration] ConnectionStateError: Shouldn't load state for five.localsitemanager.registry.PersistentComponents

I am trying to migrate a Plone 4.3 installation with mixed AT and DX content to 5.1.2.

The Plone upgrade fails badly:


2018-10-22 14:46:54 ERROR ZODB.Connection Shouldn't load state for five.localsitemanager.registry.PersistentComponents 0x4b80 when the connection is closed
Traceback (most recent call last):
  File "/home/ajung/.buildout/eggs/ZODB-5.3.0-py2.7.egg/ZODB/Connection.py", line 790, in setstate
    raise ConnectionStateError(msg)
ConnectionStateError: Shouldn't load state for five.localsitemanager.registry.PersistentComponents 0x4b80 when the connection is closed
2018-10-22 14:46:54 ERROR ZODB.Connection Shouldn't load state for five.localsitemanager.registry.PersistentComponents 0x4b80 when the connection is closed
Traceback (most recent call last):
  File "/home/ajung/.buildout/eggs/ZODB-5.3.0-py2.7.egg/ZODB/Connection.py", line 790, in setstate
    raise ConnectionStateError(msg)
ConnectionStateError: Shouldn't load state for five.localsitemanager.registry.PersistentComponents 0x4b80 when the connection is closed
2018-10-22 14:46:54 ERROR ZServerPublisher exception caught
Traceback (most recent call last):
  File "/home/ajung/.buildout/eggs/Zope2-2.13.27-py2.7.egg/ZServer/PubCore/ZServerPublisher.py", line 31, in __init__
    response=b)
  File "/home/ajung/.buildout/eggs/Zope2-2.13.27-py2.7.egg/ZPublisher/Publish.py", line 455, in publish_module
    environ, debug, request, response)
  File "/home/ajung/.buildout/eggs/Zope2-2.13.27-py2.7.egg/ZPublisher/Publish.py", line 276, in publish_module_standard
    if request is not None: request.close()
  File "/home/ajung/.buildout/eggs/Zope2-2.13.27-py2.7.egg/ZPublisher/BaseRequest.py", line 220, in close
    notify(EndRequestEvent(None, self))
  File "/home/ajung/.buildout/eggs/zope.event-3.5.2-py2.7.egg/zope/event/__init__.py", line 31, in notify
    subscriber(event)
  File "/home/ajung/.buildout/eggs/zope.component-4.4.1-py2.7.egg/zope/component/event.py", line 27, in dispatch
    component_subscribers(event, None)
  File "/home/ajung/.buildout/eggs/zope.component-4.4.1-py2.7.egg/zope/component/_api.py", line 139, in subscribers
    return sitemanager.subscribers(objects, interface)
  File "/home/ajung/.buildout/eggs/ZODB-5.3.0-py2.7.egg/ZODB/Connection.py", line 790, in setstate
    raise ConnectionStateError(msg)
ConnectionStateError: Shouldn't load state for five.localsitemanager.registry.PersistentComponents 0x4b80 when the connection is closed
2018-10-22 14:46:54 ERROR ZODB.Connection Shouldn't load state for five.localsitemanager.registry.PersistentComponents 0x4b80 when the connection is closed
Traceback (most recent call last):
  File "/home/ajung/.buildout/eggs/ZODB-5.3.0-py2.7.egg/ZODB/Connection.py", line 790, in setstate
    raise ConnectionStateError(msg)
ConnectionStateError: Shouldn't load state for five.localsitemanager.registry.PersistentComponents 0x4b80 when the connection is closed
2018-10-22 14:46:54 ERROR ZODB.Connection Shouldn't load state for five.localsitemanager.registry.PersistentComponents 0x4b80 when the connection is closed
Traceback (most recent call last):
  File "/home/ajung/.buildout/eggs/ZODB-5.3.0-py2.7.egg/ZODB/Connection.py", line 790, in setstate
    raise ConnectionStateError(msg)
ConnectionStateError: Shouldn't load state for five.localsitemanager.registry.PersistentComponents 0x4b80 when the connection is closed
2018-10-22 14:46:54 ERROR ZServerPublisher exception caught
Traceback (most recent call last):
  File "/home/ajung/.buildout/eggs/Zope2-2.13.27-py2.7.egg/ZServer/PubCore/ZServerPublisher.py", line 31, in __init__
    response=b)
  File "/home/ajung/.buildout/eggs/Zope2-2.13.27-py2.7.egg/ZPublisher/Publish.py", line 455, in publish_module
    environ, debug, request, response)
  File "/home/ajung/.buildout/eggs/Zope2-2.13.27-py2.7.egg/ZPublisher/Publish.py", line 276, in publish_module_standard
    if request is not None: request.close()
  File "/home/ajung/.buildout/eggs/Zope2-2.13.27-py2.7.egg/ZPublisher/BaseRequest.py", line 220, in close
    notify(EndRequestEvent(None, self))
  File "/home/ajung/.buildout/eggs/zope.event-3.5.2-py2.7.egg/zope/event/__init__.py", line 31, in notify
    subscriber(event)
  File "/home/ajung/.buildout/eggs/zope.component-4.4.1-py2.7.egg/zope/component/event.py", line 27, in dispatch
    component_subscribers(event, None)
  File "/home/ajung/.buildout/eggs/zope.component-4.4.1-py2.7.egg/zope/component/_api.py", line 139, in subscribers
    return sitemanager.subscribers(objects, interface)
  File "/home/ajung/.buildout/eggs/ZODB-5.3.0-py2.7.egg/ZODB/Connection.py", line 790, in setstate
    raise ConnectionStateError(msg)
ConnectionStateError: Shouldn't load state for five.localsitemanager.registry.PersistentComponents 0x4b80 when the connection is closed

Any idea?

maybe related? ConnectionStateError: Shouldn't load state for five.localsitemanager.registry.PersistentComponents 0x1a26bf when the connection is closed

Did you find a solution?

Got something similar:

      File "/home/espen/instance8095/Plone50/buildout-cache/eggs/Zope2-2.13.24-py2.7.egg/ZServer/PubCore/ZServerPublisher.py", line 31, in __init__
    response=b)
  File "/home/espen/instance8095/Plone50/buildout-cache/eggs/Zope2-2.13.24-py2.7.egg/ZPublisher/Publish.py", line 455, in publish_module
    environ, debug, request, response)
  File "/home/espen/instance8095/Plone50/buildout-cache/eggs/Zope2-2.13.24-py2.7.egg/ZPublisher/Publish.py", line 276, in publish_module_standard
    if request is not None: request.close()
  File "/home/espen/instance8095/Plone50/buildout-cache/eggs/Zope2-2.13.24-py2.7.egg/ZPublisher/BaseRequest.py", line 220, in close
    notify(EndRequestEvent(None, self))
  File "/home/espen/instance8095/Plone50/buildout-cache/eggs/zope.event-3.5.2-py2.7.egg/zope/event/__init__.py", line 31, in notify
    subscriber(event)
  File "/home/espen/instance8095/Plone50/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/event.py", line 24, in dispatch
    zope.component.subscribers(event, None)
  File "/home/espen/instance8095/Plone50/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/_api.py", line 136, in subscribers
    return sitemanager.subscribers(objects, interface)
  File "/home/espen/instance8095/Plone50/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/registry.py", line 321, in subscribers
    return self.adapters.subscribers(objects, provided)
  File "/home/espen/instance8095/Plone50/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-i686.egg/ZODB/Connection.py", line 857, in setstate
    raise ConnectionStateError(msg)
  ConnectionStateError: Shouldn't load state for 0x0726 when the connection is closed

Espen via Plone Community wrote at 2023-1-31 14:16 +0000:

Did you find a solution?

The error means that a persistent object is used in a forbidden way:
i.e. via a foreign ZODB connection.

This typically happens when a persistent object is stored
in a global place (e.g. a module, a class or a global object)
or passed across thread boundaries.
In order to access a persistent object in those cases,
the object must be reloaded from the ZODB, typically via a new
ZODB connection.