Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid label name ? #52

Closed
pazz opened this issue Nov 20, 2017 · 13 comments
Labels

Comments

@pazz
Copy link

@pazz pazz commented Nov 20, 2017

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

This comment has been minimized.

Copy link
Owner

@gauteh gauteh commented Nov 20, 2017

@pazz

This comment has been minimized.

Copy link
Author

@pazz pazz commented Nov 20, 2017

@gauteh

This comment has been minimized.

Copy link
Owner

@gauteh gauteh commented Nov 20, 2017

@pazz

This comment has been minimized.

Copy link
Author

@pazz pazz commented Nov 20, 2017

@gauteh

This comment has been minimized.

Copy link
Owner

@gauteh gauteh commented Nov 20, 2017

@gauteh

This comment has been minimized.

Copy link
Owner

@gauteh gauteh commented Nov 20, 2017

Fixed in #53

@gauteh gauteh closed this Nov 20, 2017
@pazz

This comment has been minimized.

Copy link
Author

@pazz pazz commented Nov 20, 2017

@gauteh

This comment has been minimized.

Copy link
Owner

@gauteh gauteh commented Nov 20, 2017

@gauteh gauteh added the gmail-api label Dec 2, 2017
@willfurnass

This comment has been minimized.

Copy link

@willfurnass willfurnass commented Jan 30, 2018

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

This comment has been minimized.

Copy link
Owner

@gauteh gauteh commented Jan 30, 2018

@yangsheng6810

This comment has been minimized.

Copy link

@yangsheng6810 yangsheng6810 commented Mar 7, 2019

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

This comment has been minimized.

Copy link
Owner

@gauteh gauteh commented Mar 9, 2019

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

This comment has been minimized.

Copy link

@yangsheng6810 yangsheng6810 commented Mar 9, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.