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

Kevin Barbour July 20, 2016

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 votes
Kevin Barbour September 8, 2016

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.

0 votes
Peter September 8, 2016

Were you able to ever resolve this issue?

0 votes
Jeff Thomas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 20, 2016

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events