Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Something odd with the bundle registration? AttributeError: 'dict' object has no attribute '__identifier__' #84

Open
agitator opened this issue Sep 26, 2020 · 3 comments

Comments

@agitator
Copy link
Member

agitator commented Sep 26, 2020

I already came accross this problem on Plone 5.2 and didn't use it in production then.
Now testing out the deployment on Plone 6 and get this error again when I run the migration steps for plone.staticresources.

lazysizes isn't even installed, just added to the setup.py of my integration package....
Any idea what could be the issue?

2020-09-26 16:53:38,061 INFO    [Products.GenericSetup.tool:1392][waitress-3] Importing profile profile-plone.staticresources.upgrades:10 with dependency strategy ignore.
2020-09-26 16:53:38,062 INFO    [Products.GenericSetup.tool:1431][waitress-3] Applying main profile profile-plone.staticresources.upgrades:10
2020-09-26 16:53:40,190 ERROR   [Zope.SiteErrorLog:18][waitress-3] 1601132020.1896840.21956013297271104 http://localhost:13200/Plone/portal_setup/manage_doUpgrades
Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 167, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 364, in publish_module
  Module ZPublisher.WSGIPublisher, line 267, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module Products.PDBDebugMode.wsgi_runcall, line 60, in pdb_runcall
  Module Products.GenericSetup.tool, line 1096, in manage_doUpgrades
  Module Products.GenericSetup.upgrade, line 203, in doStep
  Module Products.GenericSetup.tool, line 399, in runAllImportStepsFromProfile
   - __traceback_info__: profile-plone.staticresources.upgrades:10
  Module Products.GenericSetup.tool, line 1473, in _runImportStepsFromContext
  Module Products.GenericSetup.tool, line 1285, in _doRunImportStep
   - __traceback_info__: plone.app.registry
  Module plone.app.registry.exportimport.handler, line 79, in importRegistry
   - __traceback_info__: registry.xml
  Module plone.app.registry.exportimport.handler, line 127, in importDocument
  Module plone.app.registry.exportimport.handler, line 408, in importRecords
   - __traceback_info__: records name: Products.CMFPlone.interfaces.IBundleRegistry
AttributeError: 'dict' object has no attribute '__identifier__'

@hvelarde
Copy link
Member

very weird; you'll have to dig deeper: collective.lazysizes don't register its resources in Plone.

@petschki
Copy link
Member

petschki commented Sep 4, 2024

I've digged into this. Turns out, that the v10 upgrade step isn't compatible with Plone 6. See https://community.plone.org/t/solved-error-while-installing-collective-z3cform-datagridfield/19801/11

I'll prepare a PR

@petschki
Copy link
Member

petschki commented Sep 4, 2024

A bit more info:

https://github.com/collective/collective.lazysizes/blob/master/src/collective/lazysizes/upgrades/v10/__init__.py#L7

This overrides the zope.deferredimport marked interface and breaks all Products.CMFPlone.interfaces.IBundleRegistry imports.

If you change those imports to plone.base.interfaces.resources.IBundleRegistry it fixes the error above also, but there are several other places which still import from the old module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants