Uploaded image for project: 'Mender'
  1. Mender
  2. MEN-4040

[useradm] users.email unique index name mismatch

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Days in progress:
      5

      Description

      Useradm ensures the unique index on email on user creation:
      https://github.com/mendersoftware/useradm/blob/master/store/mongo/datastore_mongo.go#L138

      The problem is that the old mongodb driver used "uniqueEmail" as index name, while the new driver uses email_1. This mismatch makes it impossible to create users in old tenants. One of our customers hit this issue in production. Tenants created after the 16th of March, 2020 have the email_1. Creating users on tenants older than that date fails, as of today.

      Acceptance criteria:

      • Remove the EnsureIndexes
      • Create a migration which drops the unique index on email, and recreates it with a deterministic name

        Attachments

          Activity

            People

            • Assignee:
              kjaskiewicz Krzysztof Jaƛkiewicz
              Reporter:
              tranchitella Fabio Tranchitella
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel