BadValueError: Entity has uninitialized properties ___ after resetting indexes and clearing memcache
<p>I'm working on a Google App Engine application in python. I tried to switch a query I was running for one of my routes to query on only one property instead of 2, which caused an indexing error to appear whenever we tried running that query.</p>

<p>It was something along the lines of "No index matching the specified parameters could be found", but I don't have any screen shots at the moment. In order to try and rectify the situation, we ran appcfg.py vacuum_indices and deleted all indices related to the original search. We then uploaded a new index.yaml specifying the new index. Though we were able to see that the new indexes had indeed been created on the admin panel, and the old ones were gone, we were still getting the same error.</p>

<p>We're really unsure why this is happening, and are having trouble finding documentation online for these issues. Our next thought was that some previous state in memcache was causing the query to attempt to use it's old index. So we flushed memcache, and now we're getting this error:</p>

<pre><code>File  &amp;quot;/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py&amp;quot;, line 1535, in __call__
  rv = self.handle_exception(request, response, e)
File &amp;quot;/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py&amp;quot;, line 1529, in __call__
  rv = self.router.dispatch(request, response)
File &amp;quot;/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py&amp;quot;, line 1278, in default_dispatcher
  return route.handler_adapter(request, response)
File &amp;quot;/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py&amp;quot;, line 1102, in __call__
  return handler.dispatch()
File &amp;quot;/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py&amp;quot;, line 572, in dispatch
  return self.handle_exception(e, self.app.debug)
File &amp;quot;/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py&amp;quot;, line 570, in dispatch
  return method(*args, **kwargs)
File &amp;quot;/base/data/home/apps/s~dev-erpetcloud2/dev1.392600188150722624/routes/users.py&amp;quot;, line 172, in post
  res_dict = cp_user.to_dict()
File &amp;quot;/base/data/home/apps/s~dev-erpetcloud2/dev1.392600188150722624/routes/models/../models/cp_models.py&amp;quot;, line 248, in to_dict
  animal_dict = animal.to_dict()
File &amp;quot;/base/data/home/apps/s~dev-erpetcloud2/dev1.392600188150722624/routes/models/../models/cp_models.py&amp;quot;, line 574, in to_dict
  protocol, params = self.get_protocol_and_params()
File &amp;quot;/base/data/home/apps/s~dev-erpetcloud2/dev1.392600188150722624/routes/models/../models/cp_models.py&amp;quot;, line 395, in get_protocol_and_params
  record = self.protocol_state_key.get()
File &amp;quot;/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/key.py&amp;quot;, line 572, in get
  return self.get_async(**ctx_options).get_result()
File &amp;quot;/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py&amp;quot;, line 342, in get_result
  self.check_success()
File &amp;quot;/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py&amp;quot;, line 389, in _help_tasklet_along
  value = gen.send(val)
File &amp;quot;/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/context.py&amp;quot;, line 765, in get
  pbs = entity._to_pb(set_key=False).SerializePartialToString()
File &amp;quot;/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/model.py&amp;quot;, line 3158, in _to_pb
  self._check_initialized()
File &amp;quot;/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/model.py&amp;quot;, line 3014, in _check_initialized
'Entity has uninitialized properties: %s' % ', '.join(baddies))
BadValueError: Entity has uninitialized properties: title
</code></pre>

<p>Looking through the datastore, the entity that this trace references definitely does have a 'title' property.</p>

<p>I've looked around a lot for errors that can arise from deleting indices and flushing memcache, and nothing useful has come up.</p>

<p>If someone could perhaps give me a bit of insight into what could be happening here and how these systems work (my mental model might be off), or point me in the right direction, that would be fantastic. Thanks!!</p>