Open andrewandante opened 5 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello, This error is still there and doesn't seems to have been fixed yet. The error seems to appears for some branches only, and could effectively come from the length of the branch name/description.
[Bitbucket] Notifying commit build result
ERROR: Could not send notifications
com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 400: .
HttpResponseProxy{HTTP/1.1 400 [Server: nginx, Date: Wed, 24 Nov 2021 13:52:46 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @3YQ3S5x892x105860x0, X-AUSERID: 18919, X-AUSERNAME: wam_jenkins, Cache-Control: no-cache, no-transform, Vary: x-ausername,x-auserid,cookie,accept-encoding, X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@118ac94e}
at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.doRequest(BitbucketServerAPIClient.java:1095)
at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1048)
at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1036)
at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postBuildStatus(BitbucketServerAPIClient.java:511)
at com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:50)
at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createStatus(BitbucketBuildStatusNotifications.java:161)
at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:203)
at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$100(BitbucketBuildStatusNotifications.java:59)
at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCompletedListener.onCompleted(BitbucketBuildStatusNotifications.java:285)
at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:208)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:625)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$800(WorkflowRun.java:138)
at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1045)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1473)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:491)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Issue still exists. Occured on
[x] Jenkins 2.387.3
[x] Bitbucket Server v8.10.0
[x] Bitbucket Branch Source Plugin 804.v8b_0642650b_d2
Is there any documentation on how long strings the Bitbucket API allows? Alternatively, can someone test it?
I would not assume that Cloud and Server have the same limits.
I did some tests. On Bitbucket Server Pull Request titles are limited to 256 characters. I was able to create Pull Request with titles of up to 234 characters without Notification errors in Jenkins. In the range between 234 and 256 characters the api errors start to appear.
It seems odd to me that the whole PR title must be transferred via API when notifying Bitbucket PR from Jenkins. Bitbucket already knows the title of the PR. Repo ID and PR ID should be sufficient, right?
Your checklist for this issue
[x] Jenkins version 2.150.2
[x] Plugin version 2.4.1
[X] Bitbucket cloud
Description
A few of our builds are throwing the following error on completion:
But not all of them. They are all linked with a particular PR, where the branch name is long (73 chars) and the branch description is even longer (243 chars) - so I suspect this is the issue. However, it would be good if this was truncated before being sent to the BitBucket API, as we have merge checks enabled and can't proceed without build successes.
I'm not sure what the actual limit is, can't find any docs from Atlassian, but I did find this at https://docs.atlassian.com/bitbucket-server/rest/6.3.0/bitbucket-build-rest.html:
~Which doesn't quite add up to what I was saying above, but I wonder if there's some prefixing/suffixing going on or something.~
It does add up when you add the prefix
<pipeline name> » <pull request id>