youngmon/atlassian-qna huggingface dataset:
SSH Key Storage and Security
Asked by Michael Russo:

Hi All,

I'm a Bitbucket Administrator, and I have a question about storage of SSH keys.

Location 1: [https://bitbucket.org/\[organizationname\]/workspace/settings/ssh-keys](https://bitbucket.org/[organizationname]/workspace/settings/ssh-keys)

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

Any Admin is able to register new SSH public keys in Location 1, and a user with the corresponding private key is then able to push code to Bitbucket without password prompts - no problem there.

Any User is able to register a new SSH key into Location 2, however Admins are unable to see those keys.

My questions are:

1. Are key creation/removal on the User (Location 2) level auditable events?

2. Is there a way to generate a report that shows all keys across both locations?


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

Welcome to the Bitbucket Cloud community!

User-level SSH keys are present in audit logging at the user level (and are only visible to that user) and cannot be queried at the workspace level - more information regarding the events found in the audit log can be found below:

* <https://confluence.atlassian.com/bbkb/bitbucket-cloud-audit-log-events-1178872155.html>

As for reporting, this is not yet possible within the Bitbucket Cloud product but there is a [feature request](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html) logged with our developers. Please feel free to **Watch** this feature request to receive future updates related to it and **Vote**for it to improve its visibility with regard to customer demand:

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

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Unable to clone remote repo - Invalid credentials error
Asked by Bose Muthu:

Hi, I have successfully created Atlassian account using my google credentials. while installing Source Tree in my windows machine, I have selected Bitbucket while registering.

It redirected to my bitbucket account , then i selected my google account and able to register successfully.

Then I have attempted to clone my remote repository and getting below error

Command: git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks ls-remote [https://username@bitbucket.org/\*\*-\*\*\*/\*\*-\*\*\*-api.git](https://username@bitbucket.org/**-***/**-***-api.git)  
Output:  
Error: remote: Invalid credentials  
fatal: Authentication failed for '[https://bitbucket.org/\*\*-\*\*\*/\*\*-\*\*\*-api.git/](https://bitbucket.org/**-***/**-***-api.git/)'

I have verified the credentials from Tools -\> Options -\> Authentication. It looks good. Even I deleted and added the account again. It looks good.


Answers:
author: Theodora Boudale
body: Hi [@Bose Muthu](/t5/user/viewprofilepage/user-id/5441151) and welcome to the community!

We have deprecated the use of account passwords for Git over HTTPS and API:

* <https://community.atlassian.com/t5/Bitbucket-articles/Announcement-Bitbucket-Cloud-account-password-usage-for-Git-over/ba-p/1948231>

Your account's password can be used only for logging in to <https://bitbucket.org/> from browser.

If you want to clone, pull, or push to a repo with basic authentication over HTTPS, you can generate an app password for your account and use that instead of a password (along with your Bitbucket username that can be found here <https://bitbucket.org/account/settings/>):

* <https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/>

The Atlassian account's password or your Google account's password won't work.

Just a heads up, I removed the username from your post to protect your privacy.

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

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Bitbucket Pipelines - Trigger build on tag to master only
Asked by David Jackson:

I'd like to trigger a pipelines build when a tag is created on the master branch only. How would I do this?


Answers:
author: Ben
body: G'day [@David Jackson](/t5/user/viewprofilepage/user-id/5441100) !

Welcome to the Bitbucket Cloud community! :)

You would need to make use of the **tags**trigger condition, you can find more information in our documentation:

* <https://support.atlassian.com/bitbucket-cloud/docs/pipeline-start-conditions/#Tags>

Basically, you would define this in a similar method to branches - for example:

```
pipelines: 
  tags: 
    'master': 
     - step:
         script: 
           - echo "Hello world!"??
```

Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)

comments: author: Giorgi Rekhviashvili
body: Hi [@Ben](/t5/user/viewprofilepage/user-id/4537226) ,   

your example will trigger any branch with tag 'master'.   
Question is different. How to trigger only master or main branch with tag and not other branches.   

Thx!


author: Ben
body: Hi [@Giorgi Rekhviashvili](/t5/user/viewprofilepage/user-id/5512314)

This was proposed as a feature, but our developers declined its implementation due to a lack of customer demand - please see the comments for further context:

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

At this stage, branch triggers will trigger whenever there is any kind of push to the branch - this includes commits and tags.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
Request for garbage collection
Asked by Arsh Singh:

It was brought to our attention that one of our repositories at: \[REDACTED\] are becoming too large (2.5GB) because we were tracking binary files. We re-wrote history and added LFS to the repo to manage the binaries. Then we ran git garbage collector (locally) and reduced the size to 600MB.  

But the remote still says 2.5GB even after force pushing. After reading more here, <https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/> we realized that someone needs to run garbage collector from remote side.  

Can we get someone to run rc on the repo.


Answers:
author: Ben
body: Hi Arsh,   

I've successfully run garbage collection against your remote repository in the back-end to clean up any dangling commits.  

The repository size has reduced from **2.5GB** and is now currently **574MB** .  

Whilst it is not possible to run a gc manually from your side (we do have automated gc processes that run when certain garbage threshholds are met) - we want to inform you that we do have a Feature request <https://jira.atlassian.com/browse/BCLOUD-11610> to provide users with the option to limit the filesize that is able to be pushed to GIT to prevent such issues from occurring again.   
Our Dev team is currently working on implementing the feature request and we don't have any ETA for its implementation. I would suggest you **"Watch"** this ticket for future updates from our Dev team and **"Vote"**for it to improve its visibility with regard to customer demand.

**NOTE:** Please ensure that you and your colleagues perform a fresh clone of the repository to ensure that you do not accidentally push old local refs back to the repository, as this could inflate the size again.

Cheers!

- Ben (Bitbucket Cloud Support)

comments: author: Arsh Singh
body: Thanks for the help!


Tags: atl-rvw

bitbucket-cloud

cloud
new to bitbucket, can't get git clone to work because of authentication failure
Asked by Thomas Deaton:

i am following the instructions in your company's youtube tutorial video: <https://www.youtube.com/watch?v=lYkghPud4dA>

git clone https://\[username\]@bitbucket.org/\[project\]/\[reponame\].git

when i type in my password, i get this error:

Authentication failed for '[https://bitbucket.org/\[projectname\]/\[reponame\].git/](https://bitbucket.org/[projectname]/[reponame].git/)'

why is this not working? there are no special characters in my password.


Answers:
author: Ben
body: Hi Thomas,

The most common issue that users 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 authentication method such as an [App Password](https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password/) for communicating to GIT via HTTPS. It's likely that the remote URL has not yet been updated to include the App Password and this is why the command from the video that you are executing is failing (as it requests a password instead which is no longer supported).  

Essentially, when connecting via **HTTPS** you will use your **App Password** alongside your username seperated with a ":" character.

Therefore if you are authenticating to **GIT over HTTPS** to push/pull you will need to update your remote URL's to include the **App Password**:

```
git remote set-url origin https://USERNAME:APP_PASSWORD@bitbucket.org/workspaceID/reposlug.git
```

Once the remote URL has been updated, please attempt to clone again.

I would suggest ensuring also that all stored passwords related to authentication over GIT are cleared from your machine (ie Credential Manager for Windows, Access Keychain for Mac or /etc/shadow folder for Linux).

Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
remote rejected] main -> main (pre-receive hook declined)
Asked by harit dey:

