Suddenly can't sync due to "Invalid label name" but no idea which label might be causing the problem
I've been using lieer for a few years now and it's generally been great (thank you), but recently I've been unable to sync due to the following error message:
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://gmail.googleapis.com/gmail/v1/users/REDACTED/labels?alt=json returned "Invalid label name". Details: "[{'message': 'Invalid label name', 'domain': 'global', 'reaso
n': 'invalidArgument'}]">
I've checked my notmuch tags using notmuch search --output=tags '*' but nothing looks amiss to me. How can I find which tag is being choked on?
try running again the sync, pull, or posh, with -v, then -vv and check all 1 to 3 lines exactly before the error, it can be that you have a tag/label that cannot be pushed to gmail
Okay, I might have had the same problem. I tried using --logging_level without any luck, but when I did a gmi sync --dry-run I got to see the tags. In my case it's pretty obvious that it's the '\x1b' tag that's causing trouble.
❯ gmi sync --dry-run dry-run: True receiving metadata: 100%|>████████████████████████████████████████████████████| 7/7 [00:00<00:00, 101.68it/s] resolving changes: 0%| | 0/7 [00:00<?, ?it/s] (dry-run) gid: 19476c75411b0f5a: add: ['\x1b'], remove: [] (dry-run) gid: 193f8e3be3387617: add: [], remove: ['INBOX'] (dry-run) gid: 193f801307f449fa: add: [], remove: ['INBOX']
I could then search for the tag and remove it.
❯ notmuch dump | grep '1b ' +%1b +inbox +sent -- id:202501180.....
Hope this helps you.
(\x1b is ascii control code 'escape', so I guess there is an input in either neomutt or alot that accepted me pressing ESC as a tag)
Thanks for the suggestion - I have had that one before but have eventually discovered the cause of this problem; it was apparently a completely empty tag!
gid: 190540c2b50e110c: add: [''], remove: ['INBOX']
push: creating label: ..