Error with linkintegrity

Hi, after a Migration from 4.3.7 to 5.0.2 i get the following Traceback when i edit an existing Contentobject in the Editorarea. I add a link and when i save my object then comes the error. The same error occurs even when i disable the Linkintegritycheck. When i add new Content then also happen this, when in the editorarea is a link to a internal Object.

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 plone.z3cform.layout, line 66, in call
Module plone.z3cform.layout, line 50, in update
Module plone.dexterity.browser.edit, line 58, in update
Module plone.z3cform.fieldsets.extensible, line 59, in update
Module plone.z3cform.patch, line 30, in GroupForm_update
Module z3c.form.group, line 145, in update
Module plone.app.z3cform.csrf, line 21, in execute
Module z3c.form.action, line 98, in execute
Module z3c.form.button, line 315, in call
Module z3c.form.button, line 170, in call
Module plone.dexterity.browser.edit, line 30, in handleApply
Module z3c.form.group, line 126, in applyChanges
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.linkintegrity.handlers, line 100, in modifiedContent
Module plone.app.linkintegrity.handlers, line 87, in getObjectsFromLinks
Module five.intid.intid, line 41, in getId
Module zope.intid, line 89, in getId
KeyError: <Folder at /ccs/ccs/downloads/flyer>

It looks like the Bug like here Has anybody a solution, workaround, ideas or more information?

Best regards, Jan

I just worked around that in a project yesterday by:

  • First upgrading to 4.3.8-pending as an intermediate step

  • Clearing the reference catalog

  • Clearing and rebuilding portal_catalog

  • Installing plone.app.contenttypes

Here's part of my migration code running in plone4 before upgrading to plone5:

# clear the archetypes reference catalog
log.info("Clearing reference catalog")
portal.reference_catalog.manage_catalogClear()

# clean cruft from catalog
log.info("Rebuilding portal_catalog. This will take a loooong time.")
ctool = api.portal.get_tool('portal_catalog')
ctool.clearFindAndRebuild()

# migrate to plone.app.contenttypes
log.info("Enabling plone.app.contenttypes")
qi_tool.installProducts(['plone.app.contenttypes'])

Oh you're already on 4.3.7 you will likely not need 4.3.8-pending. But running the other steps may solve your problems.

It happens here:

https://github.com/zopefoundation/zope.intid/blob/3.7.2/src/zope/intid/init.py#L89

You see there are two occasions on which a KeyError can be raised. He was able to look up a key for the object, but then did not find the key in the intid tool.

I don't know, why the key is missing, it should not happen.
Either, you managed to find an edge case where linkintegrity gets broken. In that case, you would have had the same problem in 4.3, or some upgrade step did not work correctly. Maybe somebody else knows more.

Do you know, which of these steps was the required one?

No. I based my workaround on @fulv's documented issue:

Ok, after some attempts, i found a solution. normally, i had deinstalled all addons from portal quickinstaller in the zmi before i upgrade the instance. now, i didn't uninstalled the 'plone.app.intid' "addon", and all was fine. Sorry, it was my mistake, this should not be happen. :confused: