KSS Inline Validation Error causes infinite recursion

3 messages Options
Embed this post
Permalink
martinl () KSS Inline Validation Error causes infinite recursion
Reply Threaded More More options
Print post
Permalink
While developing a Portet wich makes use of a choice field in its settings I got an infinite recursion error.
As I've noticed the error also occurs in Plone standart portlets, for example Navigation Portlet.

I seems the error does not occur in Plone versions priror to 3.2.1.
I would be glad if someone could tell me if that's a known bug.
I couldn't find it on the bugtrack.

Below you can read how to reproduce the error and my testing results on differnt Plone versions.

Goto "Manage portlets"
Choose "Navigation"

You get the portlets settings page : "Edit Navigation Portlet"

Goto to this section:
"Root node" ("You may search for and choose a folder to act as the root ...")

- Enter the text edit field. (by clicking on it)
- Leave the field. (by clicking somewhere on the page background or on a different field)

Now a formlib KSS inline validation is invoced and it fails each time.
Request: http://192.168.2.232:8080/Plone/++contextportlets++plone.leftcolumn/navigation/kss_formlib_inline_validation?kukitTimeStamp=1246629132755&fieldname=form.root&form.bottomLevel=0&form.currentFolderOnly.used=&form.includeTop.used=&form.name=&form.root.displayed=y&form.root.query=&form.topLevel=1&formname=edit&referer=http%3A%2F%2F192.168.2.232%3A8080%2FPlone%2F%40%40manage-portlets&value=
(gets a 500 - Internal Server Error)


A trace can be found on the console when running in foreground mode or in zinstance\var\log\instance.log
It looks like this:

2009-07-03T15:52:11 ERROR Zope.SiteErrorLog http://192.168.2.232:8080/Plone/++contextportlets++plone.leftcolumn/navigation/kss_formlib_inline_validation/validate_input
Traceback (innermost last):
  Module ZPublisher.Publish, line 119, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module <wrapper>, line 5, in wrapper
  Module kss.core.actionwrapper, line 238, in apply
  Module plone.app.form.kss.validation, line 37, in validate_input
  Module zope.formlib.form, line 257, in setUpWidgets
  Module zope.schema._field, line 239, in bind
  Module plone.app.vocabularies.catalog, line 233, in __call__
  Module plone.app.vocabularies.catalog, line 147, in __init__
  Module Products.CMFCore.utils, line 101, in getToolByName
  Module zope.component._api, line 204, in getUtility
  Module zope.component._api, line 210, in queryUtility
  Module zope.component.registry, line 132, in queryUtility
  Module five.localsitemanager.registry, line 39, in _uncached_lookup
  Module five.localsitemanager.registry, line 129, in _wrap
  Module five.localsitemanager.registry, line 94, in _recurse_to_site
  Module five.localsitemanager.registry, line 94, in _recurse_to_site
[...] this line repeats about  180 times.

RuntimeError: maximum recursion depth exceeded in cmp

---
It looks like an aquisition problem to me.


Testing results on different versions

OK, no Error:
    *  Plone 3.1.7
    * CMF 2.1.1
    * Zope (Zope 2.10.6-final, python 2.4.5, linux2)
    * Python 2.4.5 (#1, Jul 3 2009, 15:31:03) [GCC 4.2.4]
    * PIL 1.1.6


Error occurs:
Plone-3.2.1r4-UnifiedInstaller.tgz
    *  Plone 3.2.1
    * CMF 2.1.2
    * Zope (Zope 2.10.7-final, python 2.4.5, linux2)
    * Python 2.4.5 (#1, Jul 3 2009, 14:52:38) [GCC 4.2.4]
    * PIL 1.1.6

Error occurs:
Plone-3.2.2-UnifiedInstaller.tgz
    *  Plone 3.2.2
    * CMF 2.1.2
    * Zope (Zope 2.10.7-final, python 2.4.5, linux2)
    * Python 2.4.5 (#1, Jul 3 2009, 14:56:39) [GCC 4.2.4]
    * PIL 1.1.6


Error occurs:
Plone-3.2.3-UnifiedInstaller.tgz
    *  Plone 3.2.3
    * CMF 2.1.2
    * Zope (Zope 2.10.7-final, python 2.4.5, linux2)
    * Python 2.4.5 (#1, Jul 3 2009, 15:02:18) [GCC 4.2.4]
    * PIL 1.1.6


Many thanks for any hints,
Martin
MarcWeber () Re: KSS Inline Validation Error causes infinite recursion
Reply Threaded More More options
Print post
Permalink
On Fri, Jul 03, 2009 at 07:54:51AM -0700, Martin Loeschner wrote:
[...]
>   Module five.localsitemanager.registry, line 39, in _uncached_lookup
>   Module five.localsitemanager.registry, line 129, in _wrap
>   Module five.localsitemanager.registry, line 94, in _recurse_to_site
>   Module five.localsitemanager.registry, line 94, in _recurse_to_site
> [...] this line repeats about  180 times.

I don't know plone enough to reproduce your problem.
Maybe you still want to have a look at how I'd try to track down the
cause of this error?

def _recurse_to_site(current, wanted):
    if not Acquisition.aq_base(current) == wanted:
        current = _recurse_to_site(get_parent(current), wanted) # <<<<<<< this is line 94
    return current

While iterating I'd try tracing current to see wether it keeps changing
or stops at some fixed value (thus never satisying aq_base(current) == wanted)

Even if this doesn't help you should be able to get some more
information by comparing the log from both: the broken current version
and the working older release.

So I'd add some debugging code rewriting the function above to:

  from zLOG import LOG, INFO

  def _recurse_to_site(current, wanted):
      aq_base = Acquisition.aq_base(current)
      if not aq_base == wanted:
          parent = get_parent(current)
          LOG('MyProduct', INFO,\
              "\ncurrent: %s\n aq_base of current: %s\n should be equal to watned : %s" % \
              (current, aq_base, wanted) )
          current = _recurse_to_site(parent, wanted)
      return current

If you want me to put further effort into debugging this come to my
office and help me setting up your test case.

Hopefully someone else who has more knowledge in this area than me can
give you a more valuable reply.

Yours,
Marc Weber

------------------------------------------------------------------------------
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
martinl () Re: KSS Inline Validation Error causes infinite recursion
Reply Threaded More More options
Print post
Permalink
hi Marc,
thx for your advise. I feel sorry to tell you that this didn't give me any new perspective nor any hint for solution.
For now I'll be waiting for other Plone users who are able to reproduce this error.
I if it's a real bug instead of a local configuration problem then it should be very easy to reproduce (also for non specialists) - finally, the debugging step does require a deeper knowlegde of Plone and Zope.
I hope any expert would take a look.