Bala.Raj
Bala.Raj

Reputation: 1051

GAE Datastore "java.lang.IllegalArgumentException: Property `${property}' contains an invalid nested entity."

Started receiving an error for the past couple days for persisting nested map structure as an Embedded entity. It was working early without any problem.

java.lang.IllegalArgumentException: Property metrics contains an invalid nested entity.
    at com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:49)
    at com.google.appengine.api.datastore.DatastoreApiHelper$1.convertException(DatastoreApiHelper.java:127)
    at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:97)
    at com.google.appengine.api.datastore.Batcher$ReorderingMultiFuture.get(Batcher.java:115)
    at com.google.appengine.api.datastore.FutureHelper$TxnAwareFuture.get(FutureHelper.java:171)
    at com.googlecode.objectify.cache.TriggerFuture.get(TriggerFuture.java:100)
    at com.googlecode.objectify.impl.ResultAdapter.now(ResultAdapter.java:34)

Also already that property unindexed. Technically it should ignore the limit of 1500 bytes. I think they made some changes to restrict this.

This error is not documented anywhere.

Upvotes: 1

Views: 261

Answers (2)

Bala.Raj
Bala.Raj

Reputation: 1051

Keys with dots cannot be used in embedded maps because they have a unique meaning in the new API. If you must have dots in your keys, you can escape them using an @Stringify Stringifier.

Consequently, if you insist on using embedded maps, sanitize to prevent such exceptions.

Found the reason here: https://github.com/objectify/objectify/wiki/UpgradeVersion5ToVersion6

Upvotes: 2

Tilo Dickopp
Tilo Dickopp

Reputation: 1

One reason for this error could be that you are directly sending protobufs and serialized some bytes that are simply not a valid entity.

Upvotes: 0

Related Questions