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.61k stars 206 forks source link

gyb stops when trying to create label Muted #300

Closed jstuker closed 3 years ago

jstuker commented 3 years ago

Full steps to reproduce the issue:

  1. I am restoring a mbox file created by Google Takeout to a google Gmail-account using the following command
  2. ./gyb --email stuker@gmail.com --action restore-mbox --local-folder "/Users/jstuker/Downloads/Takeout"
  3. after a long (successful period) I get the following error and the cript terminats
  4. Creating label Muted
  5. 400: Invalid label name - invalidArgument

Workaround:

  1. I try to create the label Muted in the GMail UI. Not allowed, because system label
  2. I rename the label in the mbox file using: sed -i -e '/X-Gmail-Labels/s/Muted/Mutex/' All\ mail\ Including\ Spam\ and\ Trash.mbox
  3. Restarting gyb works fine now

So could you skip the label creation in the code?

Tsusai commented 3 years ago
  1. I rename the label in the mbox file using: sed -i -e '/X-Gmail-Labels/s/Muted/Mutex/' All\ mail\ Including\ Spam\ and\ Trash.mbox

@jstuker I ran into the same issue this weekend. I have a takeout mbox with a "muted" label, whatever that is (probably due to the new snooze/reminder options?). Thank you so much for this workaround, it's saved me from additional headaches and panic

BobDankert commented 3 years ago

I also ran into this issue. It was 18,000 emails into a restore-mbox action, and when I manually edited the mbox file it didn't resume the restore properly (it started over at message 1 and was duplicating messages, and I couldn't find a way to specify to skip the first 18,000 messages). To get around this and allow it to skip just the one message, I run with: --batch-size 1 --strip-labels and aborted the command (ctrl-c in win) after it imported the message. Then I resumed running this with the normal batch-size and without strip-labels and it continued without issues.

It would be nice if slightly better support for this could be added

1993alexey commented 3 years ago

Same issue here. The suggested workarounds above helped.

stale[bot] commented 3 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.

beetree commented 2 years ago

I just had this issue happen so it's still an active issue in the latest release.