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

Trouble with tag names when pushing new tags from local to remote #171

Closed
arjunkc opened this issue Jul 28, 2020 · 3 comments
Closed

Trouble with tag names when pushing new tags from local to remote #171

arjunkc opened this issue Jul 28, 2020 · 3 comments

Comments

@arjunkc
Copy link
Contributor

arjunkc commented Jul 28, 2020

I am trying to sync my gmail repository from local to remote for the first time, and it is creating a bunch of new labels. They keep failing with

push: creating label: arxiv..
Traceback (most recent call last):
  File "/usr/local/bin/gmi", line 24, in <module>
    g.main ()
  File "/usr/local/lib/python3.7/site-packages/lieer/gmailieer.py", line 206, in main
    args.func (args)
  File "/usr/local/lib/python3.7/site-packages/lieer/gmailieer.py", line 338, in push
    actions.append (self.remote.update (rm, nm, self.local.state.last_historyId, self.force))
  File "/usr/local/lib/python3.7/site-packages/lieer/remote.py", line 133, in func_wrap
    return func (self, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/lieer/remote.py", line 557, in update
    return self.__push_tags__ (gid, add, rem)
  File "/usr/local/lib/python3.7/site-packages/lieer/remote.py", line 133, in func_wrap
    return func (self, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/lieer/remote.py", line 573, in __push_tags__
    (lid, ll) = self.__create_label__ (a)
  File "/usr/local/lib/python3.7/site-packages/lieer/remote.py", line 133, in func_wrap
    return func (self, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/lieer/remote.py", line 690, in __create_label__
    lr = self.service.users ().labels ().create (userId = self.account, body = label).execute ()
  File "/usr/local/lib/python3.7/site-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/googleapiclient/http.py", line 907, in execute
    raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://www.googleapis.com/gmail/v1/users/name%40gmail.com/labels?alt=json returned "Invalid label name">

Since I have about 100000 emails in this repository, I have to try and fix label names and retry. Then it tries to download all the metadata all over again. The first time I run gmi push takes forever, as expected, since I keep getting rate limited. But then after the crashes, I have to start all over again.

I am considering setting --ignore-labels-local=[all labels that do not exist in gmail] to save me some trouble. Does that make sense?

@gauteh
Copy link
Owner

gauteh commented Jul 28, 2020 via email

@arjunkc
Copy link
Contributor Author

arjunkc commented Jul 29, 2020

A subsequent gmi push -f succeeded, thanks for your help. It was just the arxiv tag. I guess I should try to add it to the documentation.

@arjunkc arjunkc closed this as completed Jul 29, 2020
@gauteh
Copy link
Owner

gauteh commented Jul 29, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants