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.62k stars 207 forks source link

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

Closed taylorwilsdon closed 1 year ago

taylorwilsdon commented 1 year ago

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

jay0lee commented 1 year ago

GYB looks for files named .mbox, .mbx or .eml in the folder you specify. Confirm they are there.

Jay

On Mon, Feb 13, 2023, 3:37 PM Taylor Wilsdon @.***> wrote:

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.

@.:~/bin/gyb$ sudo ./gyb --action check-service-account --email @. Checking service account DwD for @.*** 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 @.*** --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 @.*** --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

— Reply to this email directly, view it on GitHub https://github.com/GAM-team/got-your-back/issues/415, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDIZMBDVYHYQTRQ5Y7S6XDWXKLSFANCNFSM6AAAAAAU2XJNN4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

taylorwilsdon commented 1 year ago

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!

jay0lee commented 1 year ago

No problem. Glad you found the culprit.