com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • This is essentially the same issue as JENKINS-32781, occurs when using the latest version of the plugin built off master (testing out new build status notifications). Bitbucket requires the key to be <= 40 characters but it looks like right now the job name is being used which for my case with pipelines would be the branch name which is typically fairly long because we're using auto generated branch names from Jira (uses jira number + title). Also, I'm not sure what the desired uniqueness is here but in JENKINS-32781 the key is the project name + build number so each build can have a unique status e.g. built once and tests were flakey and it failed but then built again and it passed - depends if you want the build status to record both runs or just the latest one. The diff from JENKINS-32781 for reference - https://github.com/jenkinsci/bitbucket-build-status-notifier-plugin/commit/d73ec91ad424e4f885a7961579a55ccf1299d5e2 Callstack for reference on failed builds (created a long branch name to test this): {code} [Bitbucket] Notifying commit build result com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 400: BAD REQUEST. {"error": {"fields": {"key": ["Ensure this value has at most 40 characters (it has 119)."]}, "message": "Bad request"}} at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.postRequest(BitbucketCloudApiClient.java:486) at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.postRequest(BitbucketCloudApiClient.java:513) at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.postBuildStatus(BitbucketCloudApiClient.java:303) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:49) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createBuildCommitStatus(BitbucketBuildStatusNotifications.java:85) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:171) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$000(BitbucketBuildStatusNotifications.java:60) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCheckOutListener.onCheckout(BitbucketBuildStatusNotifications.java:190) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:123) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:85) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:207) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Finished: FAILURE {code}
    via by Ryan Rupp,
  • When user send pull request {code:java} [Bitbucket] Notifying commit build result com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 400: BAD REQUEST. {"error": {"fields": {"key": ["Ensure this value has at most 40 characters (it has 54)."]}, "message": "Bad request"}} at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.postRequest(BitbucketCloudApiClient.java:486) at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.postRequest(BitbucketCloudApiClient.java:513) at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.postBuildStatus(BitbucketCloudApiClient.java:303) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:49) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createBuildCommitStatus(BitbucketBuildStatusNotifications.java:85) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:171) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$000(BitbucketBuildStatusNotifications.java:60) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCheckOutListener.onCheckout(BitbucketBuildStatusNotifications.java:190) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:123) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:85) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:206) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:404) Finished: FAILURE {code} PR link: [https://bitbucket.org/XVM/xvm/pull-requests/288/battlelabels-descripton-typo/] Full Log: [http://ci.modxvm.com/job/XVM/job/demon2597%252Fbattlelabels-descripton-typo-1469180738999/1/console]
    via by Mikhail Paulyshka,
  • [JIRA] (JENKINS-38664) bitbucket source plugin fails with bad URL
    via by james....@gmail.com (JIRA),
    • com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 400: BAD REQUEST.<br>{"error": {"fields": {"key": ["Ensure this value has at most 40 characters (it has 119)."]}, "message": "Bad request"}} at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.postRequest(BitbucketCloudApiClient.java:486) at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.postRequest(BitbucketCloudApiClient.java:513) at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.postBuildStatus(BitbucketCloudApiClient.java:303) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:49) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createBuildCommitStatus(BitbucketBuildStatusNotifications.java:85) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:171) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$000(BitbucketBuildStatusNotifications.java:60) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCheckOutListener.onCheckout(BitbucketBuildStatusNotifications.java:190) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:123) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:85) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:207) at hudson.model.ResourceController.execute(ResourceController.java:98)
    No Bugmate found.