Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-8388

Can't delete project access key after upgrade from Stash to Bitbucket Server

    XMLWordPrintable

Details

    Description

      Summary

      When the customer upgrades from the Stash ver2.10.0 to Bitbucket Server ver4.3.0, the old added access key at project and repository levels are not allowed to be deleted by the admin and thrown following error:

      This access key no longer exists or you no longer have administrative rights to delete it.
      

      The access key still still exist/visible at both project/repository settings and in the database as well.

      Steps to Reproduce

      1. Begin with Stash ver2.10.0 with external database(MySQL).
      2. Added a LDAP (users and group) into User directory.
      3. Given the LDAP group access to the project.
      4. Create and add an users key access to project/repository
      5. Upgrade to Bitbucket Server ver4.3.0 (or higher - see Affected Versions)
      6. Use an System admin account to delete the access key.

      Expected Result

      Allow the System admin to delete the access key

      Actual Result

      When the System Admin tried to delete the access key, the System admin was thrown error message This access key no longer exists or you no longer have administrative rights to delete it. and the key not able to delete from the UI.

      Workaround

      If you have already upgraded an instance after Bitbucket Server 3.9, you can do a quick fix by removing the key from the database:

      Always back up your data before performing any modifications to the database. If possible, test any insert, update, or delete SQL commands on a staging server first.

      1. Backup your instance using Bitbukcet Server backup client guide
      2. Stop Bitbucket Server
      3. Execute the following SQL query, where <user_email@mail.com> is the label of the key you cannot remove from the user interface:
        DELETE FROM AO_FB71B4_SSH_PUBLIC_KEY WHERE LABEL = '<user_email@mail.com>';

            4. Restart Bitbucket Server

      Alternatively, if you have not upgraded yet from Bitbucket Server 3.9 and below, you can upgrade to Bitbucket Server 4.12 directly because the bug in BSERV-9380 had been fixed thus, the labels will be correctly set and the problem wouldn't appear to begin with.

      Attachments

        1. after.sql
          224 kB
        2. before.sql
          168 kB
        3. screenshot-1.png
          screenshot-1.png
          15 kB
        4. Screenshot from database table.png
          Screenshot from database table.png
          138 kB
        5. Screenshot from Error message.png
          Screenshot from Error message.png
          70 kB

        Issue Links

          Activity

            People

              jpalacios Juan Palacios (Inactive)
              bannamalai Baskar Annamalai (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: