-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Low
-
None
-
Affects Version/s: 8.0.0, 9.0.0, 9.4.0, 10.0.0, 10.2.0
-
Component/s: Mesh, Pull Request - Merge
-
None
-
1
-
Severity 3 - Minor
-
1
Issue Summary
Bitbucket's pull request mergeability check can fail when Mesh returns a large merge-conflict response in a single gRPC message.
When a PR produces a very large conflict report, Bitbucket cannot receive the Mesh response and cannot classify the PR as clean or conflicted.
This causes the UI to show: "Bitbucket could not check this pull request for conflicts."
Bitbucket application logs show a runtime exception while calling the PR mergeability endpoint:
2026-07-31 19:37:55,315 INFO [http-nio-7990-exec-7 url: /rest/ui/latest/projects/[PROJECT_1]/repos/[REPO_1]/pull-requests/1/merge; user: [USER_1]] [USER_1] *10GVKNOx1177x70389x3 xof40y [IP_1] "GET /rest/ui/latest/projects/[PROJECT_1]/repos/[REPO_1]/pull-requests/1/merge HTTP/1.1" c.a.s.i.s.g.m.MeshPullRequestRefHelper [PROJECT_1]/[REPO_1][REPO_ID_1]: Pull request 1@0 failed automatic merging io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED:gRPC message exceeds maximum size 5242880: 10159579 ...
The default Bitbucket Mesh gRPC inbound message limit is 5,242,880 bytes, but the serialized conflict response in the sample was 10,159,579 bytes.
Steps to Reproduce
- Create two branches with a large number of conflicting changes between them.
The key condition is not commit count by itself, but a trial merge that produces a very large conflict report. - Open a pull request from the source branch to the target branch.
- View the pull request in Bitbucket.
- Bitbucket calls the PR mergeability endpoint: GET /rest/ui/latest/projects/<project>/repos/<repo>/pull-requests/<id>/merge
- Mesh sidecar performs the trial merge and returns conflict metadata.
- If the serialized conflict response exceeds the configured gRPC inbound message limit, Bitbucket logs the exception :
RESOURCE_EXHAUSTED: gRPC message exceeds maximum size 5242880: <actual_size>
- The PR UI shows: "Bitbucket could not check this pull request for conflicts."
Expected Results
Chunk large Mesh PR conflict responses to avoid exceeding gRPC max message size.
Actual Results
The below exception is thrown in the atlassian-bitbucket.log file:
2026-07-31 19:37:55,315 INFO [http-nio-7990-exec-7 url: /rest/ui/latest/projects/[PROJECT_1]/repos/[REPO_1]/pull-requests/1/merge; user: [USER_1]] [USER_1] *10GVKNOx1177x70389x3 xof40y [IP_1] "GET /rest/ui/latest/projects/[PROJECT_1]/repos/[REPO_1]/pull-requests/1/merge HTTP/1.1" c.a.s.i.s.g.m.MeshPullRequestRefHelper [PROJECT_1]/[REPO_1][REPO_ID_1]: Pull request 1@0 failed automatic merging io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED:gRPC message exceeds maximum size 5242880: 10159579 at io.grpc.Status.asRuntimeException(Status.java:532) at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:564) at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) at com.atlassian.stash.internal.scm.git.mesh.LastSeenClientInterceptor$LastSeenClientListener.onClose(LastSeenClientInterceptor.java:40) at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) at com.atlassian.stash.internal.scm.git.mesh.StatefulClientCallListener.onClose(StatefulClientCallListener.java:34) at com.atlassian.stash.internal.scm.git.mesh.ErrorHandlingClientInterceptor$ErrorHandlingCall$1.onClose(ErrorHandlingClientInterceptor.java:149) at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:564) at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:72) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:729) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:710) at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) ... 1 frame trimmed
Workaround
- Check out the PR source branch locally on a client machine, merge the target branch into it, and resolve the conflicts
- Commit the conflict resolutions and push the updated source branch back to Bitbucket.
- Refresh the PR and retry the merge once Bitbucket can complete the mergeability check.