[ZCM] [ZC] 206/ 8 Comment "ZCatalogs fail when > 32 elements are passed as part of the searchResults query on PathIndex indexes"

Collector: Zope Bugs and Patches ... zope-coders@zope.org
Mon, 11 Feb 2002 14:16:01 -0500


Issue #206 Update (Comment) "ZCatalogs fail when > 32 elements are passed as part of the searchResults query on PathIndex indexes"
 Status Accepted, Catalog/bug medium
To followup, visit:
  http://collector.zope.org/Zope/206

==============================================================
= Comment - Entry #8 by ajung on Feb 11, 2002 2:15 pm

the request dictionary looks fine and works on my sandbox. 

can you try to "import pdb; pdb.set_trace()" before the
_apply_index() call and then step into the function and see
where is breaks?

 - aj 
________________________________________
= Comment - Entry #7 by chrisdeckard on Feb 11, 2002 2:04 pm


Uploaded:  "foobar"
 - http://collector.zope.org/Zope/206/foobar/view
I'm attaching a file with a printout of the "request" object, and also the keys of self.indexes.

Because I can't get ahold of the person in charge of the data, I've renamed all of my "people" names to xxx.xxx.  They are originally unique and if there is a way I can get them to you without them becoming public, I can probably arrange it.

-Chris


________________________________________
= Comment - Entry #6 by ajung on Feb 11, 2002 11:18 am

I can not reproduce the problem yet.

Please add some debug code before the call
"r=index._apply_index(request)" in Catalog.py in _indexedSearch().
I would like to see how the 'request' variable looks like.

 - aj 
________________________________________
= Comment - Entry #5 by chrisdeckard on Feb 11, 2002 11:00 am

Was requested that I try this:
  dict = { 'path': { 'query': [your long lists ..] } }
  zcatalog.searchResults(dict)

but it gives the same error.

I also took out the other indexes that I search, and got the same error.

-Chris
________________________________________
= Comment - Entry #4 by ajung on Feb 11, 2002 9:01 am

check if the following works:

dict = { 'path': { 'query': [your long lists ..] } }

zcatalog.searchResults(dict)
________________________________________
= Assign - Entry #3 by ajung on Feb 11, 2002 9:00 am

 Status: Pending => Accepted

 Supporters added: ajung


________________________________________
= Comment - Entry #2 by chrisdeckard on Feb 8, 2002 4:53 pm

I posted the wrong version info...  Sorry.  

It's Zope 2.4.3 with python 2.1.1.

Thanks,
-Chris
________________________________________
= Request - Entry #1 by chrisdeckard on Feb 8, 2002 4:52 pm

Cannot query a zcatalog when I have more than 32 elements in the 'path' portion of a query.
Example code followed by traceback:

Index on a zcatalog object has a PathIndex index called "path".

My query looks like this:

query = {}
query['path'] = [list with > 32 elements]

zcatalog.searchResults(query)

I checked, and there are no duplicate elements (though I don't think
that should matter).  My searchResults() works on anything else that
has less than 32 elements in the path list.   I haven't tried it for
the other indexes.

And I get the error message:


Zope Error!

Zope has encountered an error while publishing this resource.

If this error persists, please Send Feedback.

Error Type: TypeError
Error Value: invalid argument

Troubleshooting Suggestions

    * The URL may be incorrect.
    * The parameters passed to this resource may be incorrect.
    * A resource that this resource relies on may be encountering an
error.

For more detailed information about the error, please refer to the HTML
source for this page.

If the error persists please contact the site maintainer. Thank you for
your patience.

Traceback (innermost last):
  File
/data/www/Zope.0/src/Zope-2.4.3-src/lib/python/ZPublisher/Publish.py, line
171, in publish
  File
/data/www/Zope.0/src/Zope-2.4.3-src/lib/python/ZPublisher/mapply.py, line
160, in mapply
    (Object: sumEvents)
  File
/data/www/Zope.0/src/Zope-2.4.3-src/lib/python/ZPublisher/Publish.py, line
112, in call_object
    (Object: sumEvents)
  File
/data/www/Zope.0/src/Zope-2.4.3-src/lib/python/Shared/DC/Scripts/Bindings.py,
line 324, in __call__
    (Object: sumEvents)
  File
/data/www/Zope.0/src/Zope-2.4.3-src/lib/python/Shared/DC/Scripts/Bindings.py,
line 354, in _bindAndExec
    (Object: sumEvents)
  File
/data/www/Zope.0/src/Zope-2.4.3-src/lib/python/Products/PythonScripts/PythonScript.py,
line 363, in _exec
    (Object: sumEvents)
    (Info: ({'script': , 'context': , 'container': , 'traverse_subpath':
[]}, ('papers_and_proposals_reviewed', '1.0', '2001', 'papers_reviewed',
'person_type=[person_federal_unit_or_cru_staff]', None, None, None), {},
(None, None, None, None, None, None, None, None)))
  File Script (Python), line 185, in sumEvents
  File
/data/www/Zope.0/src/Zope-2.4.3-src/lib/python/Products/ZCatalog/ZCatalog.py,
line 653, in searchResults
    (Object: CatalogEvents)
  File
/data/www/Zope.0/src/Zope-2.4.3-src/lib/python/Products/ZCatalog/Catalog.py,
line 650, in searchResults
  File
/data/www/Zope.0/src/Zope-2.4.3-src/lib/python/Products/ZCatalog/Catalog.py,
line 538, in _indexedSearch
  File
/data/www/Zope.0/src/Zope-2.4.3-src/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py,
line 362, in _apply_index
    (Object: path)
TypeError: invalid argument

==============================================================