Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bitbucket API bug: links returned from pipeline trigger will 404

I think this is a bug with the Bitbucket API.

I triggered a pipeline build with a curl like:

curl \
-X POST \
-s \
--fail-with-body \
--user blah:blah \
-H 'Content-Type: application/json' \
https://api.bitbucket.org/2.0/repositories/blah/some-project/pipelines/ \
-d '{...}'

...and it triggered fine. The response includes this fragment:

"links": {
"self": {
"href": "https://bitbucket-pipelines.prod.public.atl-paas.net//rest/1.0/accounts/zzzz897f-cf32-4b66-825f-5123a9665fab}/repositories/zzzzf159-d03c-4508-a9cb-fa5a922e7e07}/pipelines/zzzz4283-b506-43eb-a8b5-376806f99be6}"
},
"steps": {
"href": "https://bitbucket-pipelines.prod.public.atl-paas.net//rest/1.0/accounts/zzzz897f-cf32-4b66-825f-5123a9665fab}/repositories/zzzzf159-d03c-4508-a9cb-fa5a922e7e07}/pipelines/zzzz4283-b506-43eb-a8b5-376806f99be6}/steps"
}
}

...but when I tried to GET either of those URLs, I get a 404. When I remove the double slash at the end of the hostname (`paas.net//rest`), then I get a better response. I actually get a 401, but that probably is something I'm doing wrong.

The point is that the server probably has a trailing slash configured on the prefix that is prepended to the rest of the URL that's returned to the caller.

1 answer

1 vote

Hi Tom,

This is indeed a bug, the urls that are returned are internal urls and cannot be used to retrieve the pipeline or the steps.

We have a bug report about this in our issue tracker:

https://jira.atlassian.com/browse/BCLOUD-21062

The way to work around this at the moment would be to manually assemble the url instead of using the ones in the response

https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}
https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

⭐ Calling all Bitbucket and DevOps experts: Special showcase opportunity ⭐

Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...

1,497 views 4 8
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you