collective / collective.lineage

Turns subfolders of a Plone site to appear as autonomous Plone sites
https://pypi.org/project/collective.lineage
12 stars 9 forks source link

Doesn't work with DX-Site-Root (Plone 6) #62

Closed petschki closed 11 months ago

petschki commented 3 years ago

instance gets killed with stack overflow

traceback:

Fatal Python error: Cannot recover from stack overflow.

Current thread 0x000070000eac7000 (most recent call first):
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.interface-5.4.0-py3.7-macosx-10.15-x86_64.egg/zope/interface/adapter.py", line 975 in _lookup
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 58 in _uncached_lookup
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.interface-5.4.0-py3.7-macosx-10.15-x86_64.egg/zope/interface/registry.py", line 287 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.component-4.6.2-py3.7.egg/zope/component/_api.py", line 169 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 75 in lookup_fti
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 100 in decorator
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/content.py", line 163 in __get__
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/utils.py", line 15 in get_parent
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 114 in _recurse_to_site
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 159 in _wrap
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 60 in _uncached_lookup
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.interface-5.4.0-py3.7-macosx-10.15-x86_64.egg/zope/interface/registry.py", line 287 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.component-4.6.2-py3.7.egg/zope/component/_api.py", line 169 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 75 in lookup_fti
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 100 in decorator
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/content.py", line 163 in __get__
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/utils.py", line 15 in get_parent
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 114 in _recurse_to_site
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 159 in _wrap
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 60 in _uncached_lookup
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.interface-5.4.0-py3.7-macosx-10.15-x86_64.egg/zope/interface/registry.py", line 287 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.component-4.6.2-py3.7.egg/zope/component/_api.py", line 169 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 75 in lookup_fti
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 100 in decorator
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/content.py", line 163 in __get__
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/utils.py", line 15 in get_parent
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 114 in _recurse_to_site
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 159 in _wrap
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 60 in _uncached_lookup
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.interface-5.4.0-py3.7-macosx-10.15-x86_64.egg/zope/interface/registry.py", line 287 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.component-4.6.2-py3.7.egg/zope/component/_api.py", line 169 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 75 in lookup_fti
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 100 in decorator
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/content.py", line 163 in __get__
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/utils.py", line 15 in get_parent
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 114 in _recurse_to_site
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 159 in _wrap
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 60 in _uncached_lookup
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.interface-5.4.0-py3.7-macosx-10.15-x86_64.egg/zope/interface/registry.py", line 287 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.component-4.6.2-py3.7.egg/zope/component/_api.py", line 169 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 75 in lookup_fti
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 100 in decorator
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/content.py", line 163 in __get__
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/utils.py", line 15 in get_parent
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 114 in _recurse_to_site
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 159 in _wrap
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 60 in _uncached_lookup
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.interface-5.4.0-py3.7-macosx-10.15-x86_64.egg/zope/interface/registry.py", line 287 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.component-4.6.2-py3.7.egg/zope/component/_api.py", line 169 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 75 in lookup_fti
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 100 in decorator
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/content.py", line 163 in __get__
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/utils.py", line 15 in get_parent
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 114 in _recurse_to_site
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 159 in _wrap
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 60 in _uncached_lookup
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.interface-5.4.0-py3.7-macosx-10.15-x86_64.egg/zope/interface/registry.py", line 287 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.component-4.6.2-py3.7.egg/zope/component/_api.py", line 169 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 75 in lookup_fti
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 100 in decorator
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/content.py", line 163 in __get__
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/utils.py", line 15 in get_parent
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 114 in _recurse_to_site
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 159 in _wrap
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 60 in _uncached_lookup
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.interface-5.4.0-py3.7-macosx-10.15-x86_64.egg/zope/interface/registry.py", line 287 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.component-4.6.2-py3.7.egg/zope/component/_api.py", line 169 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 75 in lookup_fti
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 100 in decorator
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/content.py", line 163 in __get__
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/utils.py", line 15 in get_parent
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 114 in _recurse_to_site
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 159 in _wrap
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 60 in _uncached_lookup
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.interface-5.4.0-py3.7-macosx-10.15-x86_64.egg/zope/interface/registry.py", line 287 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.component-4.6.2-py3.7.egg/zope/component/_api.py", line 169 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 75 in lookup_fti
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 100 in decorator
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/content.py", line 163 in __get__
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/utils.py", line 15 in get_parent
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 114 in _recurse_to_site
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 159 in _wrap
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 60 in _uncached_lookup
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.interface-5.4.0-py3.7-macosx-10.15-x86_64.egg/zope/interface/registry.py", line 287 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.component-4.6.2-py3.7.egg/zope/component/_api.py", line 169 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 75 in lookup_fti
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 100 in decorator
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/content.py", line 163 in __get__
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/utils.py", line 15 in get_parent
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 114 in _recurse_to_site
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 159 in _wrap
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 60 in _uncached_lookup
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.interface-5.4.0-py3.7-macosx-10.15-x86_64.egg/zope/interface/registry.py", line 287 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/zope.component-4.6.2-py3.7.egg/zope/component/_api.py", line 169 in queryUtility
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 75 in lookup_fti
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/schema.py", line 100 in decorator
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.dexterity-2.10.3-py3.7.egg/plone/dexterity/content.py", line 163 in __get__
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/utils.py", line 15 in get_parent
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 114 in _recurse_to_site
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/five.localsitemanager-3.2.2-py3.7.egg/five/localsitemanager/registry.py", line 159 in _wrap
  ...

Thread 0x000070000e5c4000 (most recent call first):
  File "/Users/peterm/.pyenv/versions/3.7.9/lib/python3.7/threading.py", line 296 in wait
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/waitress-2.0.0-py3.7.egg/waitress/task.py", line 72 in handler_thread
  File "/Users/peterm/.pyenv/versions/3.7.9/lib/python3.7/threading.py", line 870 in run
  File "/Users/peterm/.pyenv/versions/3.7.9/lib/python3.7/threading.py", line 926 in _bootstrap_inner
  File "/Users/peterm/.pyenv/versions/3.7.9/lib/python3.7/threading.py", line 890 in _bootstrap

Thread 0x000070000e0c1000 (most recent call first):
  File "/Users/peterm/.pyenv/versions/3.7.9/lib/python3.7/threading.py", line 296 in wait
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/waitress-2.0.0-py3.7.egg/waitress/task.py", line 72 in handler_thread
  File "/Users/peterm/.pyenv/versions/3.7.9/lib/python3.7/threading.py", line 870 in run
  File "/Users/peterm/.pyenv/versions/3.7.9/lib/python3.7/threading.py", line 926 in _bootstrap_inner
  File "/Users/peterm/.pyenv/versions/3.7.9/lib/python3.7/threading.py", line 890 in _bootstrap

Thread 0x000070000dbbe000 (most recent call first):
  File "/Users/peterm/.pyenv/versions/3.7.9/lib/python3.7/threading.py", line 296 in wait
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/waitress-2.0.0-py3.7.egg/waitress/task.py", line 72 in handler_thread
  File "/Users/peterm/.pyenv/versions/3.7.9/lib/python3.7/threading.py", line 870 in run
  File "/Users/peterm/.pyenv/versions/3.7.9/lib/python3.7/threading.py", line 926 in _bootstrap_inner
  File "/Users/peterm/.pyenv/versions/3.7.9/lib/python3.7/threading.py", line 890 in _bootstrap

Thread 0x000000010d199e00 (most recent call first):
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/waitress-2.0.0-py3.7.egg/waitress/wasyncore.py", line 172 in poll
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/waitress-2.0.0-py3.7.egg/waitress/wasyncore.py", line 245 in loop
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/waitress-2.0.0-py3.7.egg/waitress/server.py", line 325 in run
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/waitress-2.0.0-py3.7.egg/waitress/__init__.py", line 19 in serve
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.recipe.zope2instance-6.10.1-py3.7.egg/plone/recipe/zope2instance/ctl.py", line 920 in serve_paste
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/plone.recipe.zope2instance-6.10.1-py3.7.egg/plone/recipe/zope2instance/ctl.py", line 945 in serve
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/Zope-5.3-py3.7.egg/Zope2/Startup/serve.py", line 203 in serve
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/Zope-5.3-py3.7.egg/Zope2/Startup/serve.py", line 217 in run
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/Zope-5.3-py3.7.egg/Zope2/Startup/serve.py", line 251 in main
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/eggs/Zope-5.3-py3.7.egg/Zope2/Startup/serve.py", line 255 in <module>
  File "/Volumes/WORKSPACE2/kinderdorf_plone5/parts/instance/bin/interpreter", line 333 in <module>
petschki commented 3 years ago

see https://github.com/collective/collective.lineage/issues/57

petschki commented 3 years ago

since there are two unmerged attempts to fix the stack overflow from @ale-rt (https://github.com/plone/plone.dexterity/pull/107, https://github.com/plone/plone.dexterity/pull/108) and various bits from @jensens (https://github.com/plone/plone.dexterity/pull/119) could you guys give me a hint how to fix this again with DX-Site-Root in Plone 6?

btw. the test_browser test written by @rpatterson is failing again now in plone6 ...

jensens commented 3 years ago

Since it starts in ...plone/dexterity/content.py", line 163 in __get__ accessing the schema cache and this first run into the volatile decorator I would suspect the problem occurs in here. I do not now why this is not reflected in the traceback? But at least I would put the debugger there and step into/through here and watch whats happens: https://github.com/plone/plone.dexterity/blob/master/plone/dexterity/schema.py#L88

ale-rt commented 3 years ago

I think my PRs are now obsoleted by the refactoring made by Jens. Anyway IIRC the problem was getting the FTI has an utility. See https://github.com/plone/plone.dexterity/blob/master/plone/dexterity/schema.py#L74.

petschki commented 3 years ago

interesting ... in Python 3.8 I do get a traceback ... py3.7 -> stack overflow:

...
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 60, in _uncached_lookup
    result = _wrap(result, registry)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 159, in _wrap
    parent = _recurse_to_site(current_site, registry_site)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 114, in _recurse_to_site
    current = _recurse_to_site(get_parent(current), wanted)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/utils.py", line 15, in get_parent
    if IRoot.providedBy(obj):
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/content.py", line 163, in __get__
    SCHEMA_CACHE.modified(portal_type),
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/schema.py", line 100, in decorator
    fti = lookup_fti(portal_type, cache=self.cache_enabled)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/schema.py", line 74, in lookup_fti
    fti_cache[portal_type] = fti = queryUtility(
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/zope.component-4.6.2-py3.8.egg/zope/component/_api.py", line 169, in queryUtility
    return getSiteManager(context).queryUtility(interface, name, default)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/zope.interface-5.4.0-py3.8.egg/zope/interface/registry.py", line 287, in queryUtility
    return self.utilities.lookup((), provided, name, default)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 60, in _uncached_lookup
    result = _wrap(result, registry)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 159, in _wrap
    parent = _recurse_to_site(current_site, registry_site)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 114, in _recurse_to_site
    current = _recurse_to_site(get_parent(current), wanted)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/utils.py", line 15, in get_parent
    if IRoot.providedBy(obj):
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/content.py", line 163, in __get__
    SCHEMA_CACHE.modified(portal_type),
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/schema.py", line 100, in decorator
    fti = lookup_fti(portal_type, cache=self.cache_enabled)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/schema.py", line 74, in lookup_fti
    fti_cache[portal_type] = fti = queryUtility(
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/zope.component-4.6.2-py3.8.egg/zope/component/_api.py", line 169, in queryUtility
    return getSiteManager(context).queryUtility(interface, name, default)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/zope.interface-5.4.0-py3.8.egg/zope/interface/registry.py", line 287, in queryUtility
    return self.utilities.lookup((), provided, name, default)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 60, in _uncached_lookup
    result = _wrap(result, registry)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 159, in _wrap
    parent = _recurse_to_site(current_site, registry_site)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 114, in _recurse_to_site
    current = _recurse_to_site(get_parent(current), wanted)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/utils.py", line 15, in get_parent
    if IRoot.providedBy(obj):
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/content.py", line 163, in __get__
    SCHEMA_CACHE.modified(portal_type),
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/schema.py", line 100, in decorator
    fti = lookup_fti(portal_type, cache=self.cache_enabled)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/schema.py", line 74, in lookup_fti
    fti_cache[portal_type] = fti = queryUtility(
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/zope.component-4.6.2-py3.8.egg/zope/component/_api.py", line 169, in queryUtility
    return getSiteManager(context).queryUtility(interface, name, default)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/zope.interface-5.4.0-py3.8.egg/zope/interface/registry.py", line 287, in queryUtility
    return self.utilities.lookup((), provided, name, default)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 60, in _uncached_lookup
    result = _wrap(result, registry)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 159, in _wrap
    parent = _recurse_to_site(current_site, registry_site)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 114, in _recurse_to_site
    current = _recurse_to_site(get_parent(current), wanted)
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/utils.py", line 15, in get_parent
    if IRoot.providedBy(obj):
  File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/content.py", line 134, in __get__
    spec = getattr(inst, "__provides__", None)
RecursionError: maximum recursion depth exceeded while calling a Python object
jensens commented 3 years ago

I think my PRs are now obsoleted by the refactoring made by Jens. Anyway IIRC the problem was getting the FTI has an utility. See https://github.com/plone/plone.dexterity/blob/master/plone/dexterity/schema.py#L74.

At this line queryUtility possibly interferes with the attribute-getter of DX in some way (while looking up the site-manager and its local registries in order to use ZCA). Maybe its worth to try to check if this is the case.

like this return getSiteManager(context).queryUtility(interface, name, default)

petschki commented 3 years ago

@ale-rt inspired by your attempt here https://github.com/plone/plone.dexterity/pull/108 I was able to fix this issue with this https://github.com/plone/plone.dexterity/pull/155 though I think it needs to be clarified, why the IDexterityFTI lookup for Plone Site doesn't work on the first requests ...