Skip to content

Update Plone 6.1 to Zope 5.14.1.#1076

Open
mauritsvanrees wants to merge 5 commits into6.1from
maurits-zope-5141-61
Open

Update Plone 6.1 to Zope 5.14.1.#1076
mauritsvanrees wants to merge 5 commits into6.1from
maurits-zope-5141-61

Conversation

@mauritsvanrees
Copy link
Member

Note that all zope.* packages that are pinned by Zope now use native namespaces. So we had to do the same for the few zope.* pins that we have ourselves.

Note though that in our versions-extra.cfg we have zope.mkzeoinstance = 6.0 which still uses the old-style pkg_resources namespace. But the repo is archived, and the package is only used by plone.recipe.zeoserver. So should be okay.

Actually, no it is NOT okay. If I add a zeoserver part in buildout.coredev I get an error when running buildout:

Installing zeoserver.
While:
  Installing zeoserver.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/Users/maurits/community/plone-coredev/6.1/lib/python3.13/site-packages/zc/buildout/buildout.py", line 2330, in main
    getattr(buildout, command)(args)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/Users/maurits/community/plone-coredev/6.1/lib/python3.13/site-packages/zc/buildout/buildout.py", line 869, in install
    installed_files = self[part]._call(recipe.install)
  File "/Users/maurits/community/plone-coredev/6.1/lib/python3.13/site-packages/zc/buildout/buildout.py", line 1689, in _call
    return f()
  File "/Users/maurits/shared-eggs/cp313/plone.recipe.zeoserver-3.0.5-py3.13.egg/plone/recipe/zeoserver/recipe.py", line 86, in install
    from zope.mkzeoinstance import ZEOInstanceBuilder
  File "/Users/maurits/shared-eggs/cp313/zope.mkzeoinstance-6.0-py3.13.egg/zope/mkzeoinstance/__init__.py", line 46, in <module>
    import ZODB
  File "/Users/maurits/shared-eggs/cp313/ZODB-6.2-py3.13.egg/ZODB/__init__.py", line 17, in <module>
    from persistent import TimeStamp
  File "/Users/maurits/shared-eggs/cp313/persistent-6.5-py3.13-macosx-15.4-arm64.egg/persistent/__init__.py", line 34, in <module>
    from persistent import interfaces as _interfaces
  File "/Users/maurits/shared-eggs/cp313/persistent-6.5-py3.13-macosx-15.4-arm64.egg/persistent/interfaces.py", line 17, in <module>
    from zope.interface import Attribute
ModuleNotFoundError: No module named 'zope.interface'

So at the moment we cannot use this new Zope version. So I open this as a draft PR.

Possible solutions I see:

  1. Ask to unarchive the zope.mkzeoinstance repo and switch it to using native namespaces.
  2. Copy the relevant part of zope.mkzeoinstance to plone.recipe.zeoserver. This should be done on branches for both 6.1 and 6.2.

Why did I not notice this on Plone 6.2? Ah, because there we are using zc.buildout 5, which basically installs every package as if it had native namespaces.

@mauritsvanrees
Copy link
Member Author

I have made a PR to copy the zope.mkzeoinstance code into plone.recipe.zeoserver:
plone/plone.recipe.zeoserver#91

Once approved and merged, the same can be done for the 3.x branch that we use on Plone 6.0 and 6.1. That would fix the problem here.

@mauritsvanrees
Copy link
Member Author

@jenkins-plone-org please run jobs

@mauritsvanrees
Copy link
Member Author

Still other problems with zeoserver, now with ModuleNotFound error for zc.locking. Has to do with namespaces and how the zc packages are installed: with zc.buildout or with pip. I will come with details later.

@davisagli
Copy link
Member

Why are we trying to use a Zope version that requires switching to native namespaces with a version of Plone that does not support it? I thought making the switch at one time was the point of the 6.2 release.

@mauritsvanrees
Copy link
Member Author

@davisagli During the lifetime of 6.1 we have already switched to native namespaces for the z3c and five namespaces. With Zope 5.14 we would do the same for the zope namespace. The Products and zc namespaces would remain using pkg_resources. And plone and collective too of course.

The danger if we don't upgrade to Zope 5.14, is that a security fix may come out in for example Zope 5.14.2, and Plone would either need to suddenly make the upgrade then, or remain vulnerable (or have some hotfix package again) Or hope that the Zope 5.14.2 package works correctly with the package versions that are pinned by 5.13.

Then again: the same is already true for Plone 6.0: this uses Zope 5.13. We are not going to upgrade it, as it is out of maintenance support. But it still has security support, so we would need a backport of a theoretical security fix for 6.0.

I need to write down the problem that I see. But the tests in this PR are green, so mostly it is fine.

@mauritsvanrees
Copy link
Member Author

I have written the problem down at length in a Zope issue:

zopefoundation/Zope#1288

@mauritsvanrees
Copy link
Member Author

mauritsvanrees commented Mar 5, 2026

Translated to Plone, the problem can be seen when using the branch of this PR.

Create a local.cfg with an extra part for the zeoserver, and let's add a zeoclient for good measure:

[buildout]
parts +=
    zeoserver
    zeoclient

[zeoserver]
recipe = plone.recipe.zeoserver
zeo-address = 127.0.0.1:8100

[zeoclient]
<= instance
zeo-address = ${zeoserver:zeo-address}
zeo-client = true
shared-blob = on

Run buildout. Using the latest plone.recipe.zeoserver 3.1.0 which no longer depends on zope.mkzeoinstance this now actually finishes. But then you can't use some scripts:

$ bin/zeoserver  fg
/Users/maurits/shared-eggs/cp310/plone.recipe.zeoserver-3.1.0-py3.10.egg/plone/__init__.py:1: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  __import__('pkg_resources').declare_namespace(__name__)
/Users/maurits/community/plone-coredev/6.1/parts/zeoserver/bin/runzeo
Traceback (most recent call last):
  File "/Users/maurits/.pyenv/versions/3.10.19/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/maurits/.pyenv/versions/3.10.19/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/maurits/shared-eggs/cp310/ZEO-6.0.0-py3.10.egg/ZEO/runzeo.py", line 416, in <module>
    main()
  File "/Users/maurits/shared-eggs/cp310/ZEO-6.0.0-py3.10.egg/ZEO/runzeo.py", line 405, in main
    s.main()
  File "/Users/maurits/shared-eggs/cp310/ZEO-6.0.0-py3.10.egg/ZEO/runzeo.py", line 158, in main
    self.open_storages()
  File "/Users/maurits/shared-eggs/cp310/ZEO-6.0.0-py3.10.egg/ZEO/runzeo.py", line 212, in open_storages
    self.storages[opener.name] = opener.open()
  File "/Users/maurits/shared-eggs/cp310/ZODB-6.2-py3.10.egg/ZODB/config.py", line 199, in open
    from ZODB.FileStorage import FileStorage
  File "/Users/maurits/shared-eggs/cp310/ZODB-6.2-py3.10.egg/ZODB/FileStorage/__init__.py", line 3, in <module>
    from ZODB.FileStorage.FileStorage import FileIterator
  File "/Users/maurits/shared-eggs/cp310/ZODB-6.2-py3.10.egg/ZODB/FileStorage/FileStorage.py", line 29, in <module>
    from zc.lockfile import LockFile
ModuleNotFoundError: No module named 'zc.lockfile'

And repozo:

$ bin/repozo 
Traceback (most recent call last):
  File "/Users/maurits/community/plone-coredev/6.1/bin/repozo", line 25, in <module>
    import ZODB.scripts.repozo
  File "/Users/maurits/shared-eggs/cp310/ZODB-6.2-py3.10.egg/ZODB/scripts/repozo.py", line 98, in <module>
    from ZODB.FileStorage import FileStorage
  File "/Users/maurits/shared-eggs/cp310/ZODB-6.2-py3.10.egg/ZODB/FileStorage/__init__.py", line 3, in <module>
    from ZODB.FileStorage.FileStorage import FileIterator
  File "/Users/maurits/shared-eggs/cp310/ZODB-6.2-py3.10.egg/ZODB/FileStorage/FileStorage.py", line 29, in <module>
    from zc.lockfile import LockFile
ModuleNotFoundError: No module named 'zc.lockfile'

The same local.cfg on the current coredev 6.1 branch with Zope 5.13 creates working bin/zeoserver and bin/repozo scripts. But theoretically this has the same problem, except that you usually don't see it:

$ bin/zopepy
>>> import zc.lockfile
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ModuleNotFoundError: No module named 'zc.lockfile'
>>> import pkg_resources
<console>:1: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
>>> import zc.lockfile

Note that all `zope.*` packages that are pinned by Zope now use native namespaces.
So we had to do the same for the few `zope.*` pins that we have ourselves.

Note though that in our `versions-extra.cfg` we have `zope.mkzeoinstance = 6.0` which still uses the old-style `pkg_resources` namespace.
But the repo is archived, and the package is only used by `plone.recipe.zeoserver`.  So should be okay.

Actually, no it is NOT okay.  If I add a zeoserver part in `buildout.coredev` I get an error when running buildout:

```
Installing zeoserver.
While:
  Installing zeoserver.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/Users/maurits/community/plone-coredev/6.1/lib/python3.13/site-packages/zc/buildout/buildout.py", line 2330, in main
    getattr(buildout, command)(args)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/Users/maurits/community/plone-coredev/6.1/lib/python3.13/site-packages/zc/buildout/buildout.py", line 869, in install
    installed_files = self[part]._call(recipe.install)
  File "/Users/maurits/community/plone-coredev/6.1/lib/python3.13/site-packages/zc/buildout/buildout.py", line 1689, in _call
    return f()
  File "/Users/maurits/shared-eggs/cp313/plone.recipe.zeoserver-3.0.5-py3.13.egg/plone/recipe/zeoserver/recipe.py", line 86, in install
    from zope.mkzeoinstance import ZEOInstanceBuilder
  File "/Users/maurits/shared-eggs/cp313/zope.mkzeoinstance-6.0-py3.13.egg/zope/mkzeoinstance/__init__.py", line 46, in <module>
    import ZODB
  File "/Users/maurits/shared-eggs/cp313/ZODB-6.2-py3.13.egg/ZODB/__init__.py", line 17, in <module>
    from persistent import TimeStamp
  File "/Users/maurits/shared-eggs/cp313/persistent-6.5-py3.13-macosx-15.4-arm64.egg/persistent/__init__.py", line 34, in <module>
    from persistent import interfaces as _interfaces
  File "/Users/maurits/shared-eggs/cp313/persistent-6.5-py3.13-macosx-15.4-arm64.egg/persistent/interfaces.py", line 17, in <module>
    from zope.interface import Attribute
ModuleNotFoundError: No module named 'zope.interface'
```

So at the moment we cannot use this new Zope version.
Possible solutions I see:

1. Ask to unarchive the `zope.mkzeoinstance` repo and switch it to using native namespaces.
2. Copy the relevant part of `zope.mkzeoinstance` to `plone.recipe.zeoserver`.  This should be done on branches for both 6.1 and 6.2.

Why did I not notice this on Plone 6.2?  Ah, because there we are using `zc.buildout` 5, which basically installs every package as if it had native namespaces.
Plus latest compatible packaging, pip, setuptools.
@mauritsvanrees
Copy link
Member Author

I updated the PR to Zope 5.14.2, and zc.buildout 4.2.0. With that, the ModuleNotFoundErrors that I saw, are gone. For me this can be merged when green.

@jenkins-plone-org please run jobs

@mauritsvanrees mauritsvanrees marked this pull request as ready for review March 9, 2026 09:27
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

Successfully merging this pull request may close these issues.

2 participants