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

Code insights settings: 2 rows with same RESOURCE ID in the table AO_2AD648_MERGE_CHECK causes a 500 page

XMLWordPrintable

      Issue Summary

      Duplicate key exception when adding two reports with the same RESOURCE ID in the AO_2AD648_MERGE_CHECK table.
      User clicked on add button twice, because of that two reports with different IDs, yet same RESOURCE IDs were generated. Because of that the code insights repository settings page is inaccessible.

      Steps to Reproduce

      1. Insert 2 rows with same RESOURCE ID in the table AO_2AD648_MERGE_CHECK. (We were unable to reproduce in the way user landed the issue.)

      Expected Results

      The second row should be blocked at the DB insert since the UI is not implemented to handle 2 entries with the same resource ID

      Actual Results

      The code insights repository settings page becomes inaccessible, throws a 500 error in the UI.

      The below exception is thrown in the atlassian-bitbucket.log file:

      2021-02-04 09:02:37,755 ERROR [http-nio-7990-exec-7] @1O6PJ3Yx542x71x0 hmxfdz 172.28.128.1 "GET /mvc/error500 HTTP/1.1" c.a.s.i.web.ErrorPageController There was an unhandled exception loading [/plugins/servlet/insights/projects/CODE/repos/insights]
      java.lang.IllegalStateException: Duplicate key {minProhibitedSeverity=LOW, reportKey=test, mustPass=true, scope={type=REPOSITORY, resourceId=1}}

      Workaround

      Remove either of the rows with duplicate value for the RESOURCE ID.

              dkjellin Daniel (Inactive)
              46ac2648bc84 Naveen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: