-1

I am new to app engine and trying to deploy a python app. The app works correctly when I preview it on my local host but when I deploy it I get the following error: "Internal Server Error

The server has either erred or is incapable of performing the requested operation."

And traceback:

Traceback (most recent call last):   
   File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in __call__
    rv = self.handle_exception(request, response, e)   
   File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__
    rv = self.router.dispatch(request, response)   
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher
    return route.handler_adapter(request, response)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in __call__
    return handler.dispatch()
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 572, in dispatch
    return self.handle_exception(e, self.app.debug)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch
    return method(*args, **kwargs)
File "/base/data/home/apps/s~ecd-signup/20160620t104611.393644814392119591/hpvball.py", line 78, in get
    entries_c = qry_c.fetch(100)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/utils.py", line 160, in positional_wrapper
    return wrapped(*args, **kwds)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/query.py", line 1203, in fetch
    return self.fetch_async(limit, **q_options).get_result()
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 383, in get_result
    self.check_success()
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 427, in _help_tasklet_along
    value = gen.throw(exc.__class__, exc, tb)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/query.py", line 980, in _run_to_list
    batch = yield rpc
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 513, in _on_rpc_completion
    result = rpc.get_result()
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 613, in get_result
    return self.__get_result_hook(self)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/datastore/datastore_query.py", line 2921, in __query_result_hook
    yaml_index=yaml, xml_index=xml) 

NeedIndexError: no matching index found. recommended index is:
  - kind: Entry
    ancestor: yes   
properties:
  - name: committed
  - name: date

The suggested index for this query is:
- kind: Entry
  ancestor: yes
properties:
  - name: committed
  - name: date
snakecharmerb
  • 47,570
  • 11
  • 100
  • 153
  • 2
    `NeedIndexError: no matching index found.` and what comes after it is pretty explicit –  Jun 20 '16 at 18:36

1 Answers1

1

If this is a new/recent deployment of the app it's possible for the newly added/modified indexes to be still building, the condition is transitory and will eventually go away. See this answer: https://stackoverflow.com/a/29807764/4495081.

It's possible in some cases that the suggested index is not automatically generated by the local development server. Check your local index file for the existance of the suggested index. If missing add it manually.

It's also possible in some cases (some multi-module apps, for example) that the app deployment doesn't automatically upload the local app index file. If the indexes displayed in the developer console don't match those you see in the local index file you should deploy them explicitly, using the update_indexes appcfg.py option.

Community
  • 1
  • 1
Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
  • I first suspected that it was still building also, but the problem persisted long after I deployed, I also tried manually fixing the index file and had no luck. I haven't tried explicitly updating indexes. Thanks for your suggestions! – Ross Griebenow Jun 21 '16 at 17:47
  • the index status page should be very clear: if it's present or not, if it's building or not. Based on that the action should be clear. – Dan Cornilescu Jun 21 '16 at 18:07