Migration Wizard

Looking to migrate to ZCS? Ask here. Got a great tip or script that helped you migrate? Post it here.
Post Reply
shanmarsh28
Posts: 14
Joined: Tue Dec 12, 2017 8:14 pm

Migration Wizard

Post by shanmarsh28 »

Hi Guys, I hope you can help.

I am writing this as a last resort after spending an entire afternoon trying to find a solution - I find nothing!

Basically, I followed these instructions to migrate a domains accounts from a generic IMAP Server to Zimbra: https://wiki.zimbra.com/wiki/Migrate_fr ... 0.x_or_8.x

The first time I tried to import everything looked great! The only issue (not related to Zimbra), I was given three incorrect passwords so out of the six mailboxes three succeeded and three failed. Fair enough I thought!

I found the three accounts that had failed, I repeated the process with the three accounts but Zimbra would not let me run the import again. The error I got was:

Code: Select all

at com.zimbra.bp.BulkProvisionException.EMPTY_IMPORT_QUEUE(BulkProvisionException.java:94)
So naturally I tried to delete the completed job. I was then presented with this error:

Code: Select all

2017-12-12 14:08:42,584 WARN  [qtp1068934215-35877:https:https://mydomain.net:7071/service/admin/soap/PurgeBulkIMAPImportTa$
com.zimbra.common.service.ServiceException: system failure: unable to delete data source: 48cd26fc-e869-49c1-8ccd-57487eb12102
ExceptionId:qtp1068934215-35877:https:https://mydomain.net:7071/service/admin/soap/PurgeBulkIMAPImportTasksRequest:15130877$
Code:service.FAILURE
        at com.zimbra.common.service.ServiceException.FAILURE(ServiceException.java:286)
I then attempted the XML import again and was presented with:

Code: Select all

at com.zimbra.bp.BulkProvisionException.EMPTY_IMPORT_QUEUE(BulkProvisionException.java:94)
AND so on!!!

The only way I could break out of this loop was to DELETE the three affected mailboxes and re-create them. THEN I was able to import successfully HOWEVER I got some strange thing happen ..

The Import wizard ran but instead of saying a total of 6 imports, it now had a total of 9!!

9 total
3 succeeded
0 failed.

Then it just hung (stayed on processing) until several hours later I when I eventually deleted the task and received the service exception error mentioned above.

Soo my question is this ...

What the hell is going on? Do I have to get everything absolutely spot on first time when importing accounts? It seems you get one shot deal then your dead!

Is there a way to purge the system after a failed import so that it can be re-run?

Your help is greatly appreciated as I could find nothing to help me with this anywhere!

Shane

------------------
Version: 8.7.11_GA_1854_FOSS OSE
Ubuntu 16.4 LTS
shanmarsh28
Posts: 14
Joined: Tue Dec 12, 2017 8:14 pm

Re: Migration Wizard

Post by shanmarsh28 »

Anyone? Surely someone knows whats going on?
OdairTrujillo
Posts: 1
Joined: Thu Oct 01, 2020 2:46 am

Re: Migration Wizard

Post by OdairTrujillo »

I have the same problem.

The issue is related with this function in `zimbra-mirror/ZimbraAdminExt/BulkProvision/java/com/zimbra/bp/BulkIMAPImportTaskManager.java`:

Code: Select all

    
    /**
     * TODO: abort running imports. Currently if we delete a task from the queue active data import continues to run
     * @param taskQueue
     * @throws ServiceException
     */
    private static void cleanTaskQueue ( Queue<HashMap<taskKeys, String>> taskQueue) throws ServiceException {
        synchronized(taskQueue) {
            if(!taskQueue.isEmpty()) {
                Iterator<HashMap<taskKeys, String>> iter = taskQueue.iterator();
                while(iter.hasNext()) {
                    HashMap<taskKeys, String> task = iter.next();
                    String accountID = task.get(taskKeys.accountID);
                    String dataSourceID = task.get(taskKeys.dataSourceID);
                    if (accountID == null) {
                        ZimbraLog.extensions.error("Error while cleaning IMAP import task queue.", BulkProvisionException.EMPTY_ACCOUNT_ID());
                        continue;
                    }
                    if (dataSourceID == null) {
                        ZimbraLog.extensions.error("Error while cleaning IMAP import task queue.", BulkProvisionException.EMPTY_DATASOURCE_ID());
                        continue;
                    }   
                    Account acct = Provisioning.getInstance().getAccountById(accountID);
                    try {
                        DataSourceManager.deleteManaged(accountID, dataSourceID);
                        Provisioning.getInstance().deleteDataSource(acct, dataSourceID);
                    } catch (AccountServiceException ex) {
                        if(!AccountServiceException.NO_SUCH_DATA_SOURCE.equalsIgnoreCase(ex.getCode())) {
                            ZimbraLog.extensions.error("Error while cleaning IMAP import task queue.", ex);
                        }
                    }
                    iter.remove();
                }
            }
        } 
    }
    
Note that there is a TODO comment saying that even if the task is deleted in a running import task, the task will still running. But in my case the task is finished, so the problem could be that the finished task it's in an empty state and it's causing the exception.

We need some help from the devs. Is there any workaround that allows us to rid of the finished task? maybe touching some database table.
Post Reply