Application was running fine for quite some time but after these env updates my application has not been stable.
There are two errors happening that seem related.
1 java.lang.IllegalArgumentException: Cursor does not match query.
After doing:
Query<PageFragmentContentItem2> loadIdCis=getStorage().load()
.type(PageFragmentContentItem2.class)
.filter("loadId", candidateLoadId)
.order("-orderingScalar"); // i use limits here too but removed to narrow down bug
then:
String curStr=user.loadIdToCursor.get(candidateLoadId);
if(curStr!=null) {
Cursor cursor=Cursor.fromWebSafeString(curStr);
loadIdCis.startAt(cursor);
}
iterator = loadIdCis.iterator();
do a bunch or reading (no writes/updates/deletes on PageFrag), then:
if(!iterator.hasNext()) {
endOfLoadIdReached(user, loadId);
} else {
user.loadIdToCursor.put(loadId, iterator.getCursor().toWebSafeString()); //Exception here
}
Exception stack:
java.lang.IllegalArgumentException: Cursor does not match query.
at com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:39)
at com.google.appengine.api.datastore.DatastoreApiHelper$1.convertException(DatastoreApiHelper.java:76)
at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:94)
at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:86)
at com.google.appengine.api.datastore.FutureHelper.getInternal(FutureHelper.java:71)
at com.google.appengine.api.datastore.FutureHelper.quietGet(FutureHelper.java:32)
at com.google.appengine.api.datastore.QueryResultsSourceImpl.peekQueryResultAndIfFirstRecordIndexList(QueryResultsSourceImpl.java:167)
at com.google.appengine.api.datastore.QueryResultsSourceImpl.loadMoreEntities(QueryResultsSourceImpl.java:109)
at com.google.appengine.api.datastore.QueryResultIteratorImpl.ensureInitialized(QueryResultIteratorImpl.java:135)
at com.google.appengine.api.datastore.QueryResultIteratorImpl.getCursor(QueryResultIteratorImpl.java:86)
at com.googlecode.objectify.impl.ChunkingIterator.getCursor(ChunkingIterator.java:114)
2 The other error is that iter.hasNext() used to return false when the end of the list (using the cursor) was reached but now it seems like it just cycles. This could be because the ex above, though.
I blow away all data before testing so it's not that.
Ideas?