Skip to content

Client Datastore API with App Engine Devserver #1328

Closed
@mitchhentges

Description

@mitchhentges

I've investigated into #216, but I can't quite get my Client Datastore connection to work with the App Engine Devserver.

I've tried:

# No environment variables, DatastoreOptions.defaultInstance().service()
com.google.datastore.v1.client.DatastoreException: Request had invalid authentication credentials.

# DATASTORE_EMULATOR_HOST=localhost:8080
# DatastoreOptions.defaultInstance().service()
WARNING: No file found for: /v1/projects/navistream2dev:runQuery
SEVERE: com.google.cloud.datastore.DatastoreException: Non-protobuf error: <html><head><title>Error 404</title></head>
<body><h2>Error 404</h2></body>
</html>. HTTP status code was 404.

# export DATASTORE_PROJECT_ID=navistream2dev   
# export DATASTORE_EMULATOR_HOST=localhost:8080
# DatastoreOptions.defaultInstance().service()
WARNING: No file found for: /v1/projects/navistream2dev:runQuery
SEVERE: com.google.cloud.datastore.DatastoreException: Non-protobuf error: <html><head><title>Error 404</title></head>
<body><h2>Error 404</h2></body>
</html>. HTTP status code was 404.

# export DATASTORE_PROJECT_ID=navistream2dev
# DatastoreOptions.defaultInstance().service()
WARNING: failed _ah_AbandonedTransactionDetector: java.lang.RuntimeException: Could not get Cloud Datastore options from environment.
Oct 20, 2016 4:45:00 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: Failed startup of context com.google.appengine.tools.development.DevAppEngineWebAppContext@21ffbe3b{/,/home/mitch/dev/navistream/server/navistream/build/exploded-app}
java.lang.RuntimeException: Could not get Cloud Datastore options from environment.
Caused by: java.io.IOException: Application Default Credentials failed to create the Google App Engine service account credentials class com.google.appengine.repackaged.com.google.api.client.googleapis.extensions.appengine.auth.oauth2.AppIdentityCredential$AppEngineCredentialWrapper. Check that the component 'google-api-client-appengine' is deployed.
Caused by: java.lang.ClassNotFoundException: com.google.appengine.repackaged.com.google.api.client.googleapis.extensions.appengine.auth.oauth2.AppIdentityCredential$AppEngineCredentialWrapper

// Interestingly, this is trying to get `AppIdentityCredential` from "com.google.appengine.repackaged.com.google.api...", rather than from "com.google.api..."

Am I missing an environment variable for configuration to make this work nicely?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions