collective / collective.lineage

Turns subfolders of a Plone site to appear as autonomous Plone sites
https://pypi.org/project/collective.lineage
12 stars 9 forks source link

Need upgrade 1.X release prior to the 2.0 release to properly remove old descriptors #28

Open calvinhp opened 9 years ago

calvinhp commented 9 years ago

taking an existing 1.1.1 lineage site and checking out master on plone 4.3 will result in an unusable Plone site with this error:

2014-10-23 09:31:25 ERROR ZServerPublisher exception caught
Traceback (most recent call last):
  File "/Users/calvin/.buildout/eggs/Zope2-2.13.22-py2.7.egg/ZServer/PubCore/ZServerPublisher.py", line 31, in __init__
    response=b)
  File "/Users/calvin/.buildout/eggs/Zope2-2.13.22-py2.7.egg/ZPublisher/Publish.py", line 455, in publish_module
    environ, debug, request, response)
  File "/Users/calvin/.buildout/eggs/Zope2-2.13.22-py2.7.egg/ZPublisher/Publish.py", line 276, in publish_module_standard
    if request is not None: request.close()
  File "/Users/calvin/.buildout/eggs/Zope2-2.13.22-py2.7.egg/ZPublisher/BaseRequest.py", line 218, in close
    notify(EndRequestEvent(None, self))
  File "/Users/calvin/.buildout/eggs/zope.event-3.5.2-py2.7.egg/zope/event/__init__.py", line 31, in notify
    subscriber(event)
  File "/Users/calvin/.buildout/eggs/zope.component-3.9.5-py2.7.egg/zope/component/event.py", line 24, in dispatch
    zope.component.subscribers(event, None)
  File "/Users/calvin/.buildout/eggs/zope.component-3.9.5-py2.7.egg/zope/component/_api.py", line 136, in subscribers
    return sitemanager.subscribers(objects, interface)
  File "/Users/calvin/.buildout/eggs/ZODB3-3.10.5-py2.7-macosx-10.9-x86_64.egg/ZODB/Connection.py", line 860, in setstate
    self._setstate(obj)
  File "/Users/calvin/.buildout/eggs/ZODB3-3.10.5-py2.7-macosx-10.9-x86_64.egg/ZODB/Connection.py", line 914, in _setstate
    self._reader.setGhostState(obj, p)
  File "/Users/calvin/.buildout/eggs/ZODB3-3.10.5-py2.7-macosx-10.9-x86_64.egg/ZODB/serialize.py", line 612, in setGhostState
    state = self.getState(pickle)
  File "/Users/calvin/.buildout/eggs/ZODB3-3.10.5-py2.7-macosx-10.9-x86_64.egg/ZODB/serialize.py", line 605, in getState
    return unpickler.load()
  File "/Users/calvin/.virtualenvs/lineage/bin/../lib/python2.7/copy_reg.py", line 48, in _reconstructor
    obj = object.__new__(cls)
TypeError: ('object.__new__(ChildSiteDescriptor) is not safe, use Persistence.Persistent.__new__()', <function _reconstructor at 0x10c04eaa0>, (<class 'collective.lineage.descriptors.ChildSiteDescriptor'>, <type 'object'>, None))
claytron commented 9 years ago

A 1.1.2 release was done to handle this.

f4biosa commented 9 years ago

But version 1.1.2 is not just to upgrade to 2.0? It is the same problem when trying to upgrade from 1.1.2 to 2.0.

ivanteoh commented 8 years ago

Me too. It is the same problem when trying to upgrade from 1.1.2 to 2.0. Anyone know the solution for this issue?

thet commented 8 years ago

@f4biosa @ivanteoh did you run the 1.1.2 upgrade step? this is necessary in order to migrate to 2.0. you should see an upgrade button in the "Add-ons" controlpanel ( e.g. http://localhost:8080/Plone/prefs_install_products_form ) or in the ZMI ( e.g. http://localhost:8080/Plone/portal_setup/manage_upgrades ). Also see: https://github.com/collective/collective.lineage/blob/1.1.x/README.rst#upgrading-to-2x

ivanteoh commented 8 years ago

@thet I did run the 1.1.2 upgrade step by clicking the upgrade button in the "Add-ons" controlpanel. But see the error stack on instance log as above after upgrading the plugin to 2.0.

thet commented 8 years ago

I don't know if it will fix it, but you can also try to uninstall collective.lineage in 1.1.2 and reinstall it in 2.0. it should be safe to do that, your childsites won't be lost.

thet commented 8 years ago

and if nothing helps.... you might be able to fix it via https://pypi.python.org/pypi/wildcard.fixpersistentutilities/

ivanteoh commented 8 years ago

Thanks. I will give it a go.

sneridagh commented 8 years ago

Same issue and error here than @calvinhp found some months ago. I've managed to reproduce from a clean environment as well. Steps to reproduce it:

From a clean Plone 4.3.4:

  1. Install c.lineage 1.1
  2. Create a folder and mark it as subsite
  3. Upgrade to 1.1.2 (with 1.1.3 same results), run upgrade steps
  4. Upgrade to 2.0

Site (and full Zope instance) becomes unusable with the same error that @calvinhp stated.

I tried also wilcard.fixpersistentutilities but with poor success. It seems to delete the utility and it works fine, the error gone. However, when you restart the instance it's broken again. Tried to manually erase the utility too with no success.

The uninstall step in 1.1.2 (and 1.1.3) certainly does something but the GS subtyper uninstall step is not doing its job.

As a workarround, I kept arround p4a.subtyper as a forced dependency and it worked, however it would be nice if the uninstall is performed cleanly.

Any ideas?