카테고리 없음

(gcloud.auth.activate-service-account) There was a problem refreshing your current auth tokens 문제 해결

Zorba blog 2022. 5. 2. 16:14

Google Speech to Text API 사용중 Key를 인식하는데 아래와 같은 오류가 발생했다.

$ gcloud auth activate-service-account --key-file="/home/clab/Downloads/google_stt/phrasal-indexer-347801-8b155b9c00c8.json"

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 in the JWT claim.', {'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 in the JWT claim.'})
Please run:

  $ gcloud auth login

to obtain new credentials.

If you have already logged in with a different account:

    $ gcloud config set account ACCOUNT

to select an already authenticated account to use.

 

아래 글을 참고해보니 리눅스 시간 세팅이 문제였던것 같다.

 

https://stackoverflow.com/questions/46567518/error-while-activating-the-gcloud-service-account-from-command-line

 

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 Create or select a pr...

stackoverflow.com

 

$ sudo date -s "Thu Feb 24 22:32:36 EET 2022"

 

코드를 통해 현재 시간으로 설정해두니 에러 없이 정상 작동한다.

위 코드를 그대로 쓰면 안되고 오른쪽 아래 보이는 시간으로 반영하시길!

초는 틀려도 상관 없는듯