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

Error removing resource registry tools in upgrade #197

Closed
mauritsvanrees opened this issue Feb 12, 2019 · 1 comment
Closed

Error removing resource registry tools in upgrade #197

mauritsvanrees opened this issue Feb 12, 2019 · 1 comment

Comments

@mauritsvanrees
Copy link
Member

I tried an upgrade from Plone 5.0.10 to latest 5.2 coredev. The upgrade broke:

Traceback (most recent call last):
  File "/Users/maurits/community/plone-coredev/5.2/src/Products.CMFPlone/Products/CMFPlone/MigrationTool.py", line 291, in upgrade
    step['step'].doStep(setup)
  File "/Users/maurits/shared-eggs/cp27m/Products.GenericSetup-2.0b5-py2.7.egg/Products/GenericSetup/upgrade.py", line 168, in doStep
    self.handler(tool)
  File "/Users/maurits/community/plone-coredev/5.2/src/plone.app.upgrade/plone/app/upgrade/v52/betas.py", line 102, in to52beta1
    remove_legacy_resource_registries(context)
  File "/Users/maurits/community/plone-coredev/5.2/src/plone.app.upgrade/plone/app/upgrade/v52/betas.py", line 48, in remove_legacy_resource_registries
    portal.manage_delObjects(tools)
  File "/Users/maurits/community/plone-coredev/5.2/src/Products.CMFPlone/Products/CMFPlone/Portal.py", line 126, in manage_delObjects
    "Do not have permissions to remove this object")
Unauthorized: Do not have permissions to remove this object

Any idea?
cc @ksuess

@mauritsvanrees
Copy link
Member Author

Ah, I see. The code calls portal.manage_delObjects and this does a permission check. For some reason we don't have permission to delete the objects. This may depend on how we get the portal object, and maybe we lose the REQUEST object or something. I don't know.
But we should simply call portal._delObject instead and our problems will be gone.

I created PR #198 with a fix.

mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue Feb 19, 2019
Branch: refs/heads/master
Date: 2019-02-12T20:45:42+01:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.upgrade@94e8413

Fixed permission error while removing old resource registries.

Fixes plone/plone.app.upgrade#197

Files changed:
A news/197.bugfix
M plone/app/upgrade/v52/betas.py
Repository: plone.app.upgrade

Branch: refs/heads/master
Date: 2019-02-19T11:57:28+01:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: plone/plone.app.upgrade@2659b44

Merge pull request #198 from plone/maurits-fix-remove_legacy_resource_registries

Fixed permission error while removing old resource registries.

Files changed:
A news/197.bugfix
M plone/app/upgrade/v52/betas.py
mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue Feb 19, 2019
Branch: refs/heads/master
Date: 2019-02-12T20:45:42+01:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.upgrade@94e8413

Fixed permission error while removing old resource registries.

Fixes plone/plone.app.upgrade#197

Files changed:
A news/197.bugfix
M plone/app/upgrade/v52/betas.py
Repository: plone.app.upgrade

Branch: refs/heads/master
Date: 2019-02-19T11:57:28+01:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: plone/plone.app.upgrade@2659b44

Merge pull request #198 from plone/maurits-fix-remove_legacy_resource_registries

Fixed permission error while removing old resource registries.

Files changed:
A news/197.bugfix
M plone/app/upgrade/v52/betas.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant