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

ERROR: 400: Invalid label: CHAT revisited #286

Closed xdaviddx closed 3 years ago

xdaviddx commented 4 years ago

First off, thanks for making this available. It really is a great tool for moving emails around and maintaining their original state.

Please confirm the following:

Full steps to reproduce the issue:

  1. Export emails with: gyb --email user@domain.com --local-folder C:\gyb\user@domain.com --search "before:2015/01/01"
  2. Restore emails with: gyb --email userbackup@domain.com --action restore --local-folder C:\gyb\user@domain.com
  3. ERROR: 400: Invalid label: CHAT. Skipping message restore, you can retry later with --fast-restore

Expected outcome (what are you trying to do?): Trying to move emails and chat messages from one account to another.

Actual outcome (what errors or bad behavior do you see instead?): ERROR: 400: Invalid label: CHAT. Skipping message restore, you can retry later with --fast-restore

This has been reported before and didn't seem to go anywhere. I thought I'd point out a thread where this was discussed and someone had an idea on how to solve for it.

https://stackoverflow.com/questions/34736722/how-to-restore-chat-using-gmail-api

... The Gmail API doesn't provide a means to restore a chat message AS a chat message. The best you can do is create a regular email message (via Gmail.message.insert) and fill it with the chat message's content. ...

I don't know if it is the fact that the api is failing when you try to set the label to CHAT or if there is a header missing that makes it an invalid message for the insert api or if it is a special message type and you just can't insert a message of type CHAT, but in any of those situations, if you treat CHAT messages differently and either change the label to something like "Chat Messages" or fill in dummy values for the missing headers or create it as a regular email message and dump the content into it, that seems like a way to work around it. These are the only messages out of hundreds of thousands I've processed that fail and can't be fixed by re-running the program multiple times.

Thanks again, David

niederme commented 4 years ago

I too have this issue, same repro steps.

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.