[Solved] External restore error: cannot be cast to java.lang.String
Results 1 to 8 of 8

Thread: [Solved] External restore error: cannot be cast to java.lang.String

  1. #1
    Active Member ZeXtras Reseller
    Join Date
    Feb 2012
    Posts
    8

    [Solved] External restore error: cannot be cast to java.lang.String

    Hey guys,

    getting an error when performing an external restore (zxmig and zxsuite 1.2.4):

    - exception -
    java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.lang.String
    at com.zextras.backup.ZEBackupServer.restorePostAccou nt(ZEBackupServer.java:635)
    at com.zextras.backup.ZEExternalRestoreOperation.doOp eration(ZEExternalRestoreOperation.java:447)
    at com.zextras.op.ZEOperation.exec(ZEOperation.java:5 84)
    at com.zextras.backup.ZEBackupThread.execOperation(ZE BackupThread.java:200)
    at com.zextras.backup.ZEBackupThread.run(ZEBackupThre ad.java:110)

    This happens right when the "common items" restore starts. The accounts/domains/COS/attributes are all created fine.

    The zimbra logs don't give any more info.
    From what I've googled it looks like an array-> string conversion failure or something like this.
    How can I figure out which account/element is causing this so that I can exclude it? Or better how can I fix it?

    Cheers
    Nico
    Last edited by kral; 03-23-2012 at 04:55 PM. Reason: Solved

  2. #2
    ZeXtras Developer ZeroZeroOne ZeXtras Reseller
    Participant

    Join Date
    Jun 2011
    Posts
    23
    Hi Nico,

    I'm kral, one of the ZeXtras developer.

    It seems like there was a problem in one of your exported domains. One of those domains may have more than one zimbraGalAccountId value set and this is a case we haven't handled yet.
    Could you please post the output of the following command?
    Code:
    zmprov gd example.com zimbraGalAccountId
    (use your domains instead example.com, of course)

    If one of your domain has two or more values, you can unset the wrong value with
    Code:
    zmprov md example.com -zimbraGalAccountId "wrong-id-value"
    Anyway, we are looking for a way to manage this case, thank you for reporting the problem.

  3. #3
    Active Member ZeXtras Reseller
    Join Date
    Feb 2012
    Posts
    8
    Hi Kral,

    thanks for the reply.
    That may very well be the case. I remember getting an error about galsync accounts when I logged in yesterday.
    However, the server died on me (disk, yeah just one of them...) after I exported the accounts last night, and it's hosted so I prob won't be able to do any more work on it.
    Is there any way to fix this manually in one of the exported files?

    Cheers

  4. #4
    ZeXtras Developer ZeroZeroOne ZeXtras Reseller
    Participant

    Join Date
    Jun 2011
    Posts
    23
    Hi,

    the only solution I can provide at the moment is to modify the backup file by hand.
    You should have a file under /opt/zimbra/backup/zextras/server/ that starts with backup_*, you have to search trough the file looking for a tag named "zimbraGalAccountId".
    Could you please post the value you find?

  5. #5
    Active Member ZeXtras Reseller
    Join Date
    Feb 2012
    Posts
    8
    That sounds perfectly acceptable
    ok, so there are 2 domains in this export, both with the same problem apprently:

    "zimbraGalAccountId":["e88e05d1-9d26-434a-b277-0884dd3757c3","891a6403-d32f-43d4-9412-13783768c843"]
    "zimbraGalAccountId":["842b2f36-7e06-4cc0-ae50-ebe10e6747b1","e88e05d1-9d26-434a-b277-0884dd3757c3"]

    The ID in bold can't be found in zextras/account, so I guess that's the one I should remove?

    "zimbraGalAccountId":"891a6403-d32f-43d4-9412-13783768c843"
    "zimbraGalAccountId":"842b2f36-7e06-4cc0-ae50-ebe10e6747b1"

  6. #6
    ZeXtras Developer ZeroZeroOne ZeXtras Reseller
    Participant

    Join Date
    Jun 2011
    Posts
    23
    Exactly!

    You should rewrite that piece of the backup file from:
    Code:
    "zimbraGalAccountId":["e88e05d1-9d26-434a-b277-0884dd3757c3","891a6403-d32f-43d4-9412-13783768c843"]
    to
    Code:
    "zimbraGalAccountId":"891a6403-d32f-43d4-9412-13783768c843"
    et voilą, le jeux sont fait!
    (just make a little backup of your backup before )

  7. #7
    Active Member ZeXtras Reseller
    Join Date
    Feb 2012
    Posts
    8
    Works like a charm now!

    Thanks for your help Kral.

  8. #8
    ZeXtras Developer ZeroZeroOne ZeXtras Reseller
    Participant

    Join Date
    Jun 2011
    Posts
    23
    You're welcome!
    Closing the thread as solved.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •