gco / rietveld

Automatically exported from code.google.com/p/rietveld
Apache License 2.0
0 stars 0 forks source link

Searching for owner and modification date raises NeedIndexError #377

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open search form
2. Fill in owner and modified after
3. Press search

This causes a NeedIndexError (maybe there are other combinations of fields that 
raise that error too):

{'keys_only': False, 'modified_after': datetime.datetime(2011, 1, 1, 0, 0), 
'created_after': None, 'modified_before': None, 'format': u'html', 
'with_messages': False, 'private': None, 'cursor': u'', 'repo_guid': u'', 
'base': u'', 'limit': 10, 'closed': None, 'owner': None, 'reviewer': 
u'albrecht.andi@googlemail.com', 'created_before': None}
E 2012-04-17 19:28:12.993
NeedIndexError: 
Traceback (most recent call last):
  File "/base/python_runtime/python_lib/versions/third_party/django-1.2/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/base/data/home/apps/s~codereview-hr/92.357570713308080023/codereview/views.py", line 901, in json_wrapper
    data = func(request, *args, **kwds)
  File "/base/data/home/apps/s~codereview-hr/92.357570713308080023/codereview/views.py", line 3453, in search
    extra_nav_parameters=nav_params)
  File "/base/data/home/apps/s~codereview-hr/92.357570713308080023/codereview/views.py", line 1060, in _paginate_issues_with_cursor
    issues = query.fetch(limit)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/__init__.py", line 2091, in fetch
    return list(self.run(limit=limit, offset=offset, **kwargs))
  File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/__init__.py", line 2263, in next
    return self.__model_class.from_entity(self.__iterator.next())
  File "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_query.py", line 2743, in next
    next_batch = self.__batcher.next()
  File "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_query.py", line 2605, in next
    return self.next_batch(self.AT_LEAST_ONE)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_query.py", line 2642, in next_batch
    batch = self.__next_batch.get_result()
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 592, in get_result
    return self.__get_result_hook(self)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_query.py", line 2393, in __query_result_hook
    str(exc) + '\nThe suggested index for this query is:\n' + yaml)
NeedIndexError: no matching index found.
The suggested index for this query is:
- kind: Issue
  properties:
  - name: reviewers
  - name: modified

In addition we could remove the logging.info with query args.

Original issue reported on code.google.com by albrecht.andi on 17 Apr 2012 at 7:30

GoogleCodeExporter commented 9 years ago
This issue was closed by revision ea47839f1838.

Original comment by albrecht.andi on 12 Aug 2012 at 5:46