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

Latest alpha release is not working with Plone 5.2.6 - plone.restapi 7.5.0 #22

Open
avoinea opened this issue Nov 10, 2021 · 16 comments
Open
Assignees

Comments

@avoinea
Copy link
Member

avoinea commented Nov 10, 2021

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/bin/runwsgi", line 8, in <module>
    sys.exit(main())
  File "/app/lib/python3.7/site-packages/Zope2/Startup/serve.py", line 251, in main
    return command.run()
  File "/app/lib/python3.7/site-packages/Zope2/Startup/serve.py", line 190, in run
    global_conf=vars)
  File "/app/lib/python3.7/site-packages/Zope2/Startup/serve.py", line 220, in loadapp
    return loadapp(app_spec, name=name, relative_to=relative_to, **kw)
  File "/app/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 253, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/app/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 278, in loadobj
    return context.create()
  File "/app/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 715, in create
    return self.object_type.invoke(self)
  File "/app/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 209, in invoke
    app = context.app_context.create()
  File "/app/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 715, in create
    return self.object_type.invoke(self)
  File "/app/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 152, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/app/lib/python3.7/site-packages/paste/deploy/util.py", line 55, in fix_call
    val = callable(*args, **kw)
  File "/app/lib/python3.7/site-packages/Zope2/Startup/run.py", line 71, in make_wsgi_app
    starter.prepare()
  File "/app/lib/python3.7/site-packages/Zope2/Startup/starter.py", line 41, in prepare
    self.startZope()
  File "/app/lib/python3.7/site-packages/Zope2/Startup/starter.py", line 99, in startZope
    Zope2.startup_wsgi()
  File "/app/lib/python3.7/site-packages/Zope2/__init__.py", line 50, in startup_wsgi
    _startup()
  File "/app/lib/python3.7/site-packages/Zope2/App/startup.py", line 143, in startup
    load_zcml()
  File "/app/lib/python3.7/site-packages/Zope2/App/startup.py", line 58, in load_zcml
    load_site()
  File "/app/lib/python3.7/site-packages/Zope2/App/zcml.py", line 45, in load_site
    _context = xmlconfig.file(site_zcml)
  File "/app/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 657, in file
    include(context, name, package)
  File "/app/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 557, in include
    processxmlfile(f, context)
  File "/app/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 407, in processxmlfile
    parser.parse(src)
  File "/usr/local/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/local/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/usr/local/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/src/python/Modules/pyexpat.c", line 471, in EndElement
  File "/usr/local/lib/python3.7/xml/sax/expatreader.py", line 381, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/app/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 393, in endElementNS
    self._handle_exception(ex, info)
  File "/app/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 391, in endElementNS
    self.context.end()
  File "/app/lib/python3.7/site-packages/zope/configuration/config.py", line 704, in end
    self.stack.pop().finish()
  File "/app/lib/python3.7/site-packages/zope/configuration/config.py", line 869, in finish
    actions = self.handler(context, **args)
  File "/app/lib/python3.7/site-packages/OFS/metaconfigure.py", line 47, in loadProducts
    xmlconfig.include(_context, zcml, package=product)
  File "/app/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 557, in include
    processxmlfile(f, context)
  File "/app/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 407, in processxmlfile
    parser.parse(src)
  File "/usr/local/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/local/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/usr/local/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/src/python/Modules/pyexpat.c", line 471, in EndElement
  File "/usr/local/lib/python3.7/xml/sax/expatreader.py", line 381, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/app/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 393, in endElementNS
    self._handle_exception(ex, info)
  File "/app/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 391, in endElementNS
    self.context.end()
  File "/app/lib/python3.7/site-packages/zope/configuration/config.py", line 704, in end
    self.stack.pop().finish()
  File "/app/lib/python3.7/site-packages/zope/configuration/config.py", line 869, in finish
    actions = self.handler(context, **args)
  File "/app/lib/python3.7/site-packages/z3c/autoinclude/zcml.py", line 122, in includePluginsDirective
    includeZCMLGroup(_context, info, filename)
  File "/app/lib/python3.7/site-packages/z3c/autoinclude/zcml.py", line 37, in includeZCMLGroup
    include(_context, filename, includable_package)
  File "/app/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 557, in include
    processxmlfile(f, context)
  File "/app/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 407, in processxmlfile
    parser.parse(src)
  File "/usr/local/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/local/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/usr/local/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/src/python/Modules/pyexpat.c", line 471, in EndElement
  File "/usr/local/lib/python3.7/xml/sax/expatreader.py", line 381, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/app/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 393, in endElementNS
    self._handle_exception(ex, info)
  File "/app/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 235, in _handle_exception
    reraise(exc, None, sys.exc_info()[2])
  File "/app/lib/python3.7/site-packages/zope/configuration/_compat.py", line 30, in reraise
    raise value.with_traceback(tb)
  File "/app/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 391, in endElementNS
    self.context.end()
  File "/app/lib/python3.7/site-packages/zope/configuration/config.py", line 704, in end
    self.stack.pop().finish()
  File "/app/lib/python3.7/site-packages/zope/configuration/config.py", line 868, in finish
    args = toargs(context, *self.argdata)
  File "/app/lib/python3.7/site-packages/zope/configuration/config.py", line 1687, in toargs
    args[str(name)] = field.fromUnicode(s)
  File "/app/lib/python3.7/site-packages/zope/configuration/fields.py", line 172, in fromUnicode
    value = self.context.resolve(name)
  File "/app/lib/python3.7/site-packages/zope/configuration/config.py", line 226, in resolve
    __import__(mname)
  File "/app/lib/python3.7/site-packages/plone/volto/summary.py", line 1, in <module>
    from plone.restapi.interfaces import IJSONSummarySerializerMetadata
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/app/lib/python3.7/site-packages/plone/volto/configure.zcml", line 114.2-117.8
    File "/app/etc/site.zcml", line 14.2-14.23
    File "/app/lib/python3.7/site-packages/Products/CMFPlone/configure.zcml", line 110.2-114.8
    ImportError: cannot import name 'IJSONSummarySerializerMetadata' from 'plone.restapi.interfaces' (/app/lib/python3.7/site-packages/plone/restapi/interfaces.py)
@tisto
Copy link
Member

tisto commented Nov 10, 2021

@avoinea how were you able to run buildout with plone.volto latest? Since 3.1.0a5:

https://github.com/plone/plone.volto/blob/main/CHANGES.rst#310a5-2021-11-07

plone.volto requires at least plone.restapi 8.13.0:

https://github.com/plone/plone.volto/blob/main/setup.py#L59

That ships with the IJSONSummarySerializerMetadata serializer:

plone/plone.restapi#1261

So you either have to downgrade to plone.volto 3.0.x or backport the plone.restapi PR.

@avoinea
Copy link
Member Author

avoinea commented Nov 10, 2021

@tisto plone.restapi 7.5.0 is pinned here https://dist.plone.org/release/5.2.6/constraints.txt

Maybe we should also pin plone.volto to 3.1.0a2 ?! @mauritsvanrees

@avoinea
Copy link
Member Author

avoinea commented Nov 10, 2021

Otherwise the plone/plone-backend Docker images 5.2.6 - python 3.7 and 3.8 are broken: https://github.com/plone/plone-backend/actions/runs/1441266348

@ericof
Copy link
Member

ericof commented Nov 10, 2021

It also breaks plone/[email protected] actions.

@avoinea
Copy link
Member Author

avoinea commented Nov 10, 2021

For Docker images I pinned it to 3.1.0a4 https://github.com/plone/plone-backend/actions/runs/1444457283

But I still think it should be explicitly added to https://dist.plone.org/release/5.2.6/constraints.txt as we already have it for 6.0 https://dist.plone.org/release/6.0.0a1/constraints.txt

@ericof
Copy link
Member

ericof commented Nov 10, 2021

Released plone/[email protected] that supports pinning of versions (or installing new eggs)

@mauritsvanrees
Copy link
Member

Is action still needed here?
plone.volto is meant for Plone 6. When you use it in Plone 5.2 you are on your own. Well, with a few people above. :-) It feels strange to me to pin this to some random seeming alpha release, which will never get updated.

@tisto
Copy link
Member

tisto commented Nov 13, 2021

@mauritsvanrees plone.volto is supposed to work with both Plone 5.2 and Plone 6 and we plan to support Plone 5.2 for a while. At least as long as Plone 6 did not see a final release.

