PicklingError after upgrading to Plone 4.3 - plone

Site with Plone 4.2.5 was upgraded to Plone 4.3.4.
When doing a check-out of an object, the following error is shown:
2015-04-22T01:18:16 ERROR Zope.SiteErrorLog 1429676296.560.86437176197 http://localhost:8181/Plone/capa/##content-checkout
Traceback (innermost last):
Module ZPublisher.Publish, line 146, in publish
Module Zope2.App.startup, line 301, in commit
Module transaction._manager, line 89, in commit
Module transaction._transaction, line 329, in commit
Module transaction._transaction, line 443, in _commitResources
Module ZODB.Connection, line 559, in commit
Module ZODB.Connection, line 1123, in savepoint
Module ZODB.Connection, line 623, in _commit
Module ZODB.Connection, line 658, in _store_objects
Module ZODB.serialize, line 422, in serialize
Module ZODB.serialize, line 431, in _dump
PicklingError: Can't pickle <class 'plone.app.kss.interfaces.IPortalObject'>: import of module plone.app.kss.interfaces failed
No objects on the catalog provide plone.app.kss.interfaces.IPortalObject.
Any idea?

You should always read the Plone upgrade guide before doing a migration:
https://plone.org/documentation/manual/upgrade-guide/version/upgrading-plone-4.2-to-4.3/referencemanual-all-pages
plone.app.kss is no longer shipped with Plone 4.3.x. You have to re-add it to your buildout.cfg:
eggs =
...
plone.app.kss
Though, I would suggest that you clean up your ZODB after the upgrade. Otherwise you will run into problems since plone.app.kss is unmaintained.

Related

Upgrade Plone 3.3.6 to either Plone 4.3.7 or Plone 5 (Error: 'tuple' object has no attribute 'remove')

I'm attempting an upgrade of an existing site from Plone 3.3.6 to Plone 4.3.7, and then on to Plone 5.0.
The existing site is very small, and has no add-on Products installed (vanilla Plone, vanilla template, etc.) It did have CacheFu installed, but after some earlier obvious errors with that, I removed it prior to the upgrade. I'm simply copying the contents of var/filestorage (Data.fs, etc) from v3 site to v4 site and re-running buildout.
In Plone 4.3.7, when running the UPGRADE option, I see a lot of successful activity, and then the following error at the bottom:
Upgrade aborted. Error:
Traceback (most recent call last):
File "/usr/local/Plone4_migration/buildout-cache/eggs/Products.CMFPlone-4.3.7-py2.7.egg/Products/CMFPlone/MigrationTool.py", line 259, in upgrade
step['step'].doStep(setup)
File "/usr/local/Plone4_migration/buildout-cache/eggs/Products.GenericSetup-1.7.7-py2.7.egg/Products/GenericSetup/upgrade.py", line 160, in doStep
self.handler(tool)
File "/usr/local/Plone4_migration/buildout-cache/eggs/plone.app.upgrade-1.3.18-py2.7.egg/plone/app/upgrade/v40/betas.py", line 99, in beta3_beta4
value.remove('Large Plone Folder')
AttributeError: 'tuple' object has no attribute 'remove'
If I skip Plone 4.x and jump right to Plone 5.0, I can't even run the UPGRADE feature, and just get the following error trace on the console:
2015-10-09 01:14:21 ERROR Zope.SiteErrorLog 1444371261.060.792132208718 http://www.example.com/example
Traceback (innermost last):
Module ZPublisher.Publish, line 127, in publish
Module ZPublisher.BaseRequest, line 444, in traverse
Module ZPublisher.BeforeTraverse, line 97, in __call__
Module Products.CMFCore.PortalObject, line 75, in __before_publishing_traverse__
Module zope.event, line 31, in notify
Module zope.component.event, line 24, in dispatch
Module zope.component._api, line 136, in subscribers
Module zope.component.registry, line 321, in subscribers
Module zope.interface.adapter, line 585, in subscribers
Module zope.component.event, line 32, in objectEventNotify
Module zope.component._api, line 136, in subscribers
Module zope.component.registry, line 321, in subscribers
Module zope.interface.adapter, line 585, in subscribers
Module plone.app.theming.plugins.hooks, line 33, in onRequest
Module plone.app.theming.policy, line 90, in isThemeEnabled
AttributeError: 'NoneType' object has no attribute 'enabled'
This is a known bug which has a fix that was not released yet: https://github.com/plone/Products.CMFPlone/issues/1134

Can't create Dexterity content type programatically in Plone 4.3.1

I created a new content type using the Dexterity manager in Site Setup. I'm able to successfully add content through the Plone user interface, but I've come to a point where I need to create the same object with a python script.
My first attempt was with invokeFactory:
context.invokeFactory("mycontenttype", id="test", Title="Test")
This same code works for "Folder" objects, but fails with my Dexterity type:
Traceback (innermost last):
Module ZPublisher.Publish, line 60, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module Shared.DC.Scripts.Bindings, line 322, in __call__
Module Products.PloneHotfix20130618.spamProtect, line 35, in _patched_bindAndExec
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 344, in _exec
Module script, line 7, in test
- <PythonScript at /three-year-plan/test>
- Line 7
TypeError: invokeFactory() takes at least 3 arguments (2 given)
After doing some more searching, I found several places referring to the following function:
from plone.dexterity.utils import createContentInContainer
Any attempt to import from plone.dexterity.utils in my python scripts ends up with a permissions error:
Traceback (innermost last):
Module ZPublisher.Publish, line 60, in publish
Module ZPublisher.mapply, line 77, in mapply
zModule ZPublisher.Publish, line 46, in call_object
Module Shared.DC.Scripts.Bindings, line 322, in __call__
Module Products.PloneHotfix20130618.spamProtect, line 35, in _patched_bindAndExec
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 344, in _exec
Module script, line 1, in test
- <PythonScript at /my-site/test>
- Line 1
Module AccessControl.ZopeGuards, line 305, in guarded_import
Unauthorized: import of 'plone.dexterity.utils' is unauthorized
Any help in resolving the errors above or alternative methods would be greatly appreciated. Version details are posted below for reference.
Version Overview
Plone 4.3.1 (4306)
CMF 2.2.7
Zope 2.13.19
Python 2.7.3 (default, Aug 1 2012, 05:14:39) [GCC 4.6.3]
PIL 1.7.8 (Pillow)
Dexterity Content Types 2.0.8
You should be able to use "invokeFactory" for this purpose. You call it on the container and pass it the type name as a string.
I'm not sure where your attempt to use the invokeFactory method went awry, but it does work. See http://developer.plone.org/reference_manuals/external/plone.app.dexterity/reference/manipulating-content-objects.html?highlight=invokefactory#adding-an-object-to-a-container for details.
Your guess is right: you have to use createContentInContainer.
But you cannot use it in a Python script because only the so called restricted Python is allowed [1]. Put it in a view [2].
As a reference have a look to:
http://developer.plone.org/reference_manuals/active/helloworld/extend/view.html
http://plone.org/documentation/faq/restricted-python-scripts

Plone 4.3 migration - AttributeError: type object 'IIntIds' has no attribute '__iro__'

After migrating Plone 4.1 + Dexterity site to Plone 4.3 site's /manage_workspace becomes inaccessible. Database migration cannot be performed.
The ZMI root can be still accessed.
Traceback (innermost last):
Module ZPublisher.Publish, line 237, in publish_module_standard
Module ZPublisher.Publish, line 179, in publish
Module zope.event, line 31, in notify
Module zope.component.event, line 24, in dispatch
Module zope.component._api, line 136, in subscribers
Module zope.component.registry, line 321, in subscribers
Module zope.interface.adapter, line 585, in subscribers
Module plone.transformchain.zpublisher, line 119, in applyTransformOnFailure
Module plone.transformchain.zpublisher, line 79, in applyTransformOnSuccess
Module plone.transformchain.zpublisher, line 55, in applyTransform
Module zope.component._api, line 172, in queryUtility
Module zope.component.registry, line 163, in queryUtility
Module ZODB.Connection, line 860, in setstate
Module ZODB.Connection, line 914, in _setstate
Module ZODB.serialize, line 613, in setGhostState
Module zope.component.persistentregistry, line 40, in __setstate__
Module zope.interface.adapter, line 91, in _createLookup
Module zope.interface.adapter, line 439, in __init__
Module zope.interface.adapter, line 476, in init_extendors
Module zope.interface.adapter, line 480, in add_extendor
AttributeError: type object 'IIntIds' has no attribute '__iro__'
Also ##plone-upgrade is inaccessible.
Any ideas or special migrations needed?
In Dexterity 2, relation field support (which includes installing the intids catalog) is no longer installed by default. To get it you need to install Dexterity with the [relations] extra:
[instance]
eggs =
plone.app.dexterity [relations]
This is documented at http://plone.org/documentation/manual/upgrade-guide/version/upgrading-plone-4.2-to-4.3/dexterity-optional-extras and in the Dexterity release notes.

How to cleanup groupdashboard picklingError

On a migrated Plone website (3.3 -> 4.0) I just can't apply 'portlets' step.
The traceback:
2013-01-23 12:15:51 ERROR Zope.SiteErrorLog 1358939751.450.337074106184 http://localhost:8080/plone/portal_quickinstaller/prefs_reinstallProducts
Traceback (innermost last):
Module ZPublisher.Publish, line 135, in publish
Module Zope2.App.startup, line 291, in commit
Module transaction._manager, line 93, in commit
Module transaction._transaction, line 322, in commit
Module transaction._transaction, line 416, in _commitResources
Module ZODB.Connection, line 558, in commit
Module ZODB.Connection, line 606, in _commit
Module ZODB.Connection, line 640, in _store_objects
Module ZODB.serialize, line 422, in serialize
Module ZODB.serialize, line 431, in _dump
PicklingError: Can't pickle <class 'collective.groupdashboard.interfaces.IGroupDashboardLayer'>: import of module collective.groupdashboard.interfaces failed
Do I need to add this addon back to my setup or could I delete this instance without it ? Is there any way to fake this class to then delete it ?
I don't know how I can remove that stuff. Any workaround welcomed !

AttributeError: 'module' object has no attribute 'NavigationViewlet'

here is my traceback from a Plone 4.2.1 installation (on SuSE Linux):
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module OFS.ObjectManager, line 620, in manage_importObject
Module OFS.ObjectManager, line 638, in _importObjectFromFile
Module ZODB.ExportImport, line 92, in importFile
Module transaction._transaction, line 260, in savepoint
Module transaction._transaction, line 257, in savepoint
Module transaction._transaction, line 690, in __init__
Module ZODB.Connection, line 1123, in savepoint
Module ZODB.Connection, line 587, in _commit
Module ZODB.ExportImport, line 176, in _importDuringCommit
AttributeError: 'module' object has no attribute 'NavigationViewlet'
The strange thing, that I do not understand is, why only one Plone Site shows this error during import into an instance newer than Plone 4.1.5?
The Plone site has only the following additional plugins/products installed (as others too, but they all work fine):
LinguaPlone
PloneFormGen
Products.ZSyncer
collective.quickupload
So, where is my mistake/error?
Thanx for any help, because the site is too big now to "rebuild" it in a new Plone instance from scratch :-(
The plone.app.layout.viewlets.links.NavigationViewlet was removed in plone.app.layout version 2.2 (see this entry into the HTML5 PLIP and this commit).
ZEXP imports into different version stacks are generally fraught with problems, exactly because of changing persistent object locations. You'll have to import to an earlier version of the software stack, then follow the regular Plone upgrade path to bring yourself up to a more recent version of Plone.
The upgrade scripts take care of removing references to removed viewlets like these, for example.

Resources