Description
I just did a title search with the xapian search enabled and receive an IndexError list index out of range. If i doing the same search on another wiki instance (also with the same xapian search and wiki version (farmwiki) ) the error not occur! Rebuilding manual the Index helps!
Interesting is only that the SystemInfo shows up that everything with the xapian (and also the index) is ok. I also received this error not the first time! it's comming and going.. every few weeks, i guess!
Steps to reproduce
- not possible due the rebuild of the index
Example
Component selection
- xapian, index
Details
--> -->
IndexError
list index out of range
If you want to report a bug, please save this page and attach it to your bug report.
Traceback
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/home2/lotek/lib/python2.5/site-packages/MoinMoin/request/__init__.py in run (self=<MoinMoin.request.request_standalone.Request object at 0xb139508c>)
- 1281 self.page.send_page(msg=msg)
- 1282 else:
- 1283 handler(self.page.page_name, self)
- 1284
- 1285 # every action that didn't use to raise MoinMoinNoFooter must call this now:
- handler = <function execute at 0xb1405c6c>
- self = <MoinMoin.request.request_standalone.Request object at 0xb139508c>
- self.page = <MoinMoin.Page.Page object at 0xb0490c8c>
- self.page.page_name = u'Index'
/home/lotek/lib/python2.5/site-packages/MoinMoin/action/fullsearch.py in execute (pagename=u'Index', request=<MoinMoin.request.request_standalone.Request object at 0xb139508c>, fieldname='value', titlesearch=1, statistic=0)
- 185 query = QueryParser(case=case, regex=regex,
- 186 titlesearch=titlesearch).parse_query(needle)
- 187 results = searchPages(request, query, sort, mtime, historysearch)
- 188 except ValueError: # catch errors in the search query
- 189 err = _('Your search query {{{"%s"}}} is invalid. Please refer to '
- results undefined
- searchPages = <function searchPages at 0xb1405df4>
- request = <MoinMoin.request.request_standalone.Request object at 0xb139508c>
- query = <MoinMoin.search.queryparser.TitleSearch instance at 0xb0eeb6cc>
- sort = 'page_name'
- mtime = None
- historysearch = 0
/home/lotek/lib/python2.5/site-packages/MoinMoin/search/__init__.py in searchPages (request=<MoinMoin.request.request_standalone.Request object at 0xb139508c>, query=<MoinMoin.search.queryparser.TitleSearch instance at 0xb0eeb6cc>, sort='page_name', mtime=None, historysearch=0, **kw={})
- 30 if isinstance(query, str) or isinstance(query, unicode):
- 31 query = QueryParser(**kw).parse_query(query)
- 32 return Search(request, query, sort, mtime=mtime,
- 33 historysearch=historysearch).run()
- 34
- historysearch = 0
- ).run undefined
/home/lotek/lib/python2.5/site-packages/MoinMoin/search/builtin.py in run (self=<MoinMoin.search.builtin.Search instance at 0xb0eebfac>)
- 454 start = time.time()
- 455 if self.request.cfg.xapian_search:
- 456 hits = self._xapianSearch()
- 457 logging.debug("search: _xapianSearch found %d hits" % len(hits))
- 458 else:
- hits undefined
- self = <MoinMoin.search.builtin.Search instance at 0xb0eebfac>
- self._xapianSearch = <bound method Search._xapianSearch of <MoinMoin.search.builtin.Search instance at 0xb0eebfac>>
/home/lotek/lib/python2.5/site-packages/MoinMoin/search/builtin.py in _xapianSearch (self=<MoinMoin.search.builtin.Search instance at 0xb0eebfac>)
- 551 clock.start('_xapianProcess')
- 552 try:
- 553 return self._getHits(hits, self._xapianMatch)
- 554 finally:
- 555 clock.stop('_xapianProcess')
- self = <MoinMoin.search.builtin.Search instance at 0xb0eebfac>
- self._getHits = <bound method Search._getHits of <MoinMoin.search.builtin.Search instance at 0xb0eebfac>>
- hits = [{'score': 100, 'uid': 918, 'values': {'attachment': u'', 'mtime': u'0', 'pagename': u'WikiKurs/01 Was ist ein MoinMoin-Wiki?', 'revision': u'1', 'wikiname': u'LotekHeavy'}}, {'score': 100, 'uid': 780, 'values': {'attachment': u'', 'mtime': u'0', 'pagename': u'WikiCourse/01 What is a MoinMoin wiki?', 'revision': u'1', 'wikiname': u'LotekHeavy'}}, {'score': 100, 'uid': 1123, 'values': {'attachment': u'moinmoin-addons.zip', 'mtime': u' 1181836688000000', 'pagename': u'MoinMoinWiki1.5', 'revision': u'0', 'wikiname': u'LotekHeavy'}}, {'score': 100, 'uid': 645, 'values': {'attachment': u'', 'mtime': u'0', 'pagename': u'MoinMoin/TextFormatting', 'revision': u'1', 'wikiname': u'LotekHeavy'}}, {'score': 100, 'uid': 606, 'values': {'attachment': u'', 'mtime': u'1197411582064754', 'pagename': u'Data/MoinMoin', 'revision': u'2', 'wikiname': u'LotekHeavy'}}, {'score': 97, 'uid': 923, 'values': {'attachment': u'', 'mtime': u'0', 'pagename': u'MoinMoin', 'revision': u'1', 'wikiname': u'LotekHeavy'}}, {'score': 88, 'uid': 599, 'values': {'attachment': u'', 'mtime': u'0', 'pagename': u'MoinMoin/InstallDocs', 'revision': u'1', 'wikiname': u'LotekHeavy'}}]
- self._xapianMatch = <bound method Search._xapianMatch of <MoinMoin.search.builtin.Search instance at 0xb0eebfac>>
/home/lotek/lib/python2.5/site-packages/MoinMoin/search/builtin.py in _getHits (self=<MoinMoin.search.builtin.Search instance at 0xb0eebfac>, pages=[{'score': 100, 'uid': 918, 'values': {'attachment': u'', 'mtime': u'0', 'pagename': u'WikiKurs/01 Was ist ein MoinMoin-Wiki?', 'revision': u'1', 'wikiname': u'LotekHeavy'}}, {'score': 100, 'uid': 780, 'values': {'attachment': u'', 'mtime': u'0', 'pagename': u'WikiCourse/01 What is a MoinMoin wiki?', 'revision': u'1', 'wikiname': u'LotekHeavy'}}, {'score': 100, 'uid': 1123, 'values': {'attachment': u'moinmoin-addons.zip', 'mtime': u' 1181836688000000', 'pagename': u'MoinMoinWiki1.5', 'revision': u'0', 'wikiname': u'LotekHeavy'}}, {'score': 100, 'uid': 645, 'values': {'attachment': u'', 'mtime': u'0', 'pagename': u'MoinMoin/TextFormatting', 'revision': u'1', 'wikiname': u'LotekHeavy'}}, {'score': 100, 'uid': 606, 'values': {'attachment': u'', 'mtime': u'1197411582064754', 'pagename': u'Data/MoinMoin', 'revision': u'2', 'wikiname': u'LotekHeavy'}}, {'score': 97, 'uid': 923, 'values': {'attachment': u'', 'mtime': u'0', 'pagename': u'MoinMoin', 'revision': u'1', 'wikiname': u'LotekHeavy'}}, {'score': 88, 'uid': 599, 'values': {'attachment': u'', 'mtime': u'0', 'pagename': u'MoinMoin/InstallDocs', 'revision': u'1', 'wikiname': u'LotekHeavy'}}], matchSearchFunction=<bound method Search._xapianMatch of <MoinMoin.search.builtin.Search instance at 0xb0eebfac>>)
- 650 page = Page(self.request, pagename, rev=revision)
- 651 if not self.historysearch and revision and \
- 652 page.getRevList()[0] != revision:
- 653 continue
- 654 if attachment:
- page = <MoinMoin.Page.Page object at 0xb03be26c>
- page.getRevList = <bound method Page.getRevList of <MoinMoin.Page.Page object at 0xb03be26c>>
- revision = 1
IndexError
list index out of range
- args = ('list index out of range',)
- message = 'list index out of range'
System Details
- Date: Tue, 05 Feb 2008 17:56:10 +0000
- Platform: Linux web11.webfaction.com 2.6.9-55.0.2.ELsmp #1 SMP Tue Jun 12 17:59:08 EDT 2007 i686
- Python: Python 2.5 (/home/lotek/bin/python)
- MoinMoin: Release 1.6.1 (release)
MoinMoin Log
713 2008-02-05 11:56:10,230 INFO xapianSearch: query = 'Xapian::Query(Smoinmoin:(wqf=200))' 714 2008-02-05 11:56:10,234 INFO 127.0.0.1 "GET /Index?action=fullsearch&context=180&value=moinmoin&titlesearch=Titel HTTP/1.1" 500 - 715 2008-02-05 11:56:10,234 ERROR IndexError: list index out of range 716 Traceback (most recent call last): 717 File "/home2/lotek/lib/python2.5/site-packages/MoinMoin/request/__init__.py", line 1283, in run 718 handler(self.page.page_name, self) 719 File "/home/lotek/lib/python2.5/site-packages/MoinMoin/action/fullsearch.py", line 187, in execute 720 results = searchPages(request, query, sort, mtime, historysearch) 721 File "/home/lotek/lib/python2.5/site-packages/MoinMoin/search/__init__.py", line 33, in searchPages 722 historysearch=historysearch).run() 723 File "/home/lotek/lib/python2.5/site-packages/MoinMoin/search/builtin.py", line 456, in run 724 hits = self._xapianSearch() 725 File "/home/lotek/lib/python2.5/site-packages/MoinMoin/search/builtin.py", line 553, in _xapianSearch 726 return self._getHits(hits, self._xapianMatch) 727 File "/home/lotek/lib/python2.5/site-packages/MoinMoin/search/builtin.py", line 652, in _getHits 728 page.getRevList()[0] != revision: 729 IndexError: list index out of range
MoinMoin Version |
1.6.1 |
OS and Version |
Linux and Xapian 1.0.4 with PyStemmer 1.0.1 |
Python Version |
2.5.1 |
Server Setup |
MoinMoin Server (Standalone) |
Server Details |
see OS and Verison |
Language you are using the wiki in (set in the browser/UserPreferences) |
DE |
Workaround
- rebuild the xapian index with moin.py
Discussion
Maybe, somebody could explain this error to me? Thanks!
I just got the same error on my machine. I am running RHEL 5, Python 2.4, Xapian 1.0.4 (no PyStemmer), MoinMoin 1.6.1, all in EN. I hope this gets fixed soon! --counterpoke
- Okay, so I edited the following lines:
page = Page(self.request, pagename, rev=revision) if not self.historysearch and revision and \ page.getRevList()[0] != revision:
topage = Page(self.request, pagename, rev=revision) revs = page.getRevList() if revs != []: if not self.historysearch and revision and \ revs[0] != revision: continue
and this seems to have "fixed" the issue. It was because some pages were returning "[]" for getRevList. This is a hack though. I don't exactly know if getRevList is supposed to return empty arrays... --counterpoke
Thanks for the patch. I think it happens when pages that got indexed a while ago match the search query, but someone renamed or nuked the pages after the index was built - so there are no revisions there any more. -- ThomasWaldmann 2008-05-03 17:43:55
Plan
- Priority:
- Assigned to:
Status: fixed in 1.6 by http://hg.moinmo.in/moin/1.6/rev/dffe0857d4f1 and in 1.7 by http://hg.moinmo.in/moin/1.7/rev/a8acceca815a