Why am I unable to post a build status into Bitbucket?

I am trying to configure Jenkins to post a build status to Bitbucket Server each time we run a build. When I make the API call from the REST API Browser in Bitbucket it is successful, however when I try to make the same request using CURL or Postman it fails with an HTTP 500 error and the message "An error occurred while processing the request. Check the server logs for more information."

Upon checking the Bitbucket server logs I find an unhandled exception being thrown.

 

Unhandled exception while processing REST request: "POST /rest/build-s
tatus/1.0/commits/3eb758e9aba629171beb6824e21c3cbfce9a2e91 HTTP/1.1"
java.lang.IllegalArgumentException: Expected authority at index 7: file://
at java.net.URI.create(URI.java:852) ~[na:1.8.0_65]

 

2016-07-20 10:49:17,449 ERROR [http-nio-7990-exec-1] kevinb @1G3XVVXx649x14514x0 pdbbzs 192.168.11.11 "POST /rest/build-status/1.0/commits/3eb758e9aba62917
1beb6824e21c3cbfce9a2e91 HTTP/1.1" c.a.s.i.r.e.DefaultUnhandledExceptionMapperHelper Unhandled exception while processing REST request: "POST /rest/build-s
tatus/1.0/commits/3eb758e9aba629171beb6824e21c3cbfce9a2e91 HTTP/1.1"
java.lang.IllegalArgumentException: Expected authority at index 7: file://
at java.net.URI.create(URI.java:852) ~[na:1.8.0_65]
at com.atlassian.applinks.cors.auth.DefaultCorsService.getApplicationLinksByOrigin(DefaultCorsService.java:56) ~[na:na]
at com.atlassian.applinks.cors.auth.AppLinksCorsDefaults.allowsOrigin(AppLinksCorsDefaults.java:42) ~[na:na]
at com.google.common.collect.Iterators.indexOf(Iterators.java:778) ~[guava-18.0.jar:na]
at com.google.common.collect.Iterators.any(Iterators.java:684) ~[guava-18.0.jar:na]
at com.google.common.collect.Iterables.any(Iterables.java:623) ~[guava-18.0.jar:na]
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.1_1448871876000.jar:na]
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.1_1448871876000.jar:na]
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.1_1448871876000.jar:na]
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.1_1448871876000.jar:na]
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.1_1448871876000.jar:na]
at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.onSuccess(StashAuthenticationFilter.java:220) [StashAuthenticationFilter.
class:na]

I haven't been able to find any useful information about what could be causing this problem. At first I assumed it was an issue with permissions but the user I am authenticating as is an administrator user, and I am able to authenticate properly when calling a GET on the same URL to retrieve the build status.

3 answers

0 vote
Jeff Thomas Atlassian Team Jul 20, 2016

Could you post the full cURL command you're running? 

Were you able to ever resolve this issue?

I have not been able to figure out why I am unable to post the same request from cURL or Postman and get the expected results, but the Jenkins plugin I am using seems to be making the request in a different way, because it is able to successfully post the statuses.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

2,034 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you