com.google.gcloud.bigquery.BigQueryException:获取服务帐户的访问令牌时出错:

时间:2016-04-19 13:56:57

标签: google-oauth google-bigquery gcloud-java

我有一个程序将涉及使用com.google.gcloud:gcloudjava:0.1.4使用默认BigQueryOptions配置经常访问BigQuery

但是有时我的堆栈跟踪错误如下

    Caused by: java.io.IOException: Error getting access token for service account:
    at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:227)
    at com.google.auth.oauth2.OAuth2Credentials.refresh(OAuth2Credentials.java:97)
    at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:74)
    at com.google.auth.http.HttpCredentialsAdapter.initialize(HttpCredentialsAdapter.java:65)
    at com.google.gcloud.ServiceOptions$1.initialize(ServiceOptions.java:533)
    at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:93)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest(AbstractGoogleClientRequest.java:300)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
    at com.google.gcloud.spi.DefaultBigQueryRpc.query(DefaultBigQueryRpc.java:402)

它只是偶尔失败,但我想知道是否有任何方法可以改善程序的稳定性。因此,万一我想知道,这是一个纯粹的服务器端问题,我无法做到这一点,或者是否有任何方式我可以在客户端潜在地减少这种情况发生的可能性(比如通过更改身份验证配置)或其他什么?)

1 个答案:

答案 0 :(得分:0)

google-oauth可能是服务器方面的问题。我也遇到了问题 - 过去工作正常的服务不再能获得访问令牌(大约1小时)。

相关问题