3

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

  • Create or select a project.
  • Enable the Cloud Speech API for that project
  • Create a service account
  • Download a private key as JSON

I have the gcloud installed on my command-line. Now when i try to activate service account using the below command,

gcloud auth activate-service-account --key-file=my-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. Check your iat and exp values and use a clock with skew to account for clock differences between systems.

I suspect it's the problem with the time zone. I'm running the command from my AWS EC2 instance.

Kiran Suvarna
  • 271
  • 6
  • 21
  • 1
    Is this related to: https://stackoverflow.com/questions/30115933/access-token-and-refresh-token-giving-invalid-grant-in-google-plus-in-python/30117441#30117441 – cherba Oct 05 '17 at 11:50
  • I have the same problem, it only happens if I try to connect to Google Cloud when restarting the system before ntpd starts running. So it seems it is related with the local time of the server being too different from Google's servers. – Daniel Nov 23 '17 at 03:50

2 Answers2

0

I think there is a cache with this somewhere, after around 10 minutes it resolved itself.

I ran into this error when I created a new key for a service account and deleted the old one.

Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
0

In my case fixing the date solved the issue. If you are in linux, you can change the date by executing

date -s "Thu Feb 24 22:32:36 EET 2022"
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77