Skip to content

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

@arjunkc

Description

@arjunkc

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions