Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Intermittent Assertion Error for queries on entities created by Cloud NBD queried by NDB

I recently migrated to Cloud NDB and python3 for app engine from Python2 / ndb. I need both versions running at the same time on the same Datastore.

I've found entity.get() for an entity that was created by Cloud NDB throws an Assertion error about 20% of requests on the python2 service. Is there a way to update the .get() or otherwise to ensure it can pull it from the datastore correctly?

Error thrown

"/base/alloc/tmpfs/dynamic_runtimes/python27g/19fab4ec47735ec6/python27/python27_lib/versions/1/google/appengine/ext/ndb/model.py", line 1234, in _opt_call_to_base_type
    value = _BaseValue(self._call_to_base_type(value))
  File "/base/alloc/tmpfs/dynamic_runtimes/python27g/19fab4ec47735ec6/python27/python27_lib/versions/1/google/appengine/ext/ndb/model.py", line 751, in __init__
    assert not isinstance(b_val, list), repr(b_val)
AssertionError: []

I thought it might be a cache conflict, but there is a problem about 25% of queries

1 2 173
2 REPLIES 2

Found a work around, the key.get() will fail, but I can build a query around that key to retrieve the entity with consistency.

 

I have the exactly same issue