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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Theodora,
Thank you very much, you are right, now it worked!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's great to hear, you are very welcome!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Theodora Boudale i am having similar issue where eventhough I put the correct name of the the repo I get Account, repository or branch doesn't exist. Which is not true. @Alexander Smirnoff where you able to accomplish what you are doing, I am trying to do the same thing and also got the bad requuest problem also.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.
Get Certified! ✍️Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.