XaviTorello / mail2googlegroup

Import email to Google Groups. Migration tool (imap and mbox)
GNU Affero General Public License v3.0
31 stars 7 forks source link

mbox2gg does not proceed after approval #11

Closed siliconpi closed 1 year ago

siliconpi commented 1 year ago
  1. I'm trying to setup mbox2gg to work on my MBOX file located on a remote Ubuntu machine (shared account).
  2. I have a G Workspace exported MBOX file which I need to place in a MYGROUPID@googlegroups.com account (where I am the admin).
  3. Note that I am using MYGMAILID@gmail.com (NOT a Google Workspace account).
  4. First odd thing, going to the URL generated showed me the app name as GYB. I have that setup as well but was not able to use it. [See 1]
  5. After copy pasting the authentication code, the mbox2gg program didn't proceed at all, or throw any error code. [See 2]
  6. I cancelled and tried again and its not proceeding in any fashion.

1 2

siliconpi commented 1 year ago

Some weird things are happening!!

I left the terminal alone and I come back after a while to see this: ... Processing emails: 1%|▏ | 1581/126232 [04:34<5:40:16, 6.11it/s]

Okay, but the Google Group is completely empty! Where is the program placing the emails? They are not in my gmail.com either!

siliconpi commented 1 year ago

Sigh... its just dumping gigabytes of errors into errors.mbox and not actually processing anything.

No helpful error message anywhere. Just raw data of the email being saved there for some reason.

jayhendren commented 1 year ago

I'm seeing this same issue. errors.mbox contains every message in my mbox file and no errors, but my Google Group is empty. @siliconpi did your messages ever get uploaded to your Google Group? How did you fix/work around this issue?

jayhendren commented 1 year ago

Looks like the error message is thrown away when logging to the errors file - msg_string is the e-mail message and error is the caught exception:

https://github.com/XaviTorello/mail2googlegroup/blob/787f6272193da0361b5be56643167a53e1074d4d/mail2gg/__init__.py#L78-L79

I edited this file (i.e. ~/.local/lib/python3.10/site-packages/mail2gg/__init__.py) to log the exception and discovered that the issue in my case was a 401 Unauthorized error:

googleapiclient.errors.HttpError: <HttpError 401 when requesting https://groupsmigration.googleapis.com/upload/groups/v1/groups/redacted%40redacted.com/archive?alt=json&uploadType=media returned "Authorization Failed". Details: "[{'message': 'Authorization Failed', 'domain': 'global', 'reason': 'authError', 'location': 'Authorization', 'locationType': 'header'}]">