I keep getting random errors like:
suspended generator _get_tasklet(context.py:329) raised ProtocolBufferDecodeError(corrupted)
or
suspended generator put(context.py:796) raised ValueError(Expecting , delimiter: line 1 column 440 (char 440))
or
suspended generator put(context.py:796) raised ValueError(Invalid \escape: line 1 column 18002 (char 18002))
or
suspended generator _get_tasklet(context.py:329) raised ProtocolBufferDecodeError(truncated)
Everything was working fine up until a couple of days ago, and I haven’t made any changes. When I restart my app, everything is fine for about five minutes until I get a
suspended generator _get_tasklet(context.py:329) raised ProtocolBufferDecodeError(corrupted)
After that point, I get one of the other errors on every database put or get. The table and code that causes the error is different every time. I have not idea where to begin, since the error is in a new place every time. These are just regular database puts and gets, like
ndbstate = NdbStateJ.get_by_id(self.screen_name)
or
ndbstate.put()
Google searches haven’t been able to point me in any particular directions. Any ideas? The error
Expecting , delimiter: line 1 column 440 (char 440)
might be because some of the field types in some of the tables are JSON. But why all the sudden?
So maybe I'm not escaping properly somewhere, like by using r'{...}', but if there is a bad entry in there somewhere, how do I fix it if I can't query? And why does it break the whole table for all queries? And why is it random. It's not the same query every time.
Here’s an example of a table
class NdbStateJ(ndb.Model):
last_id = ndb.IntegerProperty()
last_search_id = ndb.IntegerProperty()
last_geo_id = ndb.IntegerProperty()
mytweet_num = ndb.IntegerProperty()
mentions_processed = ndb.JsonProperty()
previous_follower_responses = ndb.JsonProperty()
my_tweets_tweeted = ndb.JsonProperty()
responses_already_used = ndb.JsonProperty()
num_followed_by_cyborg = ndb.IntegerProperty(default=0)
num_did_not_follow_back = ndb.IntegerProperty(default=0)
language_model_vector = ndb.FloatProperty(repeated=True)
follow_wait_counter = ndb.IntegerProperty(default=0)
Here’s an example of creating a table
ndbstate = NdbStateJ(id=screen_name,
last_id = 37397357946732541,
last_geo_id = 37397357946732541,
last_search_id = 0,
mytweet_num = 0,
mentions_processed = [],
previous_follower_responses = [],
my_tweets_tweeted = [],
responses_already_used= [],
language_model_vector = [])
ndbstate.put()