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

Error when using the trigger pipeline

Henrique de Sousa Barbase December 8, 2020

I'm having the error below when triggering my trigger pipeline, remembering that I've already set the application password and I'm using my username, not my email, if anyone can help me I will be grateful.

 

 

Error received: Account, repository or branch doesn't exist

2 answers

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 9, 2020

Hi Henrique,

I believe that you are referring to the 'Bitbucket trigger pipeline' pipe?

My suggestion is to check these 3 things:

1. Have you used the variable ACCOUNT in the definition of the pipe?

If the repo you want to trigger the pipeline for, is owned by a different workspace than the repo where you use the pipe atlassian/trigger-pipeline, you will need to specify the workspace-id in this variable. Otherwise, if both repos are owned by the same workspace, it is not necessary to use this variable.

2. Double check the name in the variable REPOSITORY.

If the repo name has capital letters, e.g. 'My_Repo', then you'll need to define the REPOSITORY variable using capital letters respectively.

Defining REPOSITORY: 'my_repo' will give an error if the repo is named 'My_Repo'. You will need to use REPOSITORY: 'My_Repo'

3. If you have used the variable BRANCH_NAME in the definition, double check that the branch exists in the repo you want to trigger the pipeline for, and that it has a bitbucket-pipelines.yml file.

Please feel free to let me know how it goes.

Kind regards,
Theodora

Henrique de Sousa Barbase December 9, 2020

Good afternoon @Theodora Boudale ,

Thanks for the help, I'll try to explain better, my team has a web project that is in one repository, and I created some automated tests in another repository, the idea is that when there is a commit in the web project, the tests are automatically triggered in another repository.

 

follows link with images of the pipeline:

https://docs.google.com/document/d/1GvICnNFgIZ3f-1u2xI9cv0wsGzMCoHzBLpUeJYkJoxQ/edit?usp=sharing

 

Thank you very much!

 

Att,

Henrique

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 11, 2020

Hi Henrique,

Thank you for the info! Looking at the configuration in the screenshot, I believe the issue is caused by the value in the variable REPOSITORY.

The value for this variable should be the repo name, instead of the URL.

If you want to trigger a pipeline in the repo e.g. https://bitbucket.org/my-company/company-repo/, then you can configure the pipe in the web project repository as follows:

pipelines:
  default:
    - step:
        script:
          - pipe: atlassian/trigger-pipeline:4.2.1
            variables:
              BITBUCKET_USERNAME: $BITBUCKET_USERNAME
              BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
              REPOSITORY: 'company-repo'
              ACCOUNT: 'my-company'

Could you give this a try and let me know if it works for you?

Kind regards,
Theodora

Henrique de Sousa Barbase December 11, 2020

Hi Theodora,

Thank you very much, you are right, now it worked! 

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 11, 2020

That's great to hear, you are very welcome!

0 votes
Alexander Smirnoff May 12, 2023

Hi all,

Sorry for bringing up the old topic. 

I'm actually curious, whether it is possible or not to trigger a custom pipeline from the same repository from the branches pipe?

I'm getting the following

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/*********/pipeline-trigger-test/pipelines/ HTTP/1.1" 404 193
✖ Account, repository or branch doesn't exist.

The path /2.0/repositories/*********/pipeline-trigger-test/pipelines/ contains correct account and repository name

for the following solution:

definitions:
pipe: &pipe
pipe: atlassian/trigger-pipeline:5.1.0
variables:
BITBUCKET_ACCESS_TOKEN: AT.....C0
REPOSITORY: $BITBUCKET_REPO_SLUG
BRANCH_NAME: $BITBUCKET_BRANCH
CUSTOM_PIPELINE_NAME: 'deploy-infra'
PIPELINE_VARIABLES: >
[{
"key": "environment",
"value": "$ENVIRONMENT"
},
{
"key": "account_name",
"value": "$ACCOUNT_NAME"
}]
WAIT: 'true'
DEBUG: 'true'

pipelines:
custom:
deploy-infra:
- variables:
- name: environment
allowed-values:
- dev
- stage
- prod
- name: account_name

- stage:
name: Build and test
steps:
- step:
name: Run unit tests
script:
- sh ./run-tests.sh $environment $account_name
artifacts:
- set_env.sh
- step:
name: Build app
script:
- sh ./build-app.sh

branches:
dev:
- parallel:
- step:
services:
- docker
script:
- export ENVIRONMENT=dev
- export ACCOUNT_NAME=tenant1
- *pipe
Alexander Smirnoff May 13, 2023

So, I'm answering by myself.

That was a unexpected surprise when I tried to run the custom pipeline manually. The UI immediately shown me the error that the variable with list of allowed values MUST contain default value. BUT, the error in the pipeline was "Account, repository or branch doesn't exist". Meantime, the response body contains another error message {"error": {"message": "Bad request", "detail": "Unexpected response body", "data": {"key": "unexpected.response.body", "arguments": {}}}} 

Dear bitbucket engineers, are you serious? 

 

//cc @Theodora Boudale 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events