0

Getting invalid grant error when i try to run a query from BQ in java spring boot:

{
  "error" : "invalid_grant",
  "error_description" : "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."
}

Any suggestions??

clint
  • 1,786
  • 4
  • 34
  • 60

1 Answers1

0

According to the error message that is displayed ( Invalid JWT: Token must be a short-lived token... ), it looks like the issue could be that the machine were you are running your code has an incorrect system clock.

I have found several Stack Overflow questions (this BigQuery one, this Google API other, or also this Google Cloud Client API question). They all agree (and were solved) that the issue was in the synchronization of the system clock of the machine/server/device where the code was running.

OAuth2 tokens must be short-lived, as showing in the error message, and if the system clock where the code is running is not synchronized, this type of errors can appear. So please doublecheck if that can be your issue, as it looks like it is the most reasonable failure reason.

dsesto
  • 7,864
  • 2
  • 33
  • 50