Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

2nd gen linked bitbucket cloud repository returning same branch multiple times

Hello, I set up a connection towards my Bitbucket cloud workspace.

2 tokens: admin + read as requested.

When I select a pattern, the result matches 5 times the same branch (yes, the branch is unique)

antsam_0-1740567736364.png

Might it be some config issue?

Here the full response from the console where all the branches are listed more than once

antsam_0-1740585612607.png

 

 

0 2 63
2 REPLIES 2

Hi @antsam,

Welcome to Google Cloud Community!

It appears the same branch is being listed multiple times in your Bitbucket Cloud workspace. This could be due to a configuration issue on how Bitbucket Cloud API lists branch references. You may try these steps to resolve your issue:

  • Verify that your tokens have the appropriate access levels for the actions you are trying to perform.
  • Try updating your branch filter to a stricter pattern, e.g., qua/(0\.0)?$, to ensure only the intended branch is matched.
  • Try to run the following command to verify duplicate branches in the API response: 
    curl -u username:app_password "https://api.bitbucket.org/2.0/repositories/{workspace}/{repo}/refs/branches"
  • If you are using Google Cloud Platform (GCP) services to fetch and process the Bitbucket data, review your service configuration to ensure that requests are being made only once and that pagination is handled properly. Misconfiguration in how requests are processed can result in redundant API calls or results being returned multiple times.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

No, it must be something on Google.

First I tried with the API call and I get 5 results, which are all the branches that exist in the repository.

antsam_1-1740762218255.png

Second I tried with the specific regex

antsam_0-1740762124333.png

I also tried with a different repository link, same issue. I can try with more limited permissions (e.g. exclude PRs)