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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,557,770
Community Members
 
Community Events
184
Community Groups

Unable to start pipeline using atlassian/trigger-pipeline:5.1.0 OR REST API

Edited

I have 3 repos in single project: A, B and C.

When there are changes in A or B I need to build dockers from source code and then I want to deploy the code using docker-compose residing in C.

So:

running it manually works (commits to A or B are causing builds), manual running C afterwards works.

I figured out I will use trigger-pipeline:5.1.0 to trigger appropriate pipeline (branch dependent) in C which will deploy what I want where I want.

So my pipeline in A or B calling C is:

- step:
name: Deploy
script:
- pipe: atlassian/trigger-pipeline:5.1.0
variables:
BITBUCKET_ACCESS_TOKEN: ${REPO_C_TOKEN_AS_SECRET_VARIABLE}
REPOSITORY: 'C'
REF_NAME: ${BITBUCKET_BRANCH}

Obviously I want to run the same branch like the one that is calling here (develop to be specific). I am getting: 

Account, repository or branch doesn't exist. 

all the time.

I tried setting REF_NAME: to develop manually, no changes. Both my pipelines definitions have branches: develop

I tried setting TOKEN to: pipeline Read, pipeline Read, Write, repo Read, repo Read, Write.

Still nothing.

DEBUG: true does not provide any meaningful info. I have checked for typos and I can not see any

Status: Downloaded newer image for bitbucketpipelines/trigger-pipeline:5.1.0
DEBUG: Starting new HTTPS connection (1): bitbucket.org:443
DEBUG: https://bitbucket.org:443 "GET /bitbucketpipelines/official-pipes/raw/master/pipes.prod.json HTTP/1.1" 200 None
DEBUG: Starting new HTTPS connection (1): api.bitbucket.org:443
DEBUG: https://api.bitbucket.org:443 "POST /2.0/repositories/companyName/C/pipelines/ HTTP/1.1" 404 61
✖ Account, repository or branch doesn't exist.


Any ideas what am I missing?

 

2 answers

1 accepted

1 vote
Answer accepted

Problem solved. Almost, as I strongly believe this is a bug and should be either fixed to mentioned in the documentation.

 

The repo name HAS TO be lowercase. No matter what the real name is, in the REST API call and in the pipe it has to be lowercase.

So if your repo is: ThisIsMyCoolRepo you need to call

API call: https://api.bitbucket.org/2.0/repositories/espera-werke/thisismycoolrepo/pipelines'

in the pipe:

REPOSITORY: thisismycoolrepo

 

For other endpoints you can you whatever case (just like with any web address) but with pipelines it HAS TO be lowercase or it will fail.

Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Apr 14, 2023 • edited

Hi @Mariusz Dullak 

Thanks for your contributing to the community! Good catch!

We'll investigate the issue and notify you.

 

Additionally, depends of your configuration of the permissions on the account, workspace, project, try to add combination of: `account:read` and/or `workspace:read` and/or `project:read`.

 

Best regards,
Oleksandr Kyrdan

pipeline write is needed to start pipeline if I am not mistaken since you are going to create new pipeline instance.

I did not spent too much time drilling down to exact requirements.

Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Apr 14, 2023

yep, base required permissions are  `Pipelines:Write` and `Repositories:Read`

and
depends of your configuration of the permissions on the account, workspace, project, try to add combination of: `account:read` and/or `workspace:read` and/or `project:read`

So I created repo token with all the privileges and tried curl.

The reply is:

{
"type": "error",
"error": {
"message": "Resource not found"
}
}

It looks like pipeline endpoint does not return anything meaningful. I can curl commits, pull request, etc. but not pipelines. Why ?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events