google app engine (spring boot) local testing with

2019-03-04 13:56发布

Google flexible app engine spring boot project running on local with datastore is giving the com.google.cloud.datastore.DatastoreException Unauthenticated exception while saving entity.

{
   "timestamp": 1512077140003,
   "status": 500,
   "error": "Internal Server Error",
   "exception": "com.google.cloud.datastore.DatastoreException",
   "message": "Unauthenticated.",
   "path": "/users"
}

The error description here says the request header does not have valid authentication header, But where to place the auth header does not mentioned.

anybody faced same kind of situation?

1条回答
Explosion°爆炸
2楼-- · 2019-03-04 14:35

Canonical Error Code: UNAUTHENTICATED

Description: The com.google.cloud.datastore.DatastoreException simply indicates that the request did not have valid authentication credentials.

Recommended Action: Do not retry without fixing the problem. In this case, you need to check the login credentials again.

More read can be found on this page https://cloud.google.com/datastore/docs/concepts/errors#error_codes

Solution:

Simply you have to run gcloud beta auth application-default login. But I spent a half of a day until found it there. I thought it should be enough to gcloud init. As an alternative, you can use google authentication via Google OAuth2 but that is the hard way.

查看更多
登录 后发表回答