youngmon/atlassian-qna huggingface dataset:
Bitbucket pipeline for dbt failed - pointing to issue within the Python env
Asked by Alyssa Zhang:

We have a dbt project run from Bitbucket pipeline failed. The builds were successful earlier but started failing this morning. There was no changes in the code.

Error message :  
TypeError: MessageToJson() got an unexpected keyword argument 'including_default_value_fields'  
Checked Python dependency conflict or corrupted env pointing by the error message and didn't find out anything.

![Screenshot 2024-03-14 145913.png](/t5/image/serverpage/image-id/312007iE4E10AE2498FD449/image-size/large?v=v2&px=999 "Screenshot 2024-03-14 145913.png")


Answers:
author: Theodora Boudale
body: Hi Alyssa and welcome to the community!

You can check the following knowledge base article, specifically **Scenario 1: Builds were successful earlier, but started failing recently**

* <https://confluence.atlassian.com/bbkb/troubleshooting-bitbucket-pipelines-1141505226.html>

The article includes possible causes and steps you can follow to troubleshoot a pipeline that used to be successful but started failing recently.

Please feel free to reach out if you have any questions.

Kind regards,  
Theodora


author: Daniel Laroue
body: I encountered this same issue. It was resolved by upgrading dbt_core to 1.7.10. See similar issue in dbt-core repo:

<https://github.com/dbt-labs/dbt-core/issues/9759>


Tags: bitbucket-cloud

cloud
GC Request
Asked by Dick Lague:

Hi Team,

Can I request GC for the \*\*\*launch/tripletel repo?

I used BFG to remove large files and rewrite index history in order to reduce the repository size. However, under the Bitbucket repository detail, the repo size increased instead of decreased.

Thank you.


Answers:
author: Syahrul
body: G'day, [@Dick Lague](/t5/user/viewprofilepage/user-id/5452083)

Welcome to the community!

I have triggered Git GC on the affected repository, now reduced to 238 MB. Please review them and let me know if this is the expected size.

Regards,  
Syahrul

comments: author: Dick Lague
body: Hi [@Syahrul](/t5/user/viewprofilepage/user-id/744536)

Thank you so much. However, I was expected to have repository size close to 18 MB as it was now the size of the repository after we create a new clone.

Here is the result of the following commands:

$ git count-objects -vH

count: 0  
size: 0 bytes  
in-pack: 6950  
packs: 1  
size-pack: 16.74 MiB  
prune-packable: 0  
garbage: 0  
size-garbage: 0 bytes

$ du -hs .git

18M .git

$ git bundle create tmp.bundle --all

$ du -hs tmp.bundle

17M tmp.bundle

I was following instruction on this page <https://rtyley.github.io/bfg-repo-cleaner/#usage>


author: Syahrul
body: Hi [@Dick Lague](/t5/user/viewprofilepage/user-id/5452083)

Based on my observation, your repository retains some pull request history, including large files you deleted. This is due to a feature that preserves PRs to enhance their performance. Certain PRs in the repository retain the deleted files, increasing the repository size.

There are a couple of ways to handle this. One approach is disregarding the size since the actual repository size will be reflected when you clone the repository.

Alternatively, you can [import the repository](https://support.atlassian.com/bitbucket-cloud/docs/import-a-repository/) to a new one and archive the current one. This method will not carry over the preserved PRs, reducing the size.

Please let me know which option you'd like to pursue or if you have any further questions.

Regards,  
Syahrul


Tags: bitbucket-cloud

cloud
Cannot push my-branch to Bitbucket (Cloud)
Asked by S_Yokoi:

After creating and committing the develop1 branch from the main branch according to the following page, I could not push to BitBucket.

<https://support.atlassian.com/bitbucket-cloud/docs/create-and-push-a-branch/>  
I could fetch and pull from the repository. Permissions to the repository are "write".  
Error Message:

-----------------------------

$ git push origin develop1  
Enter passphrase for key '/c/Users/xxxxx/.ssh/xxxxxxx':  
Unauthorized  
fatal: Could not read from remote repository.

Please make sure you have the correct access rights  
and the repository exists.

------------------------------

Can you give me some advice?

Thank you.


Answers:
author: Syahrul
body: G'day, [@S_Yokoi](/t5/user/viewprofilepage/user-id/5452203)

Welcome to the community!

May I know where did you add the SSH key? The reason I ask is because if you add the SSH key under repository settings, it will only provide you with read permission.

So, if you want to write into the repository, you should add the SSH key under your personal Bitbucket settings at:

<https://bitbucket.org/account/settings/ssh-keys/>

Let me know how it goes after changing the SSH key location.

Regards,  
Syahrul

comments: author: S_Yokoi
body: Dear Syahrul.

I was able to solve the problem exactly the way you suggested.

I registered and was able to Push successfully.

I was confused because the documentation did not say "Register the SSH key on the personal settings page".

Thank you very much.

Regards,

S.yokoi


Tags: bitbucket-cloud

cloud
Can't Login to bitbucket
Asked by Padraig Foley:

Hello,

My work uses Bitbucket and we use our AD password to login. I changed my password a few weeks ago, and now can't login to Bitbucket or reset my password for the account. Any assistance would be great!

Thanks,  
Padraig


Answers:
author: Dave Liao
body: [@Padraig Foley](/t5/user/viewprofilepage/user-id/4249759) - hi Padraig! Are you getting any error messages? If so, can you share them here (a screenshot or text)?

* Try resetting your AD password again?
* Worth a try, try resetting your Atlassian ID (and see if's permitted) <https://id.atlassian.com/login/resetpassword>
  * If getting into your Atlassian Cloud resources is backed by your company's AD, then you may not be able to complete this reset, and that's OK.

comments: author: Padraig Foley
body: [@Dave Liao](/t5/user/viewprofilepage/user-id/523242) Hi Dave, thank you so much for your response! The error I received on the login page was along the lines of "Invalid Username or Password". When I tried the "reset password" option, I received this email:  
"Bitbucket has received a password reset request for 'foleyp2' today at 11:14 AM.  
Bitbucket is unable to reset the password for your account because it is managed by a read-only external directory."  
Does this mean my new password didn't propagate to Bitbucket?  
Thanks again!  
Padraig


author: Dave Liao
body: [@Padraig Foley](/t5/user/viewprofilepage/user-id/4249759) - humor me, and try resetting your AD password again?

Have you also contacted your AD admin / IT support team? Anyone else on your team having the same auth issues?

It's good to confirm that your Bitbucket account is backed by your company's directory (there's always the odd chance that it isn't exactly, but appears to be). Not sure password propagation is needed; Bitbucket should be calling your company directory to confirm your credentials.

I checked out the "Log into Bitbucket Cloud" KB from Atlassian but it's pretty un-helpful (generic help info): <https://support.atlassian.com/bitbucket-cloud/docs/log-into-or-connect-to-bitbucket-cloud/>


author: Padraig Foley
body: [@Dave Liao](/t5/user/viewprofilepage/user-id/523242) that did the trick! I reset the AD password and can now login. Thank you so much!


author: Dave Liao
body: Woohoo! Have a fantastic day! ?


author: Padraig Foley
body: [@Dave Liao](/t5/user/viewprofilepage/user-id/523242) thank you, you too!


Tags: bitbucket-cloud

cloud
Accidentally deleted repros - maybe?
Asked by Andreas Jakobsson:

Hi,

I might have messed up - or am just entirely ignorant (which is also true :-) I was installing SourceTree to link all different repros from years back and managed to link them fine. But then for some reason I managed to delete the Bitbucket linking - but just added it back again. But lo and behold, then all the repros where gone - also when I logged in to the webpage. Did I manage to delete all repros with a single click there - or am I just doing something stupid? And if I did, is there a way to recreate them?

Best,

Andreas


Answers:
author: Ben
body: Hi Andreas,

It is far more likely you are logged in using the wrong email account, I would suggest attempting to login to Bitbucket through the UI using each email account that you have access to, to see if you are able to locate your repositories. At this stage, there are 0 repositories tied to the workspace that is associated with the email account you have raised this community post using.

Another possibility - you mentioned that these repositories were years old - they wouldn't have happened to be Mercurial (hg) repositories were they? If so these were deleted quite some time ago as we sunsetted Mercurial support in 2020, these would not be recoverable:  

* [https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket#:\~:text=Here%20are%20the%20key%20dates,be%20in%20read%2Donly%20mode](https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket#:~:text=Here%20are%20the%20key%20dates,be%20in%20read%2Donly%20mode).

Lastly, I'd suggest checking any remote configurations/GIT config using a terminal to see if you can pull any information about these missing repositories that may assist with locating them:

```
git remote -vvv
git config --list
```

Hope this helps.

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
.NET Core 8 taking a lot longer to build and publish
Asked by bishan.vithanage:

I'm executing **docker build** command in the pipeline step. Dockerfile has commands to *restore* , *build* and *publish* .csproj's using *mcr.microsoft.com/dotnet/sdk:8.0-alpine3.18*

After upgrading **.NET Core 6** projects to **.NET Core 8**, it's taking a lot longer to build and publish than before with Bitbucket pipeline.

Here is the time spent on each task with **.NET Core 6**
> dotnet build - 34.3s  
> dotnet publish - 17.4s

Here is the time spent on each task with **.NET Core 8**
> dotnet build - 342.5s  
> dotnet publish - 1399.1s

After doubling the memory size (**size: 2x** ) of the entire pipeline step and increasing the **docker service memory** to **4096**, it completed the tasks in less time.

Here is the time spent on each task with **.NET Core 8** after **doubling the memory**
> dotnet build - 37.0s  
> dotnet publish - 20.1s

<br />

It would be great if someone could provide a technical explanation of what's happening here. Is this normal behavior with .NET Core 8? Does the .NET Core 8 SDK consume a significant amount of memory?


Answers:
author: Patrik S
body: Hello [@bishan.vithanage](/t5/user/viewprofilepage/user-id/5053712) ,

thank you for reaching out to Community!

The upgrade from .NET Core 6 to .NET Core 8 might have introduced some new features or functionalities that could be more resource-intensive. These new elements could potentially be the reason why your build and publish time has increased with Bitbucket pipeline, and why they were back to the same level after you increased the memory allocation.

.NET Core 8 might have more advanced features that require additional processing time. It's also possible that changes in the way the new version handles certain tasks might be affecting the performance.

If you would like more details on what changes are causing the framework to be more resource-intensive, it might be helpful to reach out to the .NET community or Microsoft support. They might be able to provide more specific guidance based on your particular situation.

Thank you, [@bishan.vithanage](/t5/user/viewprofilepage/user-id/5053712) !

Patrik S


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

docker

dotnet
Branch restrictions - Rest API fails with BRANCH_PERMISSION_VIOLATED
Asked by Matija Varjacic:

Hello everyone.  

We have a pipeline that creates multiple branches on different repositories.  
It uses Rest API to create branches and authentication method is *OAuth* (oauth consumer is generated in workspace settings). It worked perfectly until we added branch restrictions and now the api call fails with:  

```
`{"type": "error", "error": {"message": "You are not allowed to create a branch that`
` matches the pattern \"release_*\".", "code": "BRANCH_PERMISSION_VIOLATED...`
```

This is how we have branch restrictions setup:

![restrictions.png](/t5/image/serverpage/image-id/311793i86302C8DDF9F8809/image-size/large?v=v2&px=999 "restrictions.png")

But it fails because whichever "user" is used when making an API call is not the **Administrators** group. How can we make it work if there is no user that we can add?  
I hope I made it clear. Any help is appreciated.  

Thanks.


Answers:
author: Patrik S
body: Hello [@Matija Varjacic](/t5/user/viewprofilepage/user-id/4875069) and thank you for reaching out to the Community!

Unfortunately, the OAuth consumer "user" is indeed not available to be selected under the branch restrictions page, so if there's a branch restriction protecting the branch you are trying to push to, you'll not be able to push to that branch using OAuth.

We do have a request with our development team to make the OAuth user "selectable" in the branch restrictions, so it would be allowed to make operations in a protected branch. This request is currently being tracked on [BCLOUD-20121](https://jira.atlassian.com/browse/BCLOUD-20121) . We recommend adding your vote there to express your interest and also watch that ticket to get future updates on its implementation.

As a workaround, while that feature is not available, I'd suggest creating a new bitbucket account to act like a "bot user", and then using that bot's account *username* and [app password](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/) to authenticate the request (basic authentication).

Since that "bot" account would be a regular user, you'd be able to invite it to the workspace and select that user in the branch restrictions.

Hope that helps! Should you have any questions, feel free to ask.

Thank you, [@Matija Varjacic](/t5/user/viewprofilepage/user-id/4875069) !

Patrik S

comments: author: Matija Varjacic
body: @

Thank you [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) for the quick answer and a workaround. I will add my vote and in the meantime I will try the workaround.


author: Matija Varjacic
body: edit: wrong question


Tags: bitbucket-cloud

branch

cloud

rest

rest-api
Cannot log into Bitbucket
Asked by atudela:

Hello, I cannot log into bitbucket. When I google this issue, I see that accounts get deactivated and needs to be re-activated.

Message I get reads as follows

We couldn't log you in  
You may run into this issue when you use specific browsers or add-ons that hide the referer header for id.atlassian.com and other Atlassian sites. Check for these and then try logging in again.


Answers:
author: Ben
body: Hi [@atudela](/t5/user/viewprofilepage/user-id/5451689)

Welcome to the Bitbucket Cloud community! :)

Your workspace was not logged into through the UI since 2018, so the workspace was marked de-activated by our system. I've just re-activated it so you should be able to login now.

Please let me know if any issues.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Manual pipeline for branching strategy pipeline
Asked by Anusha NG:

Hello Team,

I have created bitbucket pipeline as per branches whenever we do commits on branch then it will trigger the pipeline. We want to make this process manual.  
Can you please suggest on the same?  

pipelines:  
branches:  
Dev:  
- step:  
script:  
- ant -buildfile build/build.xml deployEmptyCheckOnly -Dsfdc.username=$SFDC_USERNAME -Dsfdc.password=$SFDC_PASS$SFDC_TOKEN -Dsfdc.serverurl=https://$SFDC_SERVERURL  
Master:  
- step:  
script:  
- ant -buildfile build/build.xml deployEmptyCheckOnly -Dsfdc.username=$SFDC_USERNAME1 -Dsfdc.password=$SFDC_PASS1$SFDC_TOKEN1 -Dsfdc.serverurl=https://$SFDC_SERVERURL


Answers:
author: Anusha NG
body: Hello Matija  
Thank you for the quick response.  

I have tried custom pipeline and manual trigger as mentioned below but still if I commit on Dev branch then pipeline starts. We cannot add trigger in 1st step.  

pipelines:  
custom:  
ManualSteps:  
- step:  
script:  
- echo "Hello";  
branches:  
Dev:  
- step:  
script:  
- echo "Hello"  
- step:  
trigger: 'manual'  
script:

comments: author: Matija Varjacic
body: If you want only manual pipeline then you just need to keep the first part.

```
pipelines:
custom: # Pipelines that can only be triggered manually
ManualPipeline:
- step:
script:
- echo "This can only be triggered manually!"
```


author: Anusha NG
body: How to mention the branches?


author: Matija Varjacic
body: If you run manually you don't need to mention the branch. You choose a branch when you go run it. You can run it from the Branches page (last column Actions -\> Run pipeline for a branch" or Pipelines page.


author: Matija Varjacic
body: You can either make steps manual by adding **trigger: manual** or make a custom pipeline that won't be triggered automatically.

<br />

<https://support.atlassian.com/bitbucket-cloud/docs/pipeline-triggers/>


Tags: bitbucket-cloud

cloud
is it able to set minimum approver from different review groups?
Asked by DW.C:

We want to have at least 2 minimum approvers for a pulll request, and these 2 approvers need to be from different reviewer groups, merge should be not allowed if 2 approvers are from same group, are we able to do this?


Answers:
author: Ulrich Kuhnhardt _IzymesCo_
body: Hello DW.C!

Welcome to the community.

In Bitbucket data-center you can create [repository groups](https://confluence.atlassian.com/bitbucketserver/reviewer-groups-for-pull-requests-1064084872.html) and set the [repository merge-check](https://confluence.atlassian.com/bitbucketserver/checks-for-merging-pull-requests-776640039.html) 'minimum required approvals' to '2'

However, that won't enforce the 'min approval per group' condition, as the repository groups are only used to populate the PR with reviewers.

You may consider using an app for this. We have created the [Workzone app](https://marketplace.atlassian.com/apps/1211303/workzone-pullrequest-workflow?hosting=datacenter&tab=overview) that allows fine-grained PR merge control for repository **and**even Bitbucket directory or external AD groups.

With Workzone you can set all reviewer configurations and [merge-checks in one place](https://izymes.com/docs/workzone-merge-control-control-simple-and-advanced-merge-conditions/).

In your example you would configure Workzone

* Reviewers: for the PR target branch add 2 reviewer groups (from AD or repo groups)
* Merge: for the PR target branch you would set approvalCount: 2 and groupQuota: 1
* (Auto-merge): if you want to merge the PR automatically when all required approvals are given, configure an auto-merge user in the Merge settings.
* Properties: If the merge-check is to be enforced, activate 'Enforce merge condition'

Hope that helps. Please reach out to our friendly support, if you have any trouble setting this up.

Best, Ulrich

// [Izymes](https://marketplace.atlassian.com/vendors/1210584/izymes-pty-ltd)


Tags: bitbucket-data-center

data-center
Bitbucket REST API Error "Something went wrong" when deleting a branch
Asked by lior.regev:

Hello,

I am trying to delete a branch via REST API using:  
\`<https://api.bitbucket.org/2.0/repositories/ws/repo/refs/branches/my/branch/name>\` and I'm getting a 500 response with "Something went wrong".

The error ID is \`394ff3fdfaea443ab72a823c4a481545\`

Please advise


Answers:
author: Syahrul
body: G'day, [@lior.regev](/t5/user/viewprofilepage/user-id/5451129)

Welcome to the community!

You don't have permission to delete the branch based on the error code you shared. This could be because you don't have permission or the branch is protected by branch permission.

I suggest checking if you have admin access to the repository first, and if yes, check your branch permission to see if you can delete the branch.

Regards,  
Syahrul

comments: author: lior.regev
body: 1. According to the [docs](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-branches-name-delete) it requires \`repository:write\` scopes to delete a branch.
2. I tried with a repo token having \`repository:write\` + \`repository:admin\` + \`repository:delete\` scopes and still get the same error. (ID \`3e2daeaa90ff4751be73b4932de42fb7\`
3. At the very least, in a missing permissions error I would expect 401/403 errors, not 500.

Am I using repository tokens wrong?


author: Syahrul
body: Hey [@lior.regev](/t5/user/viewprofilepage/user-id/5451129)

Thanks for the update.

Unfortunately, using repository access tokens does not grant deletion permissions on the API endpoint. To perform this action, you must utilize either an App Password or oAuth. We are currently tracking this feature request; please follow the link below to Vote and Watch the issue:

<https://jira.atlassian.com/browse/BCLOUD-22565>

Regards,  
Syahrul


Tags: bitbucket-cloud

cloud
Temporary downgrade to free, re-upgrade in a few months. What will happen
Asked by helpdesk:

Hello,

Currently paying for a standard Bitbucket plan. Thinking of temporarily changing to free plan.

What happens when we want to re-upgrade to premium in the future? Will we regain access to everything, the state everything was before the downgrade? Exactly as they were before downgrading temporarily to free?

Other comments of things we should consider are welcome.

Thanks, Em


Answers:
author: Ben
body: Hi!

If you downgrade to Free, you will lose all access to Premium features whilst the plan is downgraded as well as direct support through our ticketing system (Community is available to you).

Additionally, Free plan's have a maximum of 5 users. I can see that you have \< 5 users in your workspace so you should not be affected by this particular limitation.

I can confirm that if you decide to upgrade again in future, you will re-gain access to everything as it was prior to the downgrade :)

Cheers!

- Ben (Bitbucket Cloud Support)

comments: author: Serafina Smith
body: Hi Ben,

I am in the same position as Em: I am switching from a yearly premium license to a monthly premium license.

Making this switch requires a temporary downgrade to a free plan and then immediately purchasing the monthly premium plan.

Do you know if this will affect any of the pipelines or self-hosted workers?

Also, we have 25 users--what will happen to the 20 folks above that 5 users limit?

* Will they simply be made inactive and need to be manually reactivated?
* Or will they be removed from the system?

Thanks!

Serafina


author: Ben
body: Hi [@Serafina Smith](/t5/user/viewprofilepage/user-id/4695981)

Once the downgrade to Free occurs, you will not see any users removed or de-activated, but all users will be temporarily unable to push to repositories whilst the plan upgrade is taking place (due to the 5 user restriction limit).

I would suggest raising a ticket with our CA team for further assistance, please raise a ticket using **"Billing Payments \& Pricing"** from the dropdown menu:

* <https://support.atlassian.com/contact/#/>

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud