java.io.IOException:获取服务帐户的访问令牌时出错:连接超时,iss:<>@<>.iam.gserviceaccount.com



在从本地环境更改为docker compose-environmente后,我得到了这个错误,我使用卷使用与主机相同的本地时间和区域部署容器:

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();

这似乎是一个网络问题,但我的防火墙坏了,我真的不知道它是否允许从我的容器到谷歌令牌端点的流量。变量";是";是带有我的谷歌凭据的InputStream

此外,我还连接到pubsub以及

GoogleCredentials credentials =
GoogleCredentials.fromStream(is2)
.createScoped(
Collections.singletonList("https://www.googleapis.com/auth/pubsub"));
credentials.refreshIfExpired();

其中";is2";是另一个带有我的服务帐户密钥的输入流。

这是一个网络问题,在yml文件中解决了它:network_mode:";"桥";或network_mode:";主机";

最新更新