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.

Home Page:https://github.com/GAM-team/got-your-back/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Restores immediately complete with "done!" message, having not restored anything

taylorwilsdon opened this issue · comments

Some odd behavior here, and I reproduced it on Ubuntu 18.04.6 (Bionic) on version 1.70 and 1.72 as well as MacOS Ventura 13.1 with version 1.72 (latest). We have been following the same workflow for years restoring mbox archives, but about a week or two ago the behavior changed and instead of successfully restoring the archive, it just thinks it's done right away. Other GAM commands continue to work and the authorization on all calls succeeds, it's just restoring that fast forwards to done before doing anything.

--debug provides no useful information but shows all 200s from the API responses it logs. Using the --check-service-account flag reports PASS for all items when checking the service account we use for these restores.

me@host:~/bin/gyb$ sudo ./gyb --action check-service-account --email svc-acct-email@our-workspace.com
Checking service account DwD for svc-acct-email@our-workspace.com...
Scope: https://mail.google.com/ PASS
Scope: https://www.googleapis.com/auth/apps.groups.migration PASS
Scope: https://www.googleapis.com/auth/drive.appdata PASS
Scope: https://www.googleapis.com/auth/userinfo.email PASS

All scopes passed!
Service account redacted is fully authorized.
Please confirm the following:

Full steps to reproduce the issue:

  1. Install GAM and configure a service account with appropriate permissions for restores
  2. Kick off restore with command similar to sudo ./gyb --email email-in-question@ourworkspace.com --action restore --local-folder /archive/location --service-account --vault
  3. Have also tried using --restore-mbox instead of just --restore, same behavior - sudo ./gyb --email email-in-question@ourworkspace.com --action restore-mbox --local-folder /archive/location --service-account --vault

Expected outcome (what are you trying to do?):
Restore contents of mbox archive to Google Vault

Actual outcome (what errors or bad behavior do you see instead?):
Immediately completes with no other logging available

Appreciate the quick reply @jay0lee - it appears that at some point our archive process started zipping the mbox files 🤦 We can close this and I'll go back in shame for not checking the source material closely enough. Thanks again!

No problem. Glad you found the culprit.