GAM-team / got-your-back

Got Your Back (GYB) is a command line tool for backing up your Gmail messages to your computer using Gmail's API over HTTPS.
https://github.com/GAM-team/got-your-back/wiki
Apache License 2.0
2.64k stars 211 forks source link

Exit status code 18: Token has been expired or revoked #282

Closed hudcap closed 4 years ago

hudcap commented 4 years ago

Full steps to reproduce the issue: I have an account setup for read-only backup that runs daily. It worked successfully many times. I run my backups with the following:

gyb --email *****@gmail.com --local-folder C:\Users\****\GYB-GMail-Backup-****@gmail.com --fast-incremental

Expected outcome (what are you trying to do?): A successful backup

Actual outcome (what errors or bad behavior do you see instead?): Exit status code 18

ERROR: ('invalid_grant: Token has been expired or revoked.', '{\n  "error": "invalid_grant",\n  "error_description": "Token has been expired or revoked."\n}')

The request to refresh tokens is failing even though it has worked until a few days ago. I have not invalidated the GYB authorization in my account.

g1th4ck commented 4 years ago

I have a similar problem.

In my case i get the following error:

ERROR: ('invalid_grant: Bad Request', '{\n "error": "invalid_grant",\n "error_description": "Bad Request"\n}')

It seems my weekly backups stopped working two weeks ago. I discovered the GAM project access in my account was deleted, so i tried to recreate the project, but even after doing it, it doesn't work anymore.

I suspect something has happened either with the GAM project or with Google Cloud Platform.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

sundeepnarang commented 3 years ago

A simple manual fix for me was to delete cfg files for mailbox and run backup again. This causes OAuth token to be regenerated. The cfg files were at /home/USER/bin/gyb/email@email.com.cfg

yesrod commented 3 years ago

Google, in their infinite wisdom, has limited authorization for "testing" projects to seven days. After seven days, the token expires and must be reauthorized.

https://support.google.com/cloud/answer/10311615?hl=en#zippy=%2Ctesting

brechmos commented 2 years ago

I followed the directions in the Wiki to create the App etc. I hit this 7 day issue, but am now confused.

I understand this is a Google question but it is related to GYB.