Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IllegalStateException with Google App Engine Local Datastore

So I'm trying to run a Google App Engine with the Datastore locally to test and debug. The local App Engine seems to work on its own, as does the datastore emulator.

But as soon as I set the environment variables for the datastore emulator, and restart the local App Engine, it crashes with the error,

Caused by: java.lang.IllegalStateException: Must use project ID as app ID if project ID is provided. 

I've attached a more complete stack trace below

From the error message, I suspected I need to change my project id to the project name instead. So I tried replacing various instances of the project id with the project name where I could and unfortunately this did not work either.

Commands I'm running:

1. gcloud config set project PROJECT-ID
2. export ENDPOINTS_SERVICE_NAME=name.endpoints.PROJECT-ID.cloud.goog
3. gcloud beta emulators datastore start
4. $(gcloud beta emulators datastore env-init)
5. mvn appengine:run

I've put the stack trace on pastebin https://pastebin.com/atcnYwrq

like image 827
James Ridey Avatar asked Aug 12 '26 05:08

James Ridey


1 Answers

I happened to stumble into a way to fix this.

export DATASTORE_USE_PROJECT_ID_AS_APP_ID=true
like image 169
Steve Ferguson Avatar answered Aug 14 '26 22:08

Steve Ferguson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!