How to resolve this error


Answers:
author: Nrawut Phommahit
body: +1 same case


author: Aron Gombas _Midori_
body: Give us more details. It means that Bitbucket (on the server-side) rejected your push, but that can happen to many reasons.

What else do you see in the console?


Tags: unknown-hosting-type
Option to turn off automatic watching for new repositories
Asked by Andrew:

My question is similar to this one, asked some time ago:  
[How to disable automatic watches for commits on wh... (atlassian.com)](https://community.atlassian.com/t5/Bitbucket-questions/How-to-disable-automatic-watches-for-commits-on-which-I-comment/qaq-p/639289)  

Is there a means to disable being automatically added as a watcher for new repositories in a workspace, at a user level, either via the Cloud REST API or via the web interface? Disabling email notifications altogether is not desirable.

Our organization will have a workspace with several hundred repos, and for each user to get email notifications for any and all updates to even a fraction of that number of repos will be problematic.


Answers:
author: Mark C
body: Hi [@Andrew](/t5/user/viewprofilepage/user-id/5408786),

Thank you for reaching out to the community.

Unfortunately, there's no option to disable automatic watchers for new repositories at the moment.  
We do have an existing feature request for it that can be located through this link. - <https://jira.atlassian.com/browse/BCLOUD-23141>  
You can upvote and watch it for now so that you'll be notified of any updates from our team when the feature becomes available on Bitbucket Cloud.

We appreciate your patience and understanding as we continue to improve Bitbucket Cloud according to our policy on [implementing new features](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html).

Regards,  
Mark C

comments: author: Andrew
body: Thanks Mark


Tags: bitbucket-cloud

cloud
How to give acces a user to a specific repository ?
Asked by sebastien-noviris:

hi,

i got 3 users, 2 groups

group admin  
group developer

inside the developer group, i would like to restrict one particular user to one or multiple specific repository

i don't want the user to see and access to all my repository

how to do that ?

best regards


Answers:
author: Mark C
body: Hi [@sebastien-noviris](/t5/user/viewprofilepage/user-id/2409606),

Thank you for reaching out to the community.

You can achieve this by using project permissions where you can add specific repositories to a project with permissions.

You can find more on the following links:

* [Taking Bitbucket permission management to the next level](https://community.atlassian.com/t5/Bitbucket-articles/Taking-Bitbucket-permission-management-to-the-next-level/ba-p/2264892)
* [Configure project permissions for users and groups](https://support.atlassian.com/bitbucket-cloud/docs/configure-project-permissions-for-users-and-groups/)

Regards,  
Mark C


Tags: bitbucket-cloud

cloud
Reversing a Merge Commit
Asked by Cynthia Garde:

Dear Support, Advisor: our current code repo and deployment setup uses Bitbucket (on the cloud) and AWS code pipelines. We don't use Bitbucket pipelines.  

**We very much need confirmation about the ability to reverse an already merged commit. Is it possible? If so, how? what's required?**   

Our hope is that reversing the commit will also reverse the latest deployment that uses it because the reversal will trigger a deployment similar to when a commit is merged.  

*Please note that this is assuming no pull request is done, which might be what we should be doing in the isolated cases leading to this question, even if it is a development environment.*   

Thank you so much!  
Cynthia


Answers:
author: Aron Gombas _Midori_
body: The answer is not specific to Bitbucket Cloud, but it is actually specific to Git.

There are several approaches to "undo", "revert" Git commits, see this StackOverflow topic: <https://stackoverflow.com/questions/927358/how-do-i-undo-the-most-recent-local-commits-in-git>


Tags: bitbucket-cloud

cloud
How do I get my invoices for previous subscription payments?
Asked by Ari:

I am trying to generate all invoices for previous billing cycle.


Answers:
author: Laurie Sciutti
body: Hello [@Ari](/t5/user/viewprofilepage/user-id/5439643) and welcome to the Community! Per the FAQ link [here](https://www.atlassian.com/licensing/purchase-licensing#upgrading-selfmanaged-licenses):

![Snag_cec20fb.png](https://community.atlassian.com/t5/image/serverpage/image-id/308962iEDDC3C19224E6419/image-size/large?v=v2&px=999 "Snag_cec20fb.png")


Tags: bitbucket-cloud

cloud
azure azcopy cp doesn't work with SAS token
Asked by Guilherme de Oliveira:

I'm generating a SAS Token [following this microsoft documentation](https://learn.microsoft.com/en-us/azure/data-explorer/kusto/api/connection-strings/generate-sas-token) to deploy files to my Azure StorageAccount using BitBucket Pipelines, but when I run Deploy I get this error:  

'failed to perform copy command due to error: no SAS token or OAuth token is present and the resource is not public'.   

<br />

```
Status: Downloaded newer image for mspipes/azure-storage-deploy:2.0.1

INFO: Starting deployment to Azure storage...

azcopy cp "./my-folder/*" "https://myblob.blob.core.windows.net/my-container/$MY_SAS_TOKEN" --from-to localBlob --recursive

INFO: Scanning...

failed to perform copy command due to error: no SAS token or OAuth token is present and the resource is not public

? Deployment failed.
```

<br />

<br />

Until 4 days ago the Deploy worked normally, and now it no longer works.  

<br />

Here is the code step where I use the SAS Token:  

```
- step:

    name: Deploy to Storage Account

    script:

    - pipe: microsoft/azure-storage-deploy:2.0.1

      variables:

        SOURCE: './my-folder/*'

        DESTINATION: 'https://myblob.blob.core.windows.net/my-container/'

        DESTINATION_SAS_TOKEN: $MY_SAS_TOKEN

        EXTRA_ARGS: '--from-to localBlob --recursive'

    - sleep 15
```

<br />

Any help would be greatly appreciated, thanks


Answers:
author: Igor Stoyanov
body: [@Guilherme de Oliveira](/t5/user/viewprofilepage/user-id/5439952) hi. Pipe you mentioned not supported anymore. Instead, try this pipe: [atlassian/azure-storage-deploy:](https://bitbucket.org/atlassian/azure-storage-deploy/src/2.1.0/)

```
script:  - pipe: atlassian/azure-storage-deploy:2.1.0    variables:      SOURCE: 'myfile.txt'      DESTINATION_STORAGE_ACCOUNT_NAME: 'https://mystorageaccount.blob.core.windows.net'      DESTINATION_SAS_TOKEN: $AZURE_STORAGE_SAS_TOKEN      DESTINATION_CONTAINER_NAME: 'my-container'
```

Regards, Igor

comments: author: sbiales
body: Hi, I am trying to use this pipeline to deploy to azure, formatted exactly as it is here except I have tried versions 2.3.0 and 2.4.0, but I am getting this error: "Deployment failed. Reason: (MissingRequiredHeader) An HTTP header that's mandatory for this request is not specified."

I don't know how to tell what header is missing or why this error would be occurring. Any help would be appreciated.


author: Igor Stoyanov
body: [@sbiales](/t5/user/viewprofilepage/user-id/2402572) hi. Please, next time create a new question to describe your problem.  

Also could you check [this is your case](https://stackoverflow.com/questions/78368778/unable-to-send-blob-to-azure-missing-http-header-exception)?

Regards, Igor


author: sbiales
body: Yes that was it!! Thank you! And sorry, I will do so next time :)


Tags: azure

bitbucket-cloud

bitbucket-pipelines

cloud
Unable to clone repository to local
Asked by Rama Krishna Avanigadda:

Hi I am not able to clone repository to my local.

getting below error

fatal: remote error: CAPTCHA required  
Your Bitbucket account has been locked. To unlock it and log in again you must  
solve a CAPTCHA. This is typically caused by too many attempts to login with an  
incorrect password. The account lock prevents your SCM client from accessing  
Bitbucket and its mirrors until it is solved, even if you enter your password  
correctly.  

If you are currently logged in to Bitbucket via a browser you may need to  
logout and then log back in in order to solve the CAPTCHA.  

Visit Bitbucket at <https://bitbucket.trimble.tools> for more details.


Answers:
author: Tansu Akdeniz
body: Hi [@Rama Krishna Avanigadda](/t5/user/viewprofilepage/user-id/4089935)

I believe logging out and back in didn't help.

Please check the answers in related threads.

* [CAPTCHA Error - Bitbucket works fine in Browser](https://community.atlassian.com/t5/Sourcetree-discussions/CAPTCHA-Error-Bitbucket-works-fine-in-Browser/td-p/638690)
* [fatal: remote error: CAPTCHA required](https://stackoverflow.com/questions/30904285/stash-git-error-fatal-remote-error-captcha-required)


Tags: bitbucket-data-center

data-center
Download File from Bitbucket repository using powershell
Asked by Shravan:

Hi all,

I am new to Bitbucket and am trying to use PowerShell to download a file from the Bitbucket repository. The downloaded file is throwing the below error. Can someone help me with the same.  

Below is the code.

clear;

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force

# Define your Bitbucket credentials  
$username = "username"  
$password = "password"

# Convert credentials to Base64  
$base64AuthInfo = \[Convert\]::ToBase64String(\[Text.Encoding\]::ASCII.GetBytes(("{0}:{1}" -f $username, $password)))

# Define the Bitbucket URL of the file you want to download  
$bitbucketUrl = "gitbucket link to the file"

# Define the local path where you want to save the downloaded file  
$localPath = "C:\\Temp\\Download\\usp_GetTableColumns.sql"

# Download the file using Invoke-WebRequest with authentication headers  
Invoke-WebRequest -Uri $bitbucketUrl -OutFile $localPath -Headers @{ Authorization = "Basic $base64AuthInfo" }

# Check if the file was downloaded successfully  
if (Test-Path $localPath) {  
Write-Host "File downloaded successfully to: $localPath"  
} else {  
Write-Host "Failed to download the file."  
}

<br />

<br />

<br />

![Screenshot 2024-02-27 134905.png](/t5/image/serverpage/image-id/308851iFA6858AC892A039A/image-size/large?v=v2&px=999 "Screenshot 2024-02-27 134905.png")


Answers:
author: Ben
body: Hi Shravan,

May I know what the $password variable is referring to? We no longer support username/password authentication, so you will need to use [App Password](https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password/) for authentication if you are not already doing so.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Need Assistance for this error - RPC failed; curl 56 OpenSSL SSL_read: Connection was reset, errno
Asked by Divya Jain:

Hi,

I have committed my work and I want to push it on my repository on the bitbucket but the push fails and this error is displayed: -

**error: RPC failed; curl 56 OpenSSL SSL_read: Connection was reset, errno 10054
send-pack: unexpected disconnect while reading sideband packet
Writing objects: 100% (2862/2862), 5.69 GiB \| 2.19 MiB/s, done.
Total 2862 (delta 1098), reused 79 (delta 37), pack-reused 0
fatal: the remote end hung up unexpectedly**

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


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

Based on the following error, "**send-pack: unexpected disconnect while reading sideband packet"**it seems to point toward a local network issue.

I suggest trying a new connection while pushing, such as a mobile hotspot, through or without a VPN to test the connection and see if you have any issues.

I noticed the repo size exceeds our limit, so I wonder why your connection was terminated. Bitbucket Cloud has a limit of 4 GB. You may consider reducing the repository size further in such a case. Please check our documentation below:

[Reduce repository size](https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/)

Regards,  
Syahrul


Tags: bitbucket-cloud

cloud
Bitbucket-Pipeline: Segmentation fault when testing IfcOpenShell Code
Asked by jgfhnw:

I am currently trying to set up a bitbucket pipeline that executes the python tests of my application on new commits. unfortunately, a problem seems to occur as soon as the C++ part of the ifcopenshell library is to be executed: Segmentation Fault. The strange thing is that the tests run without any problems when I run the container locally on my computer.  
![MicrosoftTeams-image.png](/t5/image/serverpage/image-id/308859i23FDB13700645D9A/image-size/large?v=v2&px=999 "MicrosoftTeams-image.png")

bitbucket also uses docker to build its pipelines and i tried to build the containers as similar as possible. both use the same image and have the same execution steps.

bitbucket-pipelines.yml

    image: python:3.10pipelines:  default:    - step:        name: Test        caches:          - pip        script:          - pip install -r requirements.txt          - PYTHONPATH=src pytest

Dockerfile

    FROM python:3.10WORKDIR /workspaceCOPY requirements.txt /workspace/requirements.txtRUN pip install /workspace/requirements.txtCOPY src /workspace/src

when i run the tests locally, i do this directly via the console. not in the dockerfile.

`PYTHONPATH=src pytest`

What is causing the segmentation fault?


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

Welcome to the community!

May I suggest when testing locally to reproduce the exact environment similar to Bitbucket cloud, please follow the following documentation:

[Troubleshoot Bitbucket pipeline locally](https://confluence.atlassian.com/bbkb/troubleshoot-failed-bitbucket-pipelines-locally-with-docker-1318882094.html)

With that in mind, the error sounds similar to what is being discussed [here](https://stackoverflow.com/questions/16731115/how-to-debug-a-python-segmentation-fault), so could you review them and try the suggested workaround in the threads to see if it helps your issue?

Let me know how it goes.

Regards,  
Syahrul


Tags: bitbucket-cloud

bitbucket-pipelines

cloud