failuer when updating database from 8.6.81.0.78 to 8.6.81.0.102

Hello!

After latest update, the kopano-sever doesn’t start anymore.

I am getting the following error message:

Sun Aug 19 21:58:19 2018: [=======] Starting kopano-server version 8.6.81 (pid 17776 uid 0)
Sun Aug 19 21:58:20 2018: [error  ] SQL [00000208] Failed: Doppelter Eintrag '\x86\x03\x02\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00F-x-' für Schlüssel 'gns', Query Size: 46, Query: "ALTER TABLE `names` CONVERT TO CHARSET utf8mb4"
Sun Aug 19 21:58:20 2018: [error  ] KDatabase::I_Update() query failed: "Doppelter Eintrag '\x86\x03\x02\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00F-x-' für Schlüssel 'gns'", query: ALTER TABLE `names` CONVERT TO CHARSET utf8mb4
Sun Aug 19 21:58:20 2018: [error  ] Can't update the database: Unable to upgrade database from version 8.6.81.0.78 to 8.6.81.0.102
Sun Aug 19 21:58:20 2018: [=======] Server shutdown complete.

I have now idea, how to resolve the double entry in the database.
Any idea, what I can do?

Thank you
Vogi

Look in table “names” with something like phpMyAdmin
Are there really two records with the same key “gns” ?
If the records are exactly the same then it should be possible to delete one of them.
WARNING: this is the theory, never done by me

I already had a look - but I am not familiar with mysql, so I am not sure what is supposed to be double.

I found “gns” only once (see screenshot)
the doúble entry seems to be related to the guid (0x860…) but there are hundrets entries with same guid - so I am afraid that just deleting would make it worse…
1_1534750016362_phpmyadmin.PNG 0_1534750016362_phpmyadmin2.PNG

@tjoen
Thanks for the hint.
I found the same google link and already ran

kopano-dbadm k-1216

This worked without failure. But afterwards the same error comes again.
So it seems, that this is a different issue

gns is a strange index: it is composed of guid and namestring
Does select guid from names gives unique values? or are there double entries.
If there are then you can do select namestring guid from names where guid is that-double-value
(edited modified select namestring to select guid)

Can you provide the mysqldump of the names table and send it to development @ kopano.io (or a service ticket) please.

mysqldump kopano names | xz >bla.xz

I sent you the requested dump.
Thanks for your help!

I wonder if my guess is right: there are two guids with the same value.
Solution would be to make guid unique index. Obsoleting gns and gni. Much simpler

The GUIDs are not meant to be unique, not in this case anyway.

gns is meant to be unique. With two same namestrings with same GUIDs there is a problem. Same with gni

believed to be fixed with kopanocore-8.6.81-158-g352e88092

Yes… I was able to start the kopano-server without any manual changes to the database
Thank you!