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

Terminates: 400: Invalid label name - invalidArgument #323

Closed DamianMehers closed 3 years ago

DamianMehers commented 3 years ago

Hi,

GYB is terminating with "400: Invalid label name - invalidArgument" (returns to the command line) about 26% of the way through a restore. I've restarted it but it continues to fail and stop at the same place.

This is my command line (version 1.50):

/Users/damian/bin/gyb/gyb --email example@gmail.com --action restore-mbox --local-folder "/Users/damian/Downloads/gyb" --debug > label-failure-output.txt

This is the tail of the debug log:

 reading message 69381... - 26.84%
Creating label Muted
send: b'POST /gmail/v1/users/me/labels?fields=id&prettyPrint=true&alt=json HTTP/1.1\r\nHost: gmail.googleapis.com\r\naccept: application/json\r\naccept-encoding: gzip, deflate\r\nuser-agent: Got Your Back 1.50 | https://git.io/gyb | Jay Lee - jay0lee@gmail.com | Python 3.9.4 64-bit final | google-api-client 2.2.0 | macOS-10.16-x86_64-i386-64bit x86_64 (gzip)\r\nx-goog-api-client: gdcl/2.2.0 gl-python/3.9.4\r\ncontent-type: application/json\r\ncontent-length: 86\r\nauthorization: Bearer xxx'
send: b'{"labelListVisibility": "labelShow", "messageListVisibility": "show", "name": "Muted"}'
reply: 'HTTP/1.1 400 Bad Request\r\n'
header: Vary: Origin
header: Vary: X-Origin
header: Vary: Referer
header: Content-Type: application/json; charset=UTF-8
header: Content-Encoding: gzip
header: Date: Sun, 15 Aug 2021 06:10:21 GMT
header: Server: ESF
header: Cache-Control: private
header: X-XSS-Protection: 0
header: X-Frame-Options: SAMEORIGIN
header: X-Content-Type-Options: nosniff
header: Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
header: Transfer-Encoding: chunked

Is there anything I can do? Should I try to edit the mbox file to remove the 'muted' label, assuming this is what is causing the issue. FWIW it would be good if GYB didn't attempt to re-recreate "known" GMAIL labels, specifically all the category ones.

DamianMehers commented 3 years ago

Whoops, I just found https://github.com/jay0lee/got-your-back/issues/316 which ironically was closed 4 days ago. Will try it and probably close this issue.