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.56k stars 203 forks source link

KeyError: 'labels' results in [73196] Failed to execute script 'gyb' due to unhandled exception! #435

Open larsstempfle opened 10 months ago

larsstempfle commented 10 months ago

running normal gam call (gyb --email email@example.com --action restore --local-folder GYB-GMail-Backup-email@example.com/ --service-account results in the following output:

Traceback (most recent call last): File "gyb.py", line 2767, in File "gyb.py", line 2258, in main File "gyb.py", line 1632, in labelsToLabelIds KeyError: 'labels' [73196] Failed to execute script 'gyb' due to unhandled exception!

Same thing happenes with mbox restoration. I am running Got Your Back 1.74

I tried to comment the line out but to no avail.

bradbomb commented 10 months ago

I have the same error with three different versions 1.62, 1.72, 17.4. I'm on macOS Ventura and trying to restore using service account

LinU777 commented 10 months ago

Same error, tried versions 1.74, 1.70, 1.60

polyevolver54 commented 8 months ago

Seeing the same issue

polyevolver54 commented 8 months ago

I can add that it went away on a subsequent run a couple days later. I haven't done anything to test this theory, but in my case the restore is happening milliseconds after the destination user is created with a gam command, and the user is still in part being provisioned inside google.

probably need to test and wait for label creation to work with the new user before running the restore which as one step recreates all the labels in the archive.

perhaps there could be more detailed error messaging/handling in gyb, but i can work around if i'm correct

Celestica-Edward commented 4 months ago

Also affected with GYB 1.80.


C:\GYB_PROD>gyb --version
Got Your Back 1.80
jaylee.us/gyb
Jay Lee - jay0lee@gmail.com
Python 3.12.1 64-bit final
google-api-client 2.114.0
Windows-2016Server-10.0.14393-SP0 AMD64
Path: C:\GYB_PROD
ConfigPath: C:\GYB_PROD
OpenSSL 3.2.0 23 Nov 2023
gmail.googleapis.com connects using TLSv1.3 TLS_AES_256_GCM_SHA384

C:\GYB_PROD>gyb --service-account --email target@xxxxx.com --action restore-mbox --local-folder E:\downloads\source@xxxxx.com

Restoring from 25.86gb file E:\downloads\source@xxxxx.com\All mail Including Spam and Trash-003.mbox...
Traceback (most recent call last):
  File "gyb.py", line 2817, in <module>
  File "gyb.py", line 2486, in main
  File "gyb.py", line 1633, in labelsToLabelIds
KeyError: 'labels'
[5472] Failed to execute script 'gyb' due to unhandled exception!