Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gdrive command line oauth2: cannot fetch token: 400 Bad Request

Suddenly, gdrive command line tool stops working, and always gives the following error message:

Failed to get about: Get https://www.googleapis.com/drive/v3/about?alt=json&fields=maxImportSizes%2CmaxUploadSize%2CstorageQuota%2Cuser: oauth2: cannot fetch token: 400 Bad Request
Response: {
  "error": "invalid_grant",
  "error_description": "Bad Request"
}
like image 655
skyuuka Avatar asked Nov 22 '19 01:11

skyuuka


1 Answers

This is because your authorization token has expired.

Currently there is an open Issue to improve this error message here.

You should delete your token with rm ~/.gdrive/token_v*.json then run the gdrive about command to reauthorize

like image 126
ZektorH Avatar answered Oct 21 '22 07:10

ZektorH