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.6k stars 205 forks source link

restore-group: "400: Unable to parse the raw message - invalid" #349

Open Jerther opened 2 years ago

Jerther commented 2 years ago

Full steps to reproduce the issue:

  1. Use google takeout to export emails from a google workspace user
  2. Download the takeout archive, and extract it localluy
  3. Create a google Groups to receive the emails
  4. Install gyb for windows and when prompted for a user, use a super admin
  5. gyb --email groupe.archive@mydomain.com --action restore-group --local-folder c:\takeout --use-admin

Expected outcome (what are you trying to do?): All emails are imported, except those that are too big

Actual outcome (what errors or bad behavior do you see instead?): A LOT of "400: Unable to parse the raw message - invalid"

Additional info: There's not much help on this on the net.... All I found was this SO article but that doesn't help a mere user ;)

Jerther commented 2 years ago

I also found this thread on your google group. The user reports having problems with Hangouts (Chat) messages, and that could be the problem here also.

jay0lee commented 2 years ago

The Google APIs generally don't support backup/restore of Google Chat messages and those messages are excluded from the initial backup by default. If you are using a custom --search rule on the backup you should add -is:chat to exclude Chat messages from your backup also.

If the error is happening on something other than a chat message then I'll need to see specific examples of failing messages in order to repro the issue.

Jerther commented 2 years ago

Hmm, not sure I follow you on the initial backup. I used Google Takeout with the default settings. Here, chats appear to be selected by default, unless that means nothing when the top checkbock is checked:

image

("Clavardage" means "Chat" in french)

jay0lee commented 2 years ago

Yes, you'd want to exclude Chat from the Takeout. They can't be migrated back into Gmail or Groups in any meaningful form.

Jerther commented 2 years ago

I understand thanks.

Would it be possible for GYB to detect such chat messages and skip them with a proper warning? The message it outputs right now is a bit worrisome and confusing...

Also the documentation does not say much about Chat messages, except in the "--action count" section.