Bitbucket version: 8.19.10
Control Freak Version: 2024.04.01
Unable to merge Pull request if Control Freak Version plugin is enabled.
We worked with Bitbucket vendor and found below.
reviewed the logs further and I think that you are affected by a merge-check operation. Basically, when you open the Pull request, it performs a merge check in the background with the anticipation that the PR will be merged:
2024-11-26 04:45:19,292 | https-jsse-nio-7070-exec-4 | *BMQNOCx283x24407519x7 | bvaradha | uquu5d
[122569.8ms] - "GET /rest/ui/latest/projects/VMCP/repos/vdes/pull-requests/588/merge HTTP/1.1"
[15.4ms] [count: 13, avg: 1.2ms] - String com.atlassian.stash.internal.plugin.PluginSettingDao.get(String,String)
[6.1ms] - InternalPullRequest com.atlassian.stash.internal.pull.PullRequestDao.findByRepositoryScopedId(int,long)
[122522.1ms] - PullRequestMergeability com.atlassian.bitbucket.pull.PullRequestService.canMerge(int,long)
[3.0ms] - InternalPullRequest com.atlassian.stash.internal.pull.PullRequestDao.findByRepositoryScopedId(int,long)
[122519.1ms] - PullRequestMergeability com.atlassian.stash.internal.pull.InternalMergeRequestCheckService.checkMergeability(InternalMergeRequest)
[122517.3ms] - RepositoryHookResult com.atlassian.bitbucket.hook.repository.RepositoryHookService.preUpdate(RepositoryHookRequest)
[1.5ms] - Set com.atlassian.bitbucket.dmz.settingsrestriction.DmzProjectSettingsRestrictionService.getAllUnsecured(Project,String,String)
[1.5ms] - Set com.atlassian.stash.internal.settingsrestriction.ProjectSettingsRestrictionDao.getAllByProjectNamespaceAndFeatureKey(Project,String,String)
[2.6ms] - List com.atlassian.stash.internal.repository.RepositoryHookDao.findByKeys(Collection,Collection,boolean)
[33.8ms] - ch.mibex.stash.sonar4stash:sonar4stash-merge-check#preUpdate
[10.7ms] - com.atlassian.bitbucket.server.bitbucket-branch:cascading-merge-open-downstream-pull-request-check#preUpdate
[1.3ms] - boolean com.atlassian.bitbucket.dmz.settingsrestriction.DmzProjectSettingsRestrictionService.hasRestrictionUnsecured(Project,SettingsKey)
[1.3ms] - boolean com.atlassian.stash.internal.settingsrestriction.ProjectSettingsRestrictionDao.hasRestrictions(Collection,SettingsKey)
[521.7ms] - com.atlassian.bitbucket.server.bitbucket-build:specificRequiredBuildMergeCheck#preUpdate
[425.3ms] - void com.atlassian.bitbucket.pull.PullRequestService.streamCommits(PullRequestCommitsRequest,CommitCallback)
[8.4ms] - InternalPullRequest com.atlassian.stash.internal.pull.PullRequestDao.findByRepositoryScopedId(int,long)
[416.9ms] - void com.atlassian.stash.internal.scm.git.mesh.RpcPullRequestClient.getCommits(PullRequest,Builder,CommitCallback)
[6.0ms] - Page com.atlassian.bitbucket.internal.build.status.dao.BuildStatusDao.findAll(List,PageRequest,BuildOrder)
[87.0ms] - DefaultBuildStatusService: Resolving 1 commits(17015)
[75.5ms] - void com.atlassian.stash.internal.scm.git.mesh.RpcCommitClient.getCommits(Repository,Builder,CommitCallback)
[11.3ms] - Iterable com.atlassian.bitbucket.dmz.commit.DmzCommitEnricher.enrichAll(Repository,Iterable,Collection)
[1.2ms] - Map com.atlassian.stash.internal.content.IndexedCommitDao.getProperties(Iterable,Iterable)
[5.8ms] - Map com.atlassian.stash.internal.user.InternalUserService.mapUsersByEmail(Set)
[2.1ms] - Map com.atlassian.stash.internal.comment.InternalCommentService.countCommentsByCommit(InternalRepository,Set)
[2.1ms] - Map com.atlassian.stash.internal.comment.CommentDao.countByCommit(int,Set)
[9.5ms] - com.atlassian.bitbucket.server.bitbucket-bundled-hooks:duplicate-pullrequests-merge-check#preUpdate
[8.7ms] - Page com.atlassian.bitbucket.pull.PullRequestService.search(PullRequestSearchRequest,PageRequest)
[8.7ms] - Page com.atlassian.stash.internal.pull.PullRequestDao.search(PullRequestSearchCriteria,PageRequest,Predicate)
[1.9ms] - com.atlassian.bitbucket.server.bitbucket-code-insights:code-insights-report-condition-check#preUpdate
[29.3ms] - com.atlassian.bitbucket.server.bitbucket-default-reviewers:required-reviewers-merge-check#preUpdate
[15.6ms] [count: 11, avg: 1.4ms] - ApplicationUser com.atlassian.bitbucket.user.UserService.getUserById(int,boolean)
[2.6ms] - com.atlassian.bitbucket.server.bitbucket-git-lfs:verify-lfs-locks-merge-check#preUpdate
[1.1ms] - com.atlassian.bitbucket.server.bitbucket-pull-request-cleanup:pending-retargeting-merge-check#preUpdate
[23.7ms] - com.atlassian.bitbucket.server.bitbucket-ref-restriction:restrictionEnforcerHook#preUpdate
[17.0ms] [count: 3, avg: 5.7ms] - Set com.atlassian.bitbucket.user.UserService.getUsersById(Set,boolean)
[120089.4ms] - com.bit-booster.bb.hooks:bbMergeCheck#preUpdate
[16.3ms] [count: 22, avg: 0.7ms] - String com.atlassian.stash.internal.plugin.PluginSettingDao.get(String,String)
[4.8ms] - Project com.atlassian.bitbucket.project.ProjectService.getByKey(String)
[4.8ms] - InternalProject com.atlassian.stash.internal.project.ProjectDao.getByKey(String)
[17.6ms] [count: 2, avg: 8.8ms] - Branch com.atlassian.bitbucket.repository.RefService.getDefaultBranch(Repository)
[17.6ms] [count: 2, avg: 8.8ms] - Branch com.atlassian.stash.internal.scm.git.mesh.RpcRefClient.resolveDefaultBranch(Repository,Builder)
[120008.3ms] - Object com.atlassian.stash.internal.scm.git.mesh.RpcPlumbingClient.call(Repository,Set,Builder,NioStdioHandler,CommandExitHandler)
[10.0ms] - com.isroot.stash.plugin.yacc:yaccHook#preUpdate
[6.1ms] [count: 5, avg: 1.2ms] - String com.atlassian.stash.internal.plugin.PluginSettingDao.get(String,String)
[1641.0ms] - com.onresolve.stash.groovy.groovyrunner:mandatoryReviewersMergeCheck#preUpdate
[118.1ms] - com.onresolve.stash.groovy.groovyrunner:script-receive-hook#preUpdate
[19.4ms] - com.onresolve.stash.groovy.groovyrunner:scriptedMergeCheck#preUpdate
[1.8ms] - InternalGitPullRequestCachedMerge com.atlassian.stash.internal.scm.git.pull.GitPullRequestCachedMergeDao.findByPullRequest(PullRequest)
[3.0ms] - boolean com.atlassian.bitbucket.pull.automerge.AutoMergeService.isSettingEnabledForPullRequest(PullRequest)
[3.0ms] - AutoMergeSettings com.atlassian.bitbucket.pull.automerge.AutoMergeSettingsService.getOrDefault(Scope)
[1.3ms] - boolean com.atlassian.bitbucket.settingsrestriction.ProjectSettingsRestrictionService.hasRestriction(Project,SettingsKey)
[1.3ms] - boolean com.atlassian.stash.internal.settingsrestriction.ProjectSettingsRestrictionDao.hasRestrictions(Collection,SettingsKey)
[1.6ms] - InternalAutoMergeSettings com.atlassian.stash.internal.pull.automerge.AutoMergeSettingsDao.findInheritedByScopes(Scope)
The log above shows the steps that the merge check took. As you can see, some steps highlighted below took too long to complete, hence the "server unreachable" error:
[122569.8ms] - "GET /rest/ui/latest/projects/VMCP/repos/vdes/pull-requests/588/merge HTTP/1.1"
[122519.1ms] - PullRequestMergeability com.atlassian.stash.internal.pull.InternalMergeRequestCheckService.checkMergeability(InternalMergeRequest)
[122517.3ms] - RepositoryHookResult com.atlassian.bitbucket.hook.repository.RepositoryHookService.preUpdate(RepositoryHookRequest)
[120089.4ms] - com.bit-booster.bb.hooks:bbMergeCheck#preUpdate
[120008.3ms] - Object com.atlassian.stash.internal.scm.git.mesh.RpcPlumbingClient.call(Repository,Set,Builder,NioStdioHandler,CommandExitHandler)
A further trace of request *BMQNOCx283x24407519x7 above shows that it times out for the control freak plugin:
2024-11-26 04:45:17,493 WARN [https-jsse-nio-7070-exec-4 url: /rest/ui/latest/projects/VMCP/repos/vdes/pull-requests/588/merge; user: bvaradha] bvaradha *BMQNOCx283x24407519x7 uquu5d 10.195.92.135,10.173.131.18 "GET /rest/ui/latest/projects/VMCP/repos/vdes/pull-requests/588/merge HTTP/1.1" com.bitbooster.hook.ControlFreakHook Control Freak v2024.04.01 - merge-check failed
com.bitbooster.hook.ControlFreakException: ControlFreakException GIT=[com.atlassian.stash.internal.scm.git.mesh.MeshGitFreeFormCommandBuilder$1@57ed062c] RAW=[] - com.atlassian.bitbucket.scm.CommandFailedException: 'git log --no-color --boundary --topo-order -p -c -333 --name-only --pretty=%x00BEGIN%x02%x03%x04commit %m %H %d%ntree %T%nparent %P%natime %at%nauthor %aN <%aE>%ncommitter %cN <%cE>%nHEADERS-END%n%B%n%x04%x03%x02END%x00%n c81d6178cdf0396039ecec6aeb1d7d75c076353c ^64e2b7ba5a4b811d3b359add22449be5c87cc073' exited with code 15
at com.bitbooster.hook.ControlFreakHook.validateChange(ControlFreakHook.java:1097)
<trimmed>
Suppressed: io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: [git log --no-color --boundary --topo-order -p -c -333 --name-only --pretty=%x00BEGIN%x02%x03%x04commit %m %H %d%ntree %T%nparent %P%natime %at%nauthor %aN <%aE>%ncommitter %cN <%cE>%nHEADERS-END%n%B%n%x04%x03%x02END%x00%n c81d6178cdf0396039ecec6aeb1d7d75c076353c ^64e2b7ba5a4b811d3b359add22449be5c87cc073 (15)] timed out
at io.grpc.Status.asRuntimeException(Status.java:537)
Despite this, Bitbucket successfully responded to this request after 2 minutes:
//request time (04:43:16,722)
atlassian-bitbucket-access.log:10.195.92.135,10.173.131.18 | https | i*BMQNOCx283x24407519x7 | - | 2024-11-26 04:43:16,722 | "GET /rest/ui/latest/projects/VMCP/repos/vdes/pull-requests/588/merge HTTP/1.1" | "https://stash.trusted.visa.com:7990/projects/VMCP/repos/vdes/pull-requests/588/overview" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" | - | - | - | - | - | uquu5d |
//response time (04:45:19,292)
atlassian-bitbucket-access.log:10.195.92.135,10.173.131.18 | https | o*BMQNOCx283x24407519x7 | bvaradha | 2024-11-26 04:45:19,292 | "GET /rest/ui/latest/projects/VMCP/repos/vdes/pull-requests/588/merge HTTP/1.1" | "https://stash.trusted.visa.com:7990/projects/VMCP/repos/vdes/pull-requests/588/overview" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" | 200 | 0 | 14376 | - | 122570 | uquu5d |
Next steps:
could you please temporarily disable the Control Freak plugin and test again while bypassing the proxy?
As per Atlassian suggestion, we tried to disable the Control Freak Plugin and after which we were able to successfully merge the pull request.
Error Image:
attached
</div> </form>