[英]Error while activating the gcloud service account from command line
I'm referring to this URL https://cloud.google.com/speech/docs/getting-started to get started with the google speech API. As the site suggests,I followed the following steps我指的是这个 URL https://cloud.google.com/speech/docs/getting-started开始使用谷歌语音 API。正如网站所建议的,我按照以下步骤操作
I have the gcloud installed on my command-line.我在命令行上安装了 gcloud。 Now when i try to activate service account using the below command,现在,当我尝试使用以下命令激活服务帐户时,
gcloud auth activate-service-account --key-file=my-service-account-key-file gcloud auth activate-service-account --key-file=我的服务账户密钥文件
i'm getting the below error.我收到以下错误。
ERROR: (gcloud.auth.activate-service-account) There was a problem refreshing your current auth tokens: invalid_grant: Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe.错误:(gcloud.auth.activate-service-account)刷新您当前的身份验证令牌时出现问题:invalid_grant:无效 JWT:令牌必须是短期令牌(60 分钟)并且在合理的时间范围内。 Check your iat and exp values and use a clock with skew to account for clock differences between systems.检查您的 iat 和 exp 值,并使用带有偏差的时钟来解决系统之间的时钟差异。
I suspect it's the problem with the time zone.我怀疑这是时区的问题。 I'm running the command from my AWS EC2 instance.我正在从我的 AWS EC2 实例运行命令。
I think there is a cache with this somewhere, after around 10 minutes it resolved itself.我认为某处有一个缓存,大约 10 分钟后它自行解决。
I ran into this error when I created a new key for a service account and deleted the old one.当我为服务帐户创建新密钥并删除旧密钥时遇到此错误。
In my case fixing the date solved the issue.在我的例子中,确定日期解决了这个问题。 If you are in linux, you can change the date by executing如果你在 linux,你可以通过执行来更改日期
date -s "Thu Feb 24 22:32:36 EET 2022"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.