Problem

While migrating from Google, you’re getting the following error: “An error occured during UNKNOW 0 0 reading: Failed to connect to server: Unable to connect Google Apps client: Invalid credentials”  or “Unable to connect Google Apps client: [AUTHENTICATIONFAILED] Invalid credentials (Failure)”.
There are multiple possible causes:

Cause 1

The account doesn’t exist at Google anymore, is disabled, or the user must change the password at next logon.

Resolution

Activate the account or ask the user to log into Google.

Cause 2

MaaS uses IMAP to migrate the mails.
IMAP might be disabled.

Resolution

There are two places where IMAP can be enabled/disabled.

1. In Admin Console -> Google Apps ->Settings for GMail -> User Settings, verify that Disable POP and IMAP access for all users is not checked.

Pop Imap

2. IMAP can also be disabled in each user profile:
Log in Gmail with the user credentials, Click on Settings.
In Forwarding and POP/IMAP, verify that Status IMAP is Enabled.
If IMAP is disabled, enable it.

Imap Profile

You might not want every user to have to enable IMAP on their profile.
Fortunately, the command line GAM can enable IMAP for all users: gam all users imap on

Cause 3

We have seen a rare circumstance where SSL was disabled.

Resolution

Re-enable SSL: Admin Console -> Security -> Basic Settings
Enable SSL

Cause 4

The service account doesn’t have permissions to the feeds.

Resolution

Add the following feed: https://mail.google.com