Error when importing a zexp site that uses LinguaPlone - plone

I'm migrating a site from one zope instance to other using the import export tool. The site is using LinguaPlone (Products.LinguaPlone = 4.1.2). Both zope instances are identical because I use buildout and I have picked all eggs. But when migrating it shows the error:
Error Type: AttributeError
Error Value: 'NoneType' object has no attribute 'getTranslations'
I suppose that its the same error that was documented in http://plone.org/products/linguaplone/issues/241. How can I fix the site before migrating to the other zope instance?
The complete traceback:
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 642, in _importObjectFromFile
Module OFS.ObjectManager, line 358, in _setObject
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 OFS.subscribers, line 113, in dispatchObjectMovedEvent
Module zope.container.contained, line 153, in dispatchToSublocations
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 OFS.subscribers, line 113, in dispatchObjectMovedEvent
Module zope.container.contained, line 153, in dispatchToSublocations
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 OFS.subscribers, line 113, in dispatchObjectMovedEvent
Module zope.container.contained, line 153, in dispatchToSublocations
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 OFS.subscribers, line 113, in dispatchObjectMovedEvent
Module zope.container.contained, line 153, in dispatchToSublocations
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 Products.CMFCore.CMFCatalogAware, line 262, in handleContentishEvent
Module Products.CMFCore.CMFCatalogAware, line 188, in notifyWorkflowCreated
Module Products.CMFCore.WorkflowTool, line 289, in notifyCreated
Module Products.CMFCore.WorkflowTool, line 635, in _reindexWorkflowVariables
Module Products.Archetypes.CatalogMultiplex, line 104, in reindexObject
Module Products.Archetypes.ExtensibleMetadata, line 504, in notifyModified
Module Products.LinguaPlone.utils, line 133, in generatedMutator
Module Products.LinguaPlone.I18NBaseObject, line 221, in getTranslations
AttributeError: 'NoneType' object has no attribute 'getTranslations'

Related

Plone- ComponentLookUpError is preventing me from deleting Plone site?

I'm trying to delete a Plone site I am testing. However, when I delete it, I get an error.
From the console:
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module OFS.ObjectManager, line 540, in manage_delObjects
Module OFS.ObjectManager, line 391, in _delObject
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 OFS.subscribers, line 101, in dispatchObjectWillBeMovedEvent
Module zope.container.contained, line 153, in dispatchToSublocations
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 OFS.subscribers, line 101, in dispatchObjectWillBeMovedEvent
Module zope.container.contained, line 153, in dispatchToSublocations
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 OFS.subscribers, line 101, in dispatchObjectWillBeMovedEvent
Module zope.container.contained, line 153, in dispatchToSublocations
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 OFS.subscribers, line 101, in dispatchObjectWillBeMovedEvent
Module zope.container.contained, line 153, in dispatchToSublocations
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 OFS.subscribers, line 101, in dispatchObjectWillBeMovedEvent
Module zope.container.contained, line 153, in dispatchToSublocations
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 Products.CMFCore.CMFCatalogAware, line 271, in handleContentishEvent
Module Products.CMFCore.CMFCatalogAware, line 76, in unindexObject
Module Products.CMFCore.CatalogTool, line 280, in unindexObject
Module Products.CMFPlone.CatalogTool, line 354, in uncatalog_object
Module Products.ZCatalog.ZCatalog, line 508, in uncatalog_object
Module Products.ZCatalog.Catalog, line 383, in uncatalogObject
Module Products.PluginIndexes.common.UnIndex, line 286, in unindex_object
Module Products.PluginIndexes.UUIDIndex.UUIDIndex, line 98, in removeForwardIndexEntry
Module z3c.relationfield.relation, line 79, in __cmp__
Module z3c.relationfield.relation, line 82, in _sort_key
Module z3c.relationfield.relation, line 31, in from_path
Module plone.app.relationfield.monkey, line 14, in get_from_object
Module z3c.relationfield.relation, line 110, in _object
Module zope.component._api, line 169, in getUtility
ComponentLookupError: (<InterfaceClass zope.intid.interfaces.IIntIds>, '')
The page just displays:
(<InterfaceClass zope.intid.interfaces.IIntIds>, '')
I do use IIntIds in an event subscriber and I am wondering maybe if this could be the problem.
When a object of a particular content type transitions, another object of another content type is created and I "get" a relation value from the created object using the IIntIds utility. The RelationValue is appended to the relatedItems of the object transitioning.
The object created has relatedItems as well and I get the relation value of the object transitioning and append it to the created object's relatedItems.
In configure.zcml:
<subscriber
for="my.product.myobject.MyObject
Products.DCWorkflow.interfaces.IAfterTransitionEvent"
handler=".events.myObjectTransitioned" />
In events.py:
def myObjectTransitioned(obj,event):
....
action = event.status['complete']
if action == 'activate':
.....
try:
new_obj = api.content.create(container=OtherObjs,portal_type='my.object.anotherobject',
title=a_concat_title, id=a_concat_title)
int_ids = getUtility(IIntIds)
obj.relatedItems.append(RelationValue(int_ids.getId(new_obj)))
new_obj.relatedItems.append(RelationValue(int_ids.getId(obj)))
obj.reindexObject()
new_obj.reindexObject()
except:
print "failed creation"
I came across a similar question that was asked and one of the answers mentioned not having plone.app.relationfield or plone.app.intId installed. I have plone.app.relationfield (RelationValue) and plone.app.intId (plone.app.intid: install utility).
I'm basically doing this so that the new_obj can get information from obj (transitioned object), and visa versa, by conveniently calling to_object. However, I'm guessing this is causing this error and I should use a back reference for new_obj getting information from obj?
What basically prevents you from deleting your site are the events that are triggered everytime (that run your mentioned troublesome code). To prevent this behavior, I can suggest doing the following:
$ cd {buildout-dir}
$ bin/zopepy
> from transaction import commit
> app._delObject('Plone', suppress_events=True)
> commit()
In general it is not recommended to do this for objects within a Plone site, as this would for example also prevent the portal_catalog from updating and cause other side effects. But as you delete the site as a whole, it does not matter.