@mauritsvanrees
Copy link
Member

Does it really help to pin an older Alpha release of plone.volto in 5.2?
I am not against it, I am simply not sure for who and how this would help.

@tisto
Copy link
Member

tisto commented Nov 14, 2021

Ok, so here is what happens:

plone.volto 3.1.0a5 requires the new JSONSummarySerializerMetadata:

https://github.com/plone/plone.volto/blob/main/CHANGES.rst#310a5-2021-11-07

This serializer has been added to plone.restapi 8.13.0:

https://github.com/plone/plone.restapi/blob/master/CHANGES.rst#8130-2021-11-05

Plone 5 ships with plone.restapi 7, which does not have this serializer. We can not ship with plone.restapi 8 because it dropped Python 2 support.

The easiest way out would be to pin plone.restapi to 8.13.0 and mark this ticket as wontfix.

In theory, there are other options:

a) make Plone 5 use the latest plone.restapi 8 branch in version pins

b) backport that serializer to plone.restapi 7 and upgrade the Plone 5 version pins to use the latest plone.restapi 7 release

Option a) is not possible because plone.restapi 8 dropped Python 2 support. We can not drop Python 2 support for Plone 5.

Option b) means we will have to support four different frontend stacks (in the long run):

a) Plone 4 / plone.restapi 7 / Volto XX? (used by EEA)

b) Plone 5.2 / plone.restapi 7 / Volto 14 (meh)

c) Plone 5.2 / plone.restapi 8 / Volto 14 (used by most Volto core devs)

d) Plone 6 / plone.restapi 8 / Volto 14 (future stack)

The Plone 6 frontend stack is a complex beast (from a release management point of view). The situation is comparable to what we had when we tried to support Dexterity for Plone 3. This was hellish and we have to clearly say what we plan to support and whatnot. As soon as Plone 6 final is out, we just can not do things like this any longer.

IMHO we can only support the latest stack of plone.restapi (8.x), plone.volto (3.x), and Volto (14.x + X) in Plone 5.2 and Plone 6. I do not plan to cut any "Plone 6 only" releases in the near future for this stack, so things will stay for a while. Anything else will require lots of work and cause tons of problems in the future.

I am happy to make sure that a modern Volto stack works on both Plone 5.2 and Plone 6 for quite some time. Though, for anything else, people are on their own (at least as long as nobody steps up who is willing to officially support those use cases, this is open source after all :)).

@mauritsvanrees
Copy link
Member

How about pinning plone.restapi to 8.x in coredev 5.2 on Python 3 only? We can move the current 7.x pin to [versions:python27].
plone.volto requires Python 3 already.

I feels a bit strange to have a core package pinned to two different versions, but it may make sense in this case.

@mauritsvanrees
Copy link
Member

This may need plone/plone.restapi#1194

@tisto
Copy link
Member

tisto commented Nov 15, 2021

@mauritsvanrees right, I did not think about that option. You are the release manager, if you are fine with two different version pins in Plone 5.2 I'd be ok as well. :)

mauritsvanrees added a commit to plone/buildout.coredev that referenced this issue Nov 20, 2021
This means two different branches in sources.cfg.
That will be confusing when testing a PR...

See discussion in plone/plone.volto#22
mauritsvanrees added a commit to plone/buildout.coredev that referenced this issue Nov 20, 2021
This means two different branches in sources.cfg.
That will be confusing when testing a PR...

See discussion in plone/plone.volto#22
@mauritsvanrees
Copy link
Member

if you are fine with two different version pins in Plone 5.2 I'd be ok as well. :)

I have created a PR on coredev to do that: plone/buildout.coredev#754

I realize a problem though: it is not only a different version, but also a different branch in sources. That makes it impractical to test plone.restapi PRs on Jenkins. A PR targeting plone.restapi master would by default also get tested on Python 2, which will immediately fail. We could ignore the failing test, but it feels wrong. :-/

@ale-rt
Copy link
Member

ale-rt commented Nov 20, 2021

Maybe playing with [sources:python27] will work?

@mauritsvanrees
Copy link
Member

I already did that on the coredev PR, and it works for normal use. But mr.roboto/Jenkins won't know that they have to take this into account when testing a plone.restapi PR, so that a PR targeting master would not be run on Py 2.7.

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

6 participants