Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Why receive 400 Bad request for executing custom pipeline API

This is what I execute:

curl -X POST -i -u '<username>:<password>' -H 'Content-Type: application/json' https://api.bitbucket.org/2.0/repositories/<workspace>/<slug>/pipelines/ -d '
{
"target": {
"type": "pipeline_ref_target",
"ref_type": "branch",
"ref_name": "master",
"selector": {
"type": "custom",
"pattern": "increment-build-version"
}
}
}'

This is what I receive:

{"error": {"message": "Bad request", "detail": "bitbucket-pipelines.yml not found.", "data": {"key": "result-service.pipeline.yml-not-found", "arguments": {}}}}

But, I have a bitbucket-pipelines.yml file and custom pipelines defined like so:

pipelines:
custom:
new-start-testflight:
- step:
name: New Test Flight
image: atlassian/default-image:2
script:
- ./prepTestFlight.sh

increment-build-number:
- step:
name: Increment Build Version
image: atlassian/default-image:2
script:
- git remote set-url origin ${BITBUCKET_GIT_SSH_ORIGIN}
- ./incrementBuildVersion.sh

2 answers

A little bit late, but in my case, the error was caused due to the custom pipeline didn't exist in the specified branch.

See this other thread for reference https://community.atlassian.com/t5/Bitbucket-questions/Pipeline-trigger-run-fails/qaq-p/2024388

0 votes
ktomk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Sep 07, 2020

The error message is not specifically meaning that the bitbucket-pipelines.yml file would not be there, it does also mean that the pipeline selected is not in that file (at refs/heads/master on the Bitbucket remote).

The pipeline "custom/increment-build-version" according to the yaml you posted can not be found.

I'd assume a misnomer and the pipeline is "custom/increment-build-number" instead (version -> number).

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events