Plone 4.0.7 - Maximum recursion depth error when checking in large PDF

Recently one of our site users successfully checked out a large PDF and was trying to check it back in but it failed with the following stack trace:
2013-02-21 12:42:39 ERROR Zope.SiteErrorLog 1361450559.20.0921547927966
http://phoebe:8095/portal/our-responsibilities/codes-of-conduct/copy_of_please-let-us-
know-where-you-live/content_status_modify
Traceback (innermost last):
Module ZPublisher.Publish, line 127, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 47, in call_object
Module Products.CMFFormController.FSControllerPythonScript, line 105, in __call__
Module Products.CMFFormController.Script, line 145, in __call__
Module Products.CMFCore.FSPythonScript, line 130, in __call__
Module Shared.DC.Scripts.Bindings, line 324, in __call__
Module Shared.DC.Scripts.Bindings, line 361, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 344, in _exec
Module script, line 42, in content_status_modify
- <FSControllerPythonScript at /portal/our-responsibilities/codes-of-conduct/please-
let-us-know-where-you-live/content_status_modify>
- Line 42
Module Products.CMFCore.WorkflowTool, line 244, in doActionFor
Module Products.CMFCore.WorkflowTool, line 555, in _invokeWithNotification
Module Products.DCWorkflow.DCWorkflow, line 282, in doActionFor
Module Products.DCWorkflow.DCWorkflow, line 421, in _changeStateOf
Module Products.DCWorkflow.DCWorkflow, line 465, in _executeTransition
Module zope.event, line 23, in notify
Module zope.component.event, line 26, in dispatch
Module zope.component._api, line 138, in subscribers
Module zope.component.registry, line 323, in subscribers
Module zope.interface.adapter, line 575, in subscribers
Module zope.component.event, line 34, in objectEventNotify
Module zope.component._api, line 138, in subscribers
Module zope.component.registry, line 323, in subscribers
Module zope.interface.adapter, line 575, in subscribers
Module arcadia.app.events, line 22, in before_transition
Module plone.app.iterate.browser.checkin, line 50, in __call__
Module plone.app.iterate.policy, line 90, in checkin
Module zope.event, line 23, in notify
Module zope.component.event, line 26, in dispatch
Module zope.component._api, line 138, in subscribers
Module zope.component.registry, line 323, in subscribers
Module zope.interface.adapter, line 575, in subscribers
Module plone.app.iterate.subscribers.versioning, line 36, in handleAfterCheckin
Module plone.app.iterate.archiver, line 43, in save
Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 297, in save
Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 443, in
_recursiveSave
Module Products.CMFEditions.ArchivistTool, line 267, in prepare
Module Products.CMFEditions.ArchivistTool, line 221, in _cloneByPickle
Module ZODB.Connection, line 843, in setstate
Module logging, line 1047, in error
Module logging, line 1128, in _log
Module logging, line 1108, in makeRecord
Module logging, line 243, in __init__
RuntimeError: maximum recursion depth exceeded while calling a Python object
Has anyone else experienced this issue?
The PDF in question is 24MB in size, checking in a PDF reduced down to 9MB didn't cause the problem.
A simple solution is to keep the size of the PDFs down, but the user is adament they wan the larger version (higher resolution for printing).
Does anyone know:
Whether there is a fix for thi issue?
What the maximum size of a BLOB that can be checked in is?
Thanks
Tony
You may want to visit /portal_modifier/SkipVersioningOfLargeFilesAndImages/modifierEditForm in your site, and enable this modifier. This will disable versioning for the uploaded file payload for files larger than the threshold specified, but enable versioning for any edited metadata.

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.

Plone Gazatte throwing traceback when adding newsletter in newsletter theme

I am using Plone 4.1.3. I installed PloneGazatte product without any mount points, it was working fine. In the same version, I created mount points and installed the product. When I create a newsletter in the newsletter theme it is throwing traceback errors.
Can anyone help me how to solve these errors?
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 Products.CMFFormController.FSControllerPythonScript, line 105, in __call__
Module Products.CMFFormController.Script, line 145, in __call__
Module Products.CMFCore.FSPythonScript, line 130, in __call__
Module Shared.DC.Scripts.Bindings, line 322, in __call__
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 344, in _exec
Module script, line 31, in createObject
- <FSControllerPythonScript at /en/indg.in/createObject used for /en/indg.in/indg-newsletter>
- Line 31
Module Products.CMFCore.PortalFolder, line 295, in invokeFactory
Module Products.CMFCore.TypesTool, line 835, in constructContent
Module Products.CMFCore.TypesTool, line 313, in constructInstance
Module Products.CMFCore.TypesTool, line 554, in _constructInstance
Module Products.PloneGazette.Newsletter, line 81, in addNewsletter
Module OFS.ObjectManager, line 356, in _setObject
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 Products.CMFCore.CMFCatalogAware, line 265, in handleContentishEvent
Module Products.CMFCore.CMFCatalogAware, line 191, in notifyWorkflowCreated
Module Products.CMFCore.WorkflowTool, line 292, in notifyCreated
Module Products.CMFCore.WorkflowTool, line 638, in _reindexWorkflowVariables
Module Products.CMFCore.CMFCatalogAware, line 91, in reindexObject
Module Products.CMFCore.CatalogTool, line 304, in reindexObject
Module Products.CMFPlone.CatalogTool, line 387, in catalog_object
Module Products.ZCatalog.ZCatalog, line 476, in catalog_object
Module Products.ZCatalog.Catalog, line 322, in catalogObject
Module Products.ZCatalog.Catalog, line 272, in updateMetadata
Module Products.ZCatalog.Catalog, line 396, in recordify
Module plone.indexer.wrapper, line 59, in __getattr__
Module plone.indexer.delegate, line 16, in __call__
Module plone.contentratings.catalog, line 20, in average_rating
Module plone.contentratings.catalog, line 9, in _first_user_rating
Module contentratings.browser.aggregator, line 8, in get_rating_categories
Module contentratings.browser.aggregator, line 8, in <genexpr>
Module zope.component.registry, line 250, in getAdapters
Module contentratings.category, line 69, in __call__
Module zope.component._api, line 120, in queryMultiAdapter
Module zope.component.registry, line 238, in queryMultiAdapter
Module zope.interface.adapter, line 532, in queryMultiAdapter
Module contentratings.category, line 102, in __init__
Module contentratings.category, line 121, in _lookup_or_create_storage
TypeError: ('Could not adapt', <Newsletter at /en/indg.in/indg-newsletter/newsletter.2012-06-26.1477811319>, <InterfaceClass zope.annotation.interfaces.IAnnotations>)
Looks like plone.contentratings is incompatible with PloneGazette. plone.contentratings assumes here that it can annotate the Newsletter, but it fails to check if Newsletter can be adapted to the IAnnotation interface.
I would say this needs a fix in plone.contentratings (or its dependency contentratings). But I would also expect that PloneGazette can be adapted, so probably it can be fixed there as well.
I would suggest to find the bug trackers for these two packages and file a bug there. Or hope that one of the authors reads this stackoverflow question.

Cannot change the Type Settings in Site Setup

I am trying to change the Type Settings in Site Setup. The default is Simple Publication Workflow. When I tried to change it to Intranet Workflow or Community Workflow or any other workflow, I got this error:
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 plone.app.controlpanel.types, line 165, in __call__
Module zope.event, line 23, 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 583, in subscribers
Module plone.app.discussion.browser.controlpanel, line 181, in notify_configuration_changed
AttributeError: 'NoneType' object has no attribute 'forInterface'
Can anybody advise?
We are using plone 4.1
Thank you very much.
Cmgui

Resources