Invalid label name ?
pazz opened this issue · 15 comments
pazz commented
I see this during gmi sync
Traceback (most recent call last):
File "/home/pazz/projects/gmailieer/gmi", line 8, in <module>
g.main ()
File "/home/pazz/projects/gmailieer/lieer/gmailieer.py", line 143, in main
args.func (args)
File "/home/pazz/projects/gmailieer/lieer/gmailieer.py", line 193, in sync
self.push (args, True)
File "/home/pazz/projects/gmailieer/lieer/gmailieer.py", line 245, in push
actions.append (self.remote.update (rm, nm, self.local.state.last_historyId, self.force))
File "/home/pazz/projects/gmailieer/lieer/remote.py", line 109, in func_wrap
return func (self, *args, **kwargs)
File "/home/pazz/projects/gmailieer/lieer/remote.py", line 503, in update
return self.__push_tags__ (gid, add, rem)
File "/home/pazz/projects/gmailieer/lieer/remote.py", line 109, in func_wrap
return func (self, *args, **kwargs)
File "/home/pazz/projects/gmailieer/lieer/remote.py", line 519, in __push_tags__
(lid, ll) = self.__create_label__ (a)
File "/home/pazz/projects/gmailieer/lieer/remote.py", line 109, in func_wrap
return func (self, *args, **kwargs)
File "/home/pazz/projects/gmailieer/lieer/remote.py", line 630, in __create_label__
lr = self.service.users ().labels ().create (userId = self.account, body = label).execute ()
File "/usr/lib/python3/dist-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "/usr/lib/python3/dist-packages/googleapiclient/http.py", line 838, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://www.googleapis.com/gmail/v1/users/octo%40gmail.com/labels?alt=json returned "Invalid label name">
gauteh commented
Hi, seems like you have a tag that is not allowed by GMail - have you
identified which one?
Regards, Gaute
pazz commented
Not sure how to find out exactly but I believe that it is syncing the
"todo" label:
```
~/projects/gmailieer/gmi sync ✖ ✹ ✭master
receiving metadata: 100%|████████████████████████████████████████████████████████████████████████████████████| 62/62 [00:00<00:00, 91.53it/s]
resolving changes: 98%|██████████████████████████████████████████████████████████████████████████████████▋ | 61/62 [00:00<00:00, 601.68it/s]push: creating label: todo..
TRACE HERE
```
gauteh commented
Patrick Totzke writes on november 20, 2017 18:25:
Not sure how to find out exactly but I believe that it is syncing the
"todo" label:
```
~/projects/gmailieer/gmi sync ✖ ✹ ✭master
receiving metadata: 100%|████████████████████████████████████████████████████████████████████████████████████| 62/62 [00:00<00:00, 91.53it/s]
resolving changes: 98%|██████████████████████████████████████████████████████████████████████████████████▋ | 61/62 [00:00<00:00, 601.68it/s]push: creating label: todo..
TRACE HERE
```
Right, seems like `todo` is a reserved label by GMail and cannot be
created. Same for `mute` or `muted`. I've added the label to the list of
ignored tags, please try #53.
Label is not listed here: https://developers.google.com/gmail/api/guides/labels
pazz commented
That solves my problem, yes.
Unfortunately, blacklisting this tag also completely undermines the
necessity of syncing gmail and notmuch tags for me..
Anyways, syncing is nice and fast on my test account *thumbsup*
gauteh commented
Patrick Totzke writes on november 20, 2017 18:38:
That solves my problem, yes.
Unfortunately, blacklisting this tag also completely undermines the
necessity of syncing gmail and notmuch tags for me..
That's too bad. I don't see a way around this at the moment, doesn't
seem to be any other API for marking a message as todo.
Anyways, syncing is nice and fast on my test account *thumbsup*
Thanks
pazz commented
Quoting Gaute Hope (2017-11-20 17:46:22)
Patrick Totzke writes on november 20, 2017 18:38:
> That solves my problem, yes.
> Unfortunately, blacklisting this tag also completely undermines the
> necessity of syncing gmail and notmuch tags for me..
That's too bad. I don't see a way around this at the moment, doesn't
seem to be any other API for marking a message as todo.
Not your fault of course. BTW: I did not spot the "todo" label among the
gmail blacklisted ones in their docs. But I might have overlooked it.
gauteh commented
Patrick Totzke writes on november 20, 2017 18:50:
Quoting Gaute Hope (2017-11-20 17:46:22)
> Patrick Totzke writes on november 20, 2017 18:38:
> > That solves my problem, yes.
> > Unfortunately, blacklisting this tag also completely undermines the
> > necessity of syncing gmail and notmuch tags for me..
>
> That's too bad. I don't see a way around this at the moment, doesn't
> seem to be any other API for marking a message as todo.
Not your fault of course. BTW: I did not spot the "todo" label among the
gmail blacklisted ones in their docs. But I might have overlooked it.
No, it's not listed, along with a bunch of other undocumented
restrictions. See "caveats" in the README.
willfurnass commented
I've encountered the same issue with Trash
:
$ gmi sync
receiving metadata: 100%
resolving changes: 0%
push: creating label: Trash..
Traceback (most recent call last):
File "/home/will/.venvs/gmailieer/bin/gmi", line 8, in <module>
g.main ()
File "/home/will/.venvs/gmailieer/lib/python3.6/site-packages/lieer/gmailieer.py", line 143, in main
args.func (args)
File "/home/will/.venvs/gmailieer/lib/python3.6/site-packages/lieer/gmailieer.py", line 193, in sync
self.push (args, True)
File "/home/will/.venvs/gmailieer/lib/python3.6/site-packages/lieer/gmailieer.py", line 245, in push
actions.append (self.remote.update (rm, nm, self.local.state.last_historyId, self.force))
File "/home/will/.venvs/gmailieer/lib/python3.6/site-packages/lieer/remote.py", line 110, in func_wrap
return func (self, *args, **kwargs)
File "/home/will/.venvs/gmailieer/lib/python3.6/site-packages/lieer/remote.py", line 510, in update
return self.__push_tags__ (gid, add, rem)
File "/home/will/.venvs/gmailieer/lib/python3.6/site-packages/lieer/remote.py", line 110, in func_wrap
return func (self, *args, **kwargs)
File "/home/will/.venvs/gmailieer/lib/python3.6/site-packages/lieer/remote.py", line 526, in __push_tags__
(lid, ll) = self.__create_label__ (a)
File "/home/will/.venvs/gmailieer/lib/python3.6/site-packages/lieer/remote.py", line 110, in func_wrap
return func (self, *args, **kwargs)
File "/home/will/.venvs/gmailieer/lib/python3.6/site-packages/lieer/remote.py", line 643, in __create_label__
lr = self.service.users ().labels ().create (userId = self.account, body = label).execute ()
File "/home/will/.venvs/gmailieer/lib/python3.6/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "/home/will/.venvs/gmailieer/lib/python3.6/site-packages/googleapiclient/http.py", line 844, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://www.googleapis.com/gmail/v1/users/myusername%40gmail.com/labels?alt=json returned "Invalid label name">
gauteh commented
Will Furnass writes on januar 30, 2018 20:39:
I've encountered the same issue with `Trash`:
I will add 'Trash' to ignored tags. If you use 'trash' (lowercase) it
will be translated to the TRASH label and should be applied accordingly.
yangsheng6810 commented
I've encountered the same issue with tag arxiv
$ gmi sync
receiving metadata: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 18432/18432 [03:21<00:00, 91.70it/s]
resolving changes: 0%| | 0/18432 [00:00<?, ?it/s]
update: remote has changed, will not update: 1695892c2ae41025 (add: [], rem: ['UNREAD']) (5256563 > 5256244)
push: creating label: arxiv..
Traceback (most recent call last):
File "/usr/bin/gmi", line 8, in <module>
g.main ()
File "/usr/lib/python3.7/site-packages/lieer/gmailieer.py", line 155, in main
args.func (args)
File "/usr/lib/python3.7/site-packages/lieer/gmailieer.py", line 221, in sync
self.push (args, True)
File "/usr/lib/python3.7/site-packages/lieer/gmailieer.py", line 274, in push
actions.append (self.remote.update (rm, nm, self.local.state.last_historyId, self.force))
File "/usr/lib/python3.7/site-packages/lieer/remote.py", line 116, in func_wrap
return func (self, *args, **kwargs)
File "/usr/lib/python3.7/site-packages/lieer/remote.py", line 536, in update
return self.__push_tags__ (gid, add, rem)
File "/usr/lib/python3.7/site-packages/lieer/remote.py", line 116, in func_wrap
return func (self, *args, **kwargs)
File "/usr/lib/python3.7/site-packages/lieer/remote.py", line 552, in __push_tags__
(lid, ll) = self.__create_label__ (a)
File "/usr/lib/python3.7/site-packages/lieer/remote.py", line 116, in func_wrap
return func (self, *args, **kwargs)
File "/usr/lib/python3.7/site-packages/lieer/remote.py", line 669, in __create_label__
lr = self.service.users ().labels ().create (userId = self.account, body = label).execute ()
File "/usr/lib/python3.7/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
return wrapped(*args, **kwargs)
File "/usr/lib/python3.7/site-packages/googleapiclient/http.py", line 851, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://www.googleapis.com/gmail/v1/users/myusername%40gmail.com/labels?alt=json returned "Invalid label name">
gauteh commented
Weird, I was able to add the label in the web gui. Would you mind trying there as well? Or re-trying from gmi?
yangsheng6810 commented
It is weird. I am able to add the label in the web ui, and then assign tag arxiv
in notmuch. Syncing, pushing, verything is fine. However, if there is no label arxiv
gmail in the first place, and I assign this tag in notmuch, running gmi sync
will cause problem.
arjunkc commented
I have had the same problem with the arxiv label.
gauteh commented
It is maybe a localized variation of archive? It can be added to the
ignored labels list in remote.py. it means it is not possible to
synchronize it.
tir. 28. jul. 2020, 16:00 skrev Arjun <notifications@github.com>:
… I have had the same problem with the arxiv label.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#52 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAN36YG22KF35AWEZDLJF3R53KZJANCNFSM4EER3SZQ>
.