-
Bug
-
Resolution: Fixed
-
High
-
9.2.1, 9.2.3
-
None
-
2
-
Severity 2 - Major
-
2
-
Target repository is not supported for pull requests with error message "ERROR: duplicate key value violates unique constraint"
Excepts from Logs are shared below
023-07-18 15:18:01,524 INFO [12-PullRequestDetectionBackgroundThread:pool-16-thread-2] [BitbucketServerPullRequestDetector] Fetch list of Bitbucket Stash PRs [repositoryId: 315035426] 2023-07-18 15:18:01,523 WARN [12-PullRequestDetectionBackgroundThread:pool-16-thread-1] [PullRequestDetector$1] could not execute batch; SQL [insert into VCS_PULL_REQUEST (VCS_PULL_REQUEST_KEY, TARGET_REPOSITORY_ID, TARGET, SOURCE_REPOSITORY_ID, SOURCE, OPEN_STATUS, SOURCE_PARENT_IDENTIFIER, SOURCE_REPOSITORY_IDENTIFIER, CREATED_DATE, UPDATED_DATE, VCS_PULL_REQUEST_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [vcspullreq_keytargetrepo_idx]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute batch org.springframework.dao.DataIntegrityViolationException: could not execute batch; SQL [insert into VCS_PULL_REQUEST (VCS_PULL_REQUEST_KEY, TARGET_REPOSITORY_ID, TARGET, SOURCE_REPOSITORY_ID, SOURCE, OPEN_STATUS, SOURCE_PARENT_IDENTIFIER, SOURCE_REPOSITORY_IDENTIFIER, CREATED_DATE, UPDATED_DATE, VCS_PULL_REQUEST_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [vcspullreq_keytargetrepo_idx]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute batch Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into VCS_PULL_REQUEST (VCS_PULL_REQUEST_KEY, TARGET_REPOSITORY_ID, TARGET, SOURCE_REPOSITORY_ID, SOURCE, OPEN_STATUS, SOURCE_PARENT_IDENTIFIER, SOURCE_REPOSITORY_IDENTIFIER, CREATED_DATE, UPDATED_DATE, VCS_PULL_REQUEST_ID) values ('1638', 394450987, 'master', 394450987, 'fix-shooting-off-weight-zero-price-legs', 'TRUE', NULL, NULL, '2023-07-18 15:18:01.521+02', '2023-07-18 15:18:01.521+02', 626721856) was aborted: ERROR: duplicate key value violates unique constraint "vcspullreq_keytargetrepo_idx" Detail: Key (vcs_pull_request_key, target_repository_id)=(1638, 394450987) already exists. Call getNextException to see other errors in the batch.
This was first seen on an instance that was upgraded from Bamboo 7.2.11 to 8.0.13 , then finally to 9.2.3. These errors in the logs coincided with PRs not being picked up automatically.
[BAM-22425] Bitbucket Pull request fails to add entry to the table VCS_PULL_REQUEST after an upgrade from Bamboo 7.2.11 to Bamboo 9.2.3
Affects Version/s | Original: 8.2.9 [ 104671 ] |
Affects Version/s | New: 8.2.9 [ 104671 ] |
Resolution | New: Fixed [ 1 ] | |
Status | Original: Waiting for Release [ 12075 ] | New: Closed [ 6 ] |
Status | Original: In Review [ 10051 ] | New: Waiting for Release [ 12075 ] |
Description |
Original:
Target repository is not supported for pull requests with error message "ERROR: duplicate key value violates unique constraint"
Excepts from Logs are shared below {code:java} 023-07-18 15:18:01,524 INFO [12-PullRequestDetectionBackgroundThread:pool-16-thread-2] [BitbucketServerPullRequestDetector] Fetch list of Bitbucket Stash PRs [repositoryId: 315035426] 2023-07-18 15:18:01,523 WARN [12-PullRequestDetectionBackgroundThread:pool-16-thread-1] [PullRequestDetector$1] could not execute batch; SQL [insert into VCS_PULL_REQUEST (VCS_PULL_REQUEST_KEY, TARGET_REPOSITORY_ID, TARGET, SOURCE_REPOSITORY_ID, SOURCE, OPEN_STATUS, SOURCE_PARENT_IDENTIFIER, SOURCE_REPOSITORY_IDENTIFIER, CREATED_DATE, UPDATED_DATE, VCS_PULL_REQUEST_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [vcspullreq_keytargetrepo_idx]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute batch org.springframework.dao.DataIntegrityViolationException: could not execute batch; SQL [insert into VCS_PULL_REQUEST (VCS_PULL_REQUEST_KEY, TARGET_REPOSITORY_ID, TARGET, SOURCE_REPOSITORY_ID, SOURCE, OPEN_STATUS, SOURCE_PARENT_IDENTIFIER, SOURCE_REPOSITORY_IDENTIFIER, CREATED_DATE, UPDATED_DATE, VCS_PULL_REQUEST_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [vcspullreq_keytargetrepo_idx]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute batch Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into VCS_PULL_REQUEST (VCS_PULL_REQUEST_KEY, TARGET_REPOSITORY_ID, TARGET, SOURCE_REPOSITORY_ID, SOURCE, OPEN_STATUS, SOURCE_PARENT_IDENTIFIER, SOURCE_REPOSITORY_IDENTIFIER, CREATED_DATE, UPDATED_DATE, VCS_PULL_REQUEST_ID) values ('1638', 394450987, 'master', 394450987, 'fix-shooting-off-weight-zero-price-legs', 'TRUE', NULL, NULL, '2023-07-18 15:18:01.521+02', '2023-07-18 15:18:01.521+02', 626721856) was aborted: ERROR: duplicate key value violates unique constraint "vcspullreq_keytargetrepo_idx" Detail: Key (vcs_pull_request_key, target_repository_id)=(1638, 394450987) already exists. Call getNextException to see other errors in the batch. {code} Customer just upgraded from Bamboo 7.2.11 to 8.0.13 , then finally to 9.2.3. Complaints about PRs not being picked up automatically. |
New:
Target repository is not supported for pull requests with error message "ERROR: duplicate key value violates unique constraint"
Excepts from Logs are shared below {code:java} 023-07-18 15:18:01,524 INFO [12-PullRequestDetectionBackgroundThread:pool-16-thread-2] [BitbucketServerPullRequestDetector] Fetch list of Bitbucket Stash PRs [repositoryId: 315035426] 2023-07-18 15:18:01,523 WARN [12-PullRequestDetectionBackgroundThread:pool-16-thread-1] [PullRequestDetector$1] could not execute batch; SQL [insert into VCS_PULL_REQUEST (VCS_PULL_REQUEST_KEY, TARGET_REPOSITORY_ID, TARGET, SOURCE_REPOSITORY_ID, SOURCE, OPEN_STATUS, SOURCE_PARENT_IDENTIFIER, SOURCE_REPOSITORY_IDENTIFIER, CREATED_DATE, UPDATED_DATE, VCS_PULL_REQUEST_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [vcspullreq_keytargetrepo_idx]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute batch org.springframework.dao.DataIntegrityViolationException: could not execute batch; SQL [insert into VCS_PULL_REQUEST (VCS_PULL_REQUEST_KEY, TARGET_REPOSITORY_ID, TARGET, SOURCE_REPOSITORY_ID, SOURCE, OPEN_STATUS, SOURCE_PARENT_IDENTIFIER, SOURCE_REPOSITORY_IDENTIFIER, CREATED_DATE, UPDATED_DATE, VCS_PULL_REQUEST_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [vcspullreq_keytargetrepo_idx]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute batch Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into VCS_PULL_REQUEST (VCS_PULL_REQUEST_KEY, TARGET_REPOSITORY_ID, TARGET, SOURCE_REPOSITORY_ID, SOURCE, OPEN_STATUS, SOURCE_PARENT_IDENTIFIER, SOURCE_REPOSITORY_IDENTIFIER, CREATED_DATE, UPDATED_DATE, VCS_PULL_REQUEST_ID) values ('1638', 394450987, 'master', 394450987, 'fix-shooting-off-weight-zero-price-legs', 'TRUE', NULL, NULL, '2023-07-18 15:18:01.521+02', '2023-07-18 15:18:01.521+02', 626721856) was aborted: ERROR: duplicate key value violates unique constraint "vcspullreq_keytargetrepo_idx" Detail: Key (vcs_pull_request_key, target_repository_id)=(1638, 394450987) already exists. Call getNextException to see other errors in the batch. {code} This was first seen on an instance that was upgraded from Bamboo 7.2.11 to 8.0.13 , then finally to 9.2.3. These errors in the logs coincided with PRs not being picked up automatically. |
Remote Link | New: This issue links to "Page (Confluence)" [ 795480 ] |
UIS | New: 2 |
Support reference count | New: 2 |
Fix Version/s | Original: 9.3.2 [ 105532 ] | |
Fix Version/s | New: 9.3.3 [ 105918 ] |
Affects Version/s | New: 9.2.1 [ 104324 ] |