youngmon/atlassian-qna huggingface dataset:
curl command downloading false zip file from bitbucket after 1 March update from Atlassian.
Asked by Vivek:

Hi guys,

We have been using (Linux) CURL command to download ZIP file from bitbucket "downloads" section and its working completely fine. But its **not** working now. We haven't changed anything except account password.

we are using URL structure as below:

sudo curl -O -L <https://bitbucket.org/>\<ORGANISATION\>/\<REPO\>/downloads/Artifacts.zip -u 'username:AppPassword'

But we are getting this issue: (Actually when we hit above command this file gets downloaded)

![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/188420i71AC2E9C14EA6111/image-size/large?v=v2&px=999 "Capture.PNG")

By using -v parameter in above command, we are getting details as below:

![Capture2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/188432i16C2C6C3C2DC3E79/image-size/large?v=v2&px=999 "Capture2.PNG")

Also, we have tried creating new app password and added that in above command in user authentication. but its not working.

**NOTE:** we are aware about new authentication changes made by Atlassian, that we must use app password for authentication and we are using app password for it (not account password) but somehow those changes are not working for us.

Can anyone please tell us what we are doing wrong? because it was working before


Answers:
author: Ben
body: G'day Vivek!

With the change from basic GIT username/password over to AppPassword, you will now need to make use of our [/2.0/repositories](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-group-repositories) API endpoint with your AppPassword.   
Performing API commands on direct links to files within a repository will cause an authentication issue as the deprecated authentication method is used by default.

For example, the below command will work for your purposes:

```
curl -X GET -O -L \

  --url https://api.bitbucket.org/2.0/repositories/<ORGANISATION>/<REPO>/downloads/Artifacts.zip \

  --header 'Authorization: Basic AppPasswordHere'
```

Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)

comments: author: Vivek
body: Thank you so much....**It Worked!!**


author: Ben
body: Hey Vivek,

Not a problem, I'm glad to know that has helped you out!

Cheers

- Ben (Bitbucket Cloud Support)


author: TechSolutions_admin
body: The command has worked for me as well ... but the Artifacts.zip file is empty.


Tags: bitbucket-cloud

cloud

deployment
Problem: Someone has already added that SSH key to another account.
Asked by Alex B:

Hi,

I'm trying to add my ssh key to my bitbucket account, but I've got the message

'Someone has already added that SSH key to another account.' .

I have tried to SSH bitbucket.org, but is does not say any details:

```
$ ssh -T git@bitbucket.org
authenticated via ssh key.

You can use git to connect to Bitbucket. Shell access is disabled
```

Could anybody please help to remove my public key from accounts I do not have access to?

I would prefer not to change my ssh key.

Thanks you


Answers:
author: Caroline R
body: Hi, Alex, welcome to the community!

As we'll need to know the public SSH key to further investigate this case, I have created an internal ticket for you using the email of your community account, so you don't have to share this information here.

You should have received an email with a link to the support ticket. Just in case you haven't received it, please feel free to let me know and I can post the ticket URL here. The ticket will be visible only to you and Atlassian staff, no one else can view its contents even if they have the URL.

Please feel free to let me know if you have any questions.

Kind regards,  
Caroline


Tags: bitbucket-cloud

cloud
Getting source branch commitid in pull request
Asked by Simon Jespersen:

Hi,

I am working on a deployment pipeline that triggers when i do a PR to my master branch. Using MultiBranch Jenkinsfile

I need to get the commit id from the branch i am merging into master, i havent found any way to get information from the branch i am merging from. Any help would be appreciated

i have been looking on

git cherry -v master \<BRANCH NAME\>

git -log

and so on but havent found asnything that can pickup the information i need.

BR Simon Jespersen


Answers:
author: Ben
body: G'day Simon!

In Bitbucket Cloud Pipelines, you can make use of the $BITBUCKET_COMMIT default variable as defined in the following article - this will return the commit hash for the commit which started the build:  
<https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/>

I am not an expert in Jenkins however I believe this article may prove useful to you so that you can pass the variable through as a payload to Jenkins:

<https://stackoverflow.com/questions/41639641/access-bitbucket-payload-data-in-jenkins-pipeline-job>

Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
atlassian/bitbucket-build-statistics:0.2.0 / Client Error: Unauthorized for url
Asked by ?lex L?pez:

Hello,

I was using the bitbucket-build-statistics pipeline for several months and was working fine. In the last run I got this error Client Error: Unauthorized for url. Nothing has been changed to get this error. Just in case, I recreated the App password, but the problem persists.

I've tried also with the new version of the pipeline 1.0.0 and the problem persists.

Can you check if there is any issue?

Thank you


Answers:
author: Norbert C
body: Hi [@?lex L?pez](/t5/user/viewprofilepage/user-id/4676241)

Thank you for contacting Atlassian Community, my name is Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you! Welcome to the Atlassian Community!

I suspect your app password doesn't have all the permission which is needed to gather the data. For testing purpose, can I ask you to generate an app password with all the permission and give it a try with it? In case that works, can you try to generate an app password with the following permission and let me know if that works as well?

![Screenshot 2022-03-18 at 11.42.58.png](https://community.atlassian.com/t5/image/serverpage/image-id/188825iF7E9D0219E988889/image-size/large?v=v2&px=999 "Screenshot 2022-03-18 at 11.42.58.png")

Please let us know how it goes, we're here to help.

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support


Tags: bitbucket-cloud

build

cloud

statistic
Possibility to add a mandatory reviewer for a specific file in Bitbucket repo ?
Asked by Pasha Shwartz:

Hi .

I was wondering if there is a possibility to add a mandatory reviewer for a specific file in the Bitbucket repo(Cloud)?


Answers:
author: Michael R?egg _Mibex Software_
body: Hi,

Welcome to the Atlassian community!

Default Reviewers in Bitbucket Cloud do not support individual files, they are always added to new pull requests of the repository where you configure them.

You can add reviewers for specific files with the concept of Code Owners. Just add a CODEOWNERS file to your repository where you configure rules like the following:

```
LICENSE??? @"CTO"
```

Whenever somebody touches the file LICENSE in a pull request, CTO will be added as a reviewer to your pull request.

There is an [app in the Marketplace supporting Code Owners](https://marketplace.atlassian.com/apps/1218598/code-owners-for-bitbucket?hosting=cloud&tab=overview)

Best regards,

Michael (vendor of the mentioned Code Owners app)

comments: author: Pasha Shwartz
body: Thank you Michael ,

I guess CODEOWNERS is the best choice.


author: Pasha Shwartz
body: Actually seems like the app is unavailable.

When a click on "Get it now" it gives me

Resource not found. {#toc-hId--1180751088}
------------------------------------------

I went for a cloud version.


author: Michael R?egg _Mibex Software_
body: [@Pasha Shwartz](/t5/user/viewprofilepage/user-id/4818243)Thanks for your feedback. I was not able to reproduce this. Are you logged in to Bitbucket Cloud when you clicked "get it now"? Could you please [create a support request](https://mibexsoftware.atlassian.net/wiki/spaces/MSS/overview)?


author: Pasha Shwartz
body: [@Michael R?egg _Mibex Software_](/t5/user/viewprofilepage/user-id/1135077) I was able to log in. Also, I am an admin.

I will create a support ticket.

Thanks for the advice.


Tags: bitbucket-cloud

cloud
LFS Repo Conversion Issue
Asked by Alan Cordner:

I just converted an existing repo to use LFS after I found it had exceeded 2GB in size. I followed the instructions here: <https://support.atlassian.com/bitbucket-cloud/docs/use-bfg-to-migrate-a-repo-to-git-lfs/>

Everything seemed to go fine, but when I clone the repo now, and install LFS, then restart SourceTree, the files stored in LFS get downloaded to my local repo, but they all show up as changed files that need to be committed and pushed to origin! As a test, I committed only one of the 1200+ files and pushed it to origin. When I checked the commit in Bitbucket, I can see that the previous revision of the file is in LFS, but the new commit puts the file back into the repo where it was previously. I reverted that commit and I can see the file went back to being in LFS, but now my local copy of the file in the file system is 1KB and unreadable (hasn't been downloaded from LFS). Restarting SourceTree causes the file to be downloaded again, and my count of files that need to be sommitted/pushed goes back to the original value.

I do not understand how I got here and what can be done to resolve this. Any suggestions would be appreciated.


Answers:
author: Alan Cordner
body: It appears the .gitattributes file was missing from my repo, and the config file needed to be manually updated to contain the lines related to LFS. I was able to copy the config file lines from the config file that was generated following the conversion process, and I was able to copy the .gitattributes file from another repo and alter it for the file types that LFS applies to in this repo.


Tags: bitbucket-cloud

cloud

git-lfs
Can I use an external diff engine to compare files in bitbucket scm?
Asked by kmcalpine:

The built-in diff engine in BitBucket is atrocious at aligning code in the side-by-side comparison.  

If I add a function in say at line 124, pushing the existing function down 10 lines to line 134, BitBucket will align the existing function to the new function at 124, even though there is an exact match to the original function 10 lines lower.  

It prefers matching:  
func GetConfigFileFromS3(key string) (\*model.RevConfig, error) {   
to:  
func GetDefaultConfigFileFromS3(ItemName string) (\*model.RevConfig, error) {

Its like it chooses a poor match here and can't even scan 10 lines further for an exact match.  

Using BeyondCompare I can set the look ahead to 100s of lines so it will align properly even if I'm inserting large blocks of new code.


Answers:
author: Robert Willard
body: Same question from me. We're moving from an internal svn server to Bitbucket and git. In svn I could connect beyondcompare as a diff viewer. I prefer to use beyondcompare for all diff viewing.


Tags: bitbucket-server

compare

server
How can a pipeline can reach the pipe repo without any authorization?
Asked by oguzhan:

Hi,

We have 2 repos, one of them has **bitbucket-pipelines.yml** and other one has **pipe.yml**. So basically We're trying to use first one as an automation repo which pipeline is running, and second one as pipe repo. Both of them private and there is no authentication configuration between them. Both of them are in the same workspace. We realized that pipeline can use pipe repo without any kind of authentication whatsoever.

My questions are;  

- How the authentication handled between these repos? Both of them are private, normally this kind of operation requires authentication. We have other pipeline repos that need code library repos and to be able to use libraries, we have an authentication configuration. This is working because of pipe?  

- Is this behaviour restricted at workspace scope? If not, can people use others' private pipe repos without any authentication?

- In pipe step of the pipeline, there is a huge docker container run command which is taking so much environment variables, which one them is **PIPELINES_JWT_TOKEN="$PIPELINES_JWT_TOKEN"** . Is this variable handling the authentication? There is no sign of that in variables \& secrets document.  
<https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/>  

Best Regards,


Answers:
author: Caroline R
body: Hi, [@oguzhan](/t5/user/viewprofilepage/user-id/4207436), thank you for reaching out to Atlassian Community.

As we'll need to analyze your YAML file, I have created an internal ticket for you using the email of your community account, so you don't have to share this information here.

You should have received an email with a link to the support ticket. Just in case you haven't received it, please feel free to let me know and I can post the ticket URL here. The ticket will be visible only to you and Atlassian staff, no one else can view its contents even if they have the URL.

Please feel free to let me know if you have any questions.

Kind regards,   
Caroline

comments: author: oguzhan
body: Thank you for response, I'm gonna follow the ticket and try to get the answers of my questions. Appreciate it :)


Tags: bitbucket-cloud

bitbucket-pipelines
run a pipeline from a pipeline step?
Asked by Christopher Klapperich:

Can I have a pipeline step point to a different peipeline in the same yaml file? how? thank you


Answers:
author: Ben
body: Hey Christopher,

So that I can make sure that we are on the same page - can you please explain what you are trying to achieve by referencing a different pipeline step? Are you wanting to execute that step from within another step or something different?

Cheers!

- Ben (Bitbucket Cloud)


Tags: bitbucket-cloud

cloud
Catkin tests aren't picked up by the scanner
Asked by Kai Neubauer:

I am using catkin for my builds. The output is placed into "build/\<pkg name\>/test_results/\<test_name\>.xml"

These directories are not picked up by the scanner so I have to manually move them into a folder called TestResults. The command "catkin test" returns a non-zero value when tests fail and causes the pipeline to stop, meaning any commands after that point (like the move command) fail to be run. I have to force the pipeline to go to move them by running the following:

```
- catkin test || true
- mkdir TestResults
- mv build/**/test_results/**/*.xml TestResults
```

This means that the pipeline always succeeds even when tests fail. I don't want to parse the XML output to see if tests pass/fail. A workaround is running "catkin test" again after moving the XML files but this is a waste of build minutes so I'd rather not. I also found that the Tests tab is missing some of the failed tests. It says 8/19 tests failed but only two test outputs are visible for some reason. I can see all of the test output in the build tab but it's a pain to look through it to find the failed tests.


Answers:
author: Nick de Pal?zieux
body: Being able to configure the test report directories would be great. Can't imagine that being a difficult thing to implement either.

What you can use in the meantime is adding the following as the last step in your pipeline. It prints out a test result summary and returns nonzero if a test failed.

```
- catkin_test_results build/
```

Note though that this will not indicate any tests that failed to build, which

```
catkin test || true
```

glosses over.

So you might want to do something like

```
- if catkin test micro_bridge ; then catkin_test_ret=0; else catkin_test_ret=1; fi
- mkdir TestResults
- mv build/**/test_results/**/*.xml TestResults
- catkin_test_results build/ && [ $catkin_test_ret = 0 ]
```


author: Norbert C
body: Hi Kai,

Thank you for contacting Atlassian Community, my name is Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you! Welcome to the Atlassian Community!

I'd like to inform you that unfortunately currently we don't support this as the test report directories can't be configured, yet.

<br />

Currently we have a feature request for this as you can see in the link below:

\* [BCLOUD-15419 - Configure Searched Test Report Directories in the YAML](https://jira.atlassian.com/browse/BCLOUD-15419)

Our development team will give a first-hand update on that ticket if there's any progress made so I would suggest keeping a watch and vote for it.

Do note however that there's no ETA on enhancement request, and all enhancements are implemented with this policy in mind: [Implementation of New Features Policy](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html)

Please let us know if you need any further assistance.

<br />

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

test
Can't pull from my repo using SSH (1/03 change)
Asked by hotgeart:

Hi,

Since the 1/03 we can't connect via HTTPS but only via SSH. Fine, I changed, but I cannot pull from my repo?! I don't know why:

![ConEmu64_6tDmXMddOu.png](/t5/image/serverpage/image-id/188273iB42CA4D482462411/image-size/large?v=v2&px=999 "ConEmu64_6tDmXMddOu.png")

So as you can see :

1. I tested my ssh. It's working.

2. I logged into to my server and go to my public folder.

3. Pulled... and I'm denied.

4. I checked the git remote, it's look ok.

**What I did wrong?**


Answers:
author: Ben
body: G'day!

I can see that your SSH is authenticating without issue given the output that you have provided as you have identified.  
The most common issue customers are experiencing related to authentication is due to the deprecation of GIT username/password in favour of App Passwords on 01/03/2022:  
<https://community.atlassian.com/t5/Bitbucket-articles/Announcement-Bitbucket-Cloud-account-password-usage-for-Git-over/ba-p/1948231>  
You will need to make use of an AppPassword for communicating to GIT via HTTPS.  
We have documentation for usage of app passwords at the following link:  
<https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/#Create-an-app-password>  
Essentially, when connecting via \*HTTPS\* you will use your \*AppPassword\* alongside your username seperated with a ":" character.  
Hope this helps, if you have any further questions please let me know.  
Cheers!  
- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Old Bitbucket account with no email address
Asked by MarcGuay:

I have an old Bitbucket user with a username but no email address associated. How can I login?


Answers:
author: Caroline R
body: Hi, [@MarcGuay](/t5/user/viewprofilepage/user-id/2403454) welcome to the community!

As we'll need to know the username of this account to further investigate this case, I have created an internal ticket for you using the email of your community account, so you don't have to share this information here.

You should have received an email with a link to the support ticket. Just in case you haven't received it, please feel free to let me know and I can post the ticket URL here. The ticket will be visible only to you and Atlassian staff, no one else can view its contents even if they have the URL.

Please feel free to let me know if you have any questions.

Kind regards,  
Caroline


author: MarcGuay
body: I seem to have made small progress by filling out the Bitbucket password reset form which accepts a username. <https://bitbucket.org/account/password/reset/>

I then received a reset link at the email address which I guess was associated with the username under-the-hood. I followed it, and changed my password. I then received an email saying "The password for **Former user** was changed".

However when I try to login with the email address and the updated password, I am denied.

I clicked on "Can't log in?" on the login page and asked it to send me a recovery link but have yet to receive it.


Tags: bitbucket-cloud

cloud
Adding myself as a reviewer to a pull request
Asked by Yaron Shahrabani:

Hey, when openning a pull request I can add myself as a reviewer manually if I want to.

Other users cannot add themselves as reviewers for their own PRs, I can add them, I can add myself, they can add me, they cannot add themselves.

I'm wondering if it's by design or if there's some configuration I can change to allow this specific user to add himself to his own PRs.

Kind regards,

Yaron.


Answers:
author: Ben
body: Hey Yaron,

This is by design. You cannot add yourself as a reviewer to a pull request you create, the same applies to other users for pull requests that they themselves create. As the person who initiated the pull request, it is implied that you/they have seen the code/reviewed it already. You are a "reviewer" already in that you wouldn't have initiated the pull request if you did not feel as though the work was complete.

Hope this makes sense.

Cheers!

- Ben (Bitbucket Cloud Support)

comments: author: Yaron Shahrabani
body: Hey, thank you for the response.

It doesn't make any sense, how come I can add myself and he can't add himself?

Thanks.


author: Ben
body: Hey Yaron,

I've just tested this myself on my end and had a colleague test this as well on our personal workspaces. I cannot add myself as a reviewer to a new pull request which I have created, neither can he - both on our own respective personal workspaces or when creating the request on each others personal workspace.

May I ask if you are creating the pull request on a team workspace or personal workspace - and which screen are you using to add yourself?

Cheers!

- Ben (Bitbucket Cloud Support)


author: Leonid
body: This possibility will be added ? Because now if you create PR and after identify that need make some additional changes, you should to decline this PR for ensure that other developers not will lost time for review it before you implement required changes.


Tags: bitbucket-cloud

cloud

pull-request

user
Can access my repository since few days
Asked by Adam Lukasz Piekarski:

I have the same problem like some users here.  
Can't access my repository since few days :(

Can anybody help me please?


Answers:
author: Nic Brough -Adaptavist-
body: Welcome to the Atlassian Community!

Same problem as what?

What does "can't access repository" mean? What are the symptoms and errors you are seeing?

My guess is that you have run into the change to authorisation methods that was implemented at the beginning of the month, and you'll need to read the docs the error messages have been pointing you to.


Tags: cloud
Is it possible to make Bitbucket Cloud use the userdirectory which is built into Jira Server?
Asked by Matthias M?ller-Reineke:

Currently we are using Jira, Confluence and Bitbucket on premise.

Confluence and Bitbucket are using the Crowd service which is offered by Jira. Our Jira is configured that Microsoft Active Directory and the built in directory are merged. This way users need to be administered in the Jira userdirectory or Active Directory only.

We consider migrating our Bitbucket into Cloud because it's user tier of 10 has become a bit small for our purposes.


Answers:
author: Nic Brough -Adaptavist-
body: No, Cloud only supports Atlassian accounts, Google accounts and Atlassian Access as user directories. You can hook up your MS AD to Access though, which will enable the accounts in there to appear in Cloud.


Tags: bitbucket-cloud

cloud