[SOLVED] Upgrade to 3.0.2. from 2.2: could not create unique index "idx_users_email_unique"

We try to upgrade to 3.0.2 from 2.2 without luck:

[...]
    [2016/05/21 15:15:15 CEST] [INFO] Upgraded 11 users
    [2016/05/21 15:15:15 CEST] [INFO] Altering other scheme changes needed 3.0 for user model changes
    [2016/05/21 15:15:15 CEST] [CRIT] Failed to create index pq: could not create unique index "idx_users_email_unique"
    panic: Failed to create index pq: could not create unique index "idx_users_email_unique"

    goroutine 1 [running]:
    panic(0xb68f00, 0xc8204dc610)
            /usr/local/go/src/runtime/panic.go:481 +0x3e6
    github.com/mattermost/platform/store.SqlStore.createIndexIfNotExists(0xc820479b60, 0xc820023138, 0x1, 0x1, 0x7fd024bedbe8, 0xc820023168, 0x0, 0x0, 0x0, 0x0, ...)
            /var/lib/jenkins/jobs/mattermost-platform-release/workspace/src/github.com/mattermost/platform/store/sql_store.go:511 +0x6df
    github.com/mattermost/platform/store.SqlStore.CreateUniqueIndexIfNotExists(0xc820479b60, 0xc820023138, 0x1, 0x1, 0x7fd024bedbe8, 0xc820023168, 0x0, 0x0, 0x0, 0x0, ...)
            /var/lib/jenkins/jobs/mattermost-platform-release/workspace/src/github.com/mattermost/platform/store/sql_store.go:475 +0xba
    main.cmdUpdateDb30()
            /var/lib/jenkins/jobs/mattermost-platform-release/workspace/src/github.com/mattermost/platform/mattermost.go:438 +0x200f
    main.main()
            /var/lib/jenkins/jobs/mattermost-platform-release/workspace/src/github.com/mattermost/platform/mattermost.go:95 +0x962

Postgres user for mattermost has all rights since first installation.

Any ideas?

We made some deeper investigations and found out that there were a few duplicate email addresses in the database. Deleted them and the database upgrade went through.