![](/img/trans.png)
[英]Getting java.io.IOException: Error getting access token for service account: connect timed out while making a call to datastore
[英]java.io.IOException: Error getting access token for service account: connect timed out, iss: <>@<>.iam.gserviceaccount.com
從本地更改為 docker-compose 環境后,我收到此錯誤,我使用卷部署容器,使用與主機相同的本地時間和區域:
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
我確認沒問題,不知道為什么會出現連接超時錯誤。 可能是什么錯誤? 因為當我在 intellij 上運行它時它工作正常,然后它在 docker-compose 部署中崩潰。
這是我得到錯誤的地方:
this.credentials =
GoogleCredentials
.fromStream(is)
.createScoped(Collections.singletonList("https://www.googleapis.com/auth/rcsbusinessmessaging"));
this.credentials.refreshIfExpired();
似乎是網絡問題,但我的防火牆已關閉,我真的不知道它是否允許從我的容器到谷歌令牌端點的流量。 變量“is”是帶有我的谷歌憑據的 InputStream
我也和pubsub有聯系
GoogleCredentials credentials =
GoogleCredentials.fromStream(is2)
.createScoped(
Collections.singletonList("https://www.googleapis.com/auth/pubsub"));
credentials.refreshIfExpired();
其中“is2”是我的服務帳戶密鑰的另一個輸入流。
這是一個在 yml 文件中解決的網絡問題:network_mode: "bridge" 或 network_mode: "host"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.