Cms2xp failing when exporting user store

Enonic version: 4.7
OS: Ubuntu

cms2xp fails with message “Export failed” and “Multiple entries with same key”.

Stacktrace:

[main] INFO com.enonic.cms2xp.hibernate.UserStoreRetriever - User store loaded: default
[main] INFO com.enonic.cms2xp.hibernate.UserStoreRetriever - User store loaded: medlemmer
[main] ERROR com.enonic.cms2xp.migrate.ExportData - Export failed.
java.lang.IllegalArgumentException: Multiple entries with same key: user:medlemmer:“username”=com.enonic.xp.security.User@d7d8efd1 and user:medlemmer:“username”=com.enonic.xp.security.User@8bd7ab9b
at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:150)
at com.google.common.collect.RegularImmutableMap.checkNoConflictInBucket(RegularImmutableMap.java:104)
at com.google.common.collect.RegularImmutableMap.(RegularImmutableMap.java:70)
at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:254)
at com.google.common.collect.Maps.uniqueIndex(Maps.java:1166)
at com.google.common.collect.Maps.uniqueIndex(Maps.java:1140)
at com.enonic.xp.security.Principals.(Principals.java:21)
at com.enonic.xp.security.Principals.from(Principals.java:77)
at com.enonic.cms2xp.export.UserStoreExporter.export(UserStoreExporter.java:125)
at com.enonic.cms2xp.migrate.ExportData.exportUserStores(ExportData.java:378)
at com.enonic.cms2xp.migrate.ExportData.execute(ExportData.java:133)
at com.enonic.cms2xp.Main.main(Main.java:62)

Any ideas?

(User name replaced with “username” in stacktrace above.)

Looks like somehow it has found 2 users with the same name and user store, in the database. Which shouldn’t be allowed :confused:
Are those 2 “username” with the same case?
Is there maybe one lower case and one upper case when you look at the user in the CMS?

Anyway it should be handled so that the export can continue. We will fix it and tag a new cms2xp version.

When I search for the user in CMS it only shows up one user.

Will be looking out for the new version. Thanks!

There is a new cms2xp tag available that should fix this issue.

You can download it and build from sources from Github or just download the zip distribution from Enonic repo.

Please let us know if it works.

Great! Thanks a lot!