youngmon/atlassian-qna huggingface dataset:
SSH cannot connect to bitbucket
Asked by christie_vas:

Hello, I followed all steps from <https://support.atlassian.com/bitbucket-cloud/docs/set-up-personal-ssh-keys-on-windows/> to set up the keys, I believe successfully. However, at the very last step I get the message

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

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

after maybe three or four minutes. And when I try to git fetch in my cloned repo, it does not seem to return anything.

Any help would be very much appreciated! (I should say I have been using git - without being an expert - for a number of years, but I did not work on the specific bitbucket repo for maybe a year).


Answers:
author: Patrik S
body: Hello [@christie_vas](/t5/user/viewprofilepage/user-id/5257056) and welcome to the community!

The **git fetch**command will return no output when your local repository is up to date with the remote. If the command is completed with no errors and no output, it likely means that it was able to successfully connect to Bitbucket and verify the local branch already contains all the changes from the remote repository

You can try to use **git pull** instead, which will output the message "*Already up to date*" if the repository is in sync with the remote.

Another option, if you want to test that the SSH key was setup correctly, is to clone the repository again to a different folder :

```
git clone git@bitbucket.org:WORKSPACE/REPOSITORY.git
```

Hope that helps! Let me know in case you run into any issues.

Thank you, [@christie_vas](/t5/user/viewprofilepage/user-id/5257056) !

Patrik S

comments: author: christie_vas
body: Thanks a lot Patrik. My phrasing was wrong, I did not mean "it does not return anything" as in it gives me back the command line or an "already up to date" notification, I meant it does not give anything, as in the process does not finish.

This morning this was fixed, I suspect it was because I added the newest key to the known-host file. Many thanks!


Tags: bitbucket-cloud

cloud
Unable to create a work space
Asked by gowtham reddy:

Unable to create a work space. Anyone else facing same issue..!


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

We would need to know the error in order to be able to better help you.

Could you please share a screenshot that shows the error you get when you try to create a workspace?

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Why /rest/api/1.0/migration REST isn't working (returns nothing)?
Asked by Gal Zemah:

Unfortunately, all sub RESTs of /rest/api/1.0/migration API isn't working for me.   
For example, this API: /rest/api/1.0/migration/exports/preview.  
I'm trying with this query:

```
curl -u MyUserCredentials -X POST -H 'Content-type:application/json' -d '{"repositoriesRequest":{"includes":[{"projectKey":"*","slug":"*"}]}}' https://myHostName:8443/rest/api/1.0/migration/exports/preview | jq
```

But nothing returns.

Other RESTs works fine, and seems that there is no issue with the REST syntax (because was few and all resolved).

**Any idea please?**


Answers:
author: Gal Zemah
body: On Windows environment, must to change all one quote to double quotation marks, and the inner double quotation marks should be wrapped with \\.


Tags: bitbucket-server

export

migration

rest-api
Temporarily allow SSH access with SHA256?
Asked by Nathan Caldwell:

Bitbucket recently updated their SSH host keys, as detailed here: <https://bitbucket.org/blog/ssh-host-key-changes>

My team has a custom application that regularly pulls from a Bitbucket repo, and a lot of our PCs use SSH to do so.

Due to an oversight by my team, we did not update the known hosts for those PCs before the key rotation took place on June 20. As a result, all the PCs that use SSH can no longer update from the repo. They get a message that says "Remote host identification has changed" and "Fatal: Could not read from remote repository." We would like to update our application to automatically add the new keys to known_hosts, but since the application's binary files also exist in that repo, there is currently no way for us to automatically update all PCs.

Is there a way to temporarily bypass this in our repo, maybe by temporarily allowing access with SHA256? That way we can update our application so it adds the new key to known_hosts. Afterward, we can re-enable the feature that blocks access with SHA256.

Alternatively, if people have a better suggestion, please let me know.


Answers:
author: Theodora Boudale
body: Hi Nathan!

I'm not sure what you mean by "access with SHA256". Are you referring to the RSA host key of Bitbucket Cloud?

Even though we introduced two new host keys using the ECDSA and Ed25519 algorithms, we still have an RSA host key.

However, the RSA host key was replaced with a new one on 20th June 2023. It will not be possible for a client to establish the authenticity of Bitbucket Cloud using the old RSA key since it is no longer there. The known hosts for these PCs will need to be updated so that they can connect to Bitbucket Cloud.

If you are using OpenSSH or a compatible client, you can follow the instructions on the blog on how to update the known hosts.

We also have the following FAQ page that has some questions and answers about some other SSH clients:

* <https://confluence.atlassian.com/bbkb/bitbucket-cloud-ssh-host-key-rotation-faq-1235851234.html>

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
email-notify : variable commit
Asked by Pierre KUHN:

Hello everyone, I'm starting to use the email-notify pipe. I am looking for variables to retrieve the text of commit in order to compose the text of the mail. Where can I find them? THANKS


Answers:
author: Igor Stoyanov
body: [@Pierre KUHN](/t5/user/viewprofilepage/user-id/5256502) hi. Take a look at the [get commit Bitbucket Cloud REST API](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commit-commit-get).  

Regards, Igor

comments: author: Pierre KUHN
body: Thanks Igor,  

I would have to make this type of content:

image: atlassian/default-image:3

pipelines:  
default:  
- step:  
name: 'Deployment to Production'  
deployment: production  
trigger: 'automatic'  
script:  
- pipe: atlassian/email-notify:0.8.0  
variables:  
USERNAME: $USERNAME  
PASSWORD: $PASSWORD  
FROM:  
TO:  
HOST:  
# PORT: '\<string\>' # Optional.  
# TLS: '\<boolean\>' # Optional.  
SUBJECT: $MESSAGE  
# BODY_PLAIN: '\<string\>' # Optional.  
# BODY_HTML: '\<string\>' # Optional.  
# ATTACHMENTS: '\<string\>' # Optional.  
DEBUG: 'true'


Tags: bitbucket-cloud

cloud

email
Rest API filter tags
Asked by Rio De Sousa:

Hi there!

All of my commits into main are tagged with their build number. eg build-1.0.2589

My prod env will always be a few commits behind dev, as new features get tested.  
So for eg. prod = build-1.0.2539 and dev = build-1.0.2583. I am trying to get all the tags that are between prod and dev. So something like this:

<https://api.bitbucket.org/2.0/repositories/{workspace}/{repo}/refs/tags?q=name>\>="build-1.0.2539"\&sort=-name

Which should ideally return all those tag objects between dev and prod. Perhaps I should be filtering by date rather?  

Thank you!


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

You can filter by name with the operators \>= will like this:

```
https://api.bitbucket.org/2.0/repositories/{workspace-id}/{repo}/refs/tags?q=%28name+%3D+%22build-1.0.2539%22+OR+name+%3E+%22build-1.0.2539%22%29
```

The query, without URL encoding, is (name=build-1.0.2539 OR name\>build-1.0.2539)

Please keep in mind though that the name is a string and not a numeric value. If we assume that only the last 4 digits of the tag's name change, filtering like this should give you what you want up until the tag build-1.0.9999.

When you reach the tag build-1.0.10000 and the name in the API query is e.g. build-1.0.9960, then the API query won't return the tag build-1.0.10000.

Filtering by date sounds better for what you want to achieve, but it would need to be done on client side as this endpoint does not support filtering by date at the moment. We have a feature request that you can vote for to express your interest:

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

Kind regards,  
Theodora

comments: author: Rio De Sousa
body: Hey Theodora. Yeah I think it makes much more sense to do the filtering on my end. Thanks for the help! All the best


author: Rio De Sousa
body: Another option would be to just do the filtering on the client side, if there is no other way to do it through the url.


Tags: api

bitbucket-cloud

cloud

filter

rest-api
api to download artifacts
Asked by Litan:

Is there any api to download pipeline artifacts. In my scenario I am generating an android .apk in one repo and trying to use this .apk in appium test which is in another repo.


Answers:
author: Aron Gombas _Midori_
body: Your pipeline is executed in a short-living Docker container which is dropped when the pipeline finishes. So if your artifacts are written to the container's filesystem, those will be lost.

We were a similar position like you, we needed to save the results of the pipeline and make downloadable by human users.

We did this:

1. During the pipeline execution, after the artifacts are produced, we [create Bitbucket downloads](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-downloads/) from those using the REST API. It is super-easy. We use a timestamp as suffix of the artifact's filename.
2. Then if someone needs an artifact, he can go and download it any time.
3. (Because we produce a lot of these artifacts, the pipeline will even delete those downloads that are older than N days, so we always have the artifacts produces in the last N days.)

It works fine and it has been stable for many years.


Tags: bitbucket-cloud

cloud
Bitbucket pipelines pipe atlassian/kubectl-run in self hosted linux docker runner.
Asked by Tibor Kadar:

I am trying to connect to a local kubernetes running on the same machine as the bitbucket pipeline self hosted runner.   

I am using the linux docker runner.  
On the same machine I have a minikube running.  
Added the kubeconfig to the repository variables encoded base64. In the kubeconfig file I edited the server url to point to <http://host.docker.internal:9100> (port on which my kubernetes cluster works)  

Is it possible that the docker container running the pipe does not see the actual host.docker.internal?  

How could I connect it to a local kubernetes?  

![Screenshot 2023-06-29 at 09.46.37.png](https://community.atlassian.com/t5/image/serverpage/image-id/265699iB7A7CFA028C531A1/image-size/large?v=v2&px=999 "Screenshot 2023-06-29 at 09.46.37.png")


Answers:
author: Yevhen
body: [@Tibor Kadar](/t5/user/viewprofilepage/user-id/5256259) have you tried kubernetes svc directly? <https://kubernetes.svc.cluster.local>? This will work though only if the runner is in the same cluster.

comments: author: Tibor Kadar
body: Thanks for pointing me in this direction!


author: Tibor Kadar
body: This setup would require me to have the runner running in the kubernetes cluster as well. Which at the moment I would keep separate.   

A workaround that I used was to not use the pipe but actually download kubectl in the script section. Since the step runs in a docker container on the host machine it would see the host.docker.internal and I could connect.


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

kubernetes
Optional an Economical https://developer.crowdin.com/api/v2/#operation/api.projects.files.getMany Wi
Asked by Aries Triputranto:

" Optional "

{

"data": {

"id": 4,

"projectId": 2,

"branchId": 34,

"directoryId": null,

"name": "main",

"title": "\<Description materials\>",

"exportPattern": "/localization/%locale%/%file_name%",

"path": "/main",

"priority": "normal",

"createdAt": "2019-09-19T14:14:00+00:00",

"updatedAt": "2019-09-19T14:14:00+00:00"

}

}


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

I think you are in the wrong place; your question does not seem to be about an Atlassian system. I suspect you have clicked on "help with the system in use for documentation or issue tracking" instead of "help with the product".


Tags: bitbucket-cloud

cloud
How to restore Bitbucket Pull Requests data from a PostgreSQL backup
Asked by Mike Quentel:

Recently, there was a server crash that corrupted a repo in Bitbucket (self-hosted server edition running on CentOS 7). Eventually, using the Bitbucket user interface, I re-created the repo, which deleted everything from the old version, including Pull Requests (PRs).

Then, I also successfully restored the commit history from existing objects on the server and copies of objects from users. Example:

```
$BITBUCKET_HOME/shared/data/repositories/$REPO/objects/XX/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

I have a backup of the server where PostgreSQL held PRs. The new repo is currently in use, and has new PR data in its corresponding PostgreSQL table. I would like to be able to restore the missing rows of data pertaining to PRs into the current PostgreSQL database.

Using SQLectron, I can see there is a table

```
"public"."sta_pull_request"
```

that appears to have PR data. I also see similar tables that appear to have PR data.

Does anyone know what tables I should examine and use for restoring the PR data? Also, open to other advice on the approach here.

Many thanks.


Answers:
author: Mike Quentel
body: Per [Investigating Bitbucket Server Database Schema](https://confluence.atlassian.com/bitbucketserverkb/investigating-bitbucket-server-database-schema-779171612.html) I downloaded [DBVisualizer](https://www.dbvis.com) which has built-in graphing functionality showing a diagram for the Bitbucket database. This at least points me in the right direction.

Screenshot of the diagram in DBVisualizer:

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

Also see

<https://developer.atlassian.com/server/jira/platform/database-schema/>


Tags: bitbucket-server

server
Usage of the default bitbucket-pipelines user in atlassian/email-notify:0.8.0 Pipe
Asked by Karthik Arun R:

I would like to use the default bitbucket user account to send out an email using the atlassian/email-notify:0.8.0 pipe in after-script section of my BitBucket pipeline.

I have tried sending emails out from my organization-provided Microsoft accounts but there are firewalls blocking it. I do not have any email server to send out such emails from the pipeline.

If I can leverage the default pipeline emailer (notifications-noreply@bitbucket.org) for this purpose it'd be great. Or any in-house email system that doesn't require any authentication other than a BitBucket Username and App Password would suffice.

Suggestions are welcome!


Answers:
author: Patrik S
body: Hello [@Karthik Arun R](/t5/user/viewprofilepage/user-id/5122050) and welcome to the community!

I'm afraid it's not possible to configure the atlassian/email-notify:0.8.0 to send emails on behalf of the bitbucket default email user (notifications-noreply@bitbucket.org).

In order to use this pipe, you will need to have your own email server or use a third-party provider of your preference such as Gmail, Outlook, Yahoo,etc, that allows you to create a free email account.

Essentially, the pipe works by connecting to the SMTP server provided in HOST variable and triggering the send of an email. This connection with the SMTP server requires authentication, which is configured differently depending on the mail provider you are using. Since the authentication is with the SMTP server, bitbucket username and app password are not applicable, and instead you will need to use the SMTP credentials you have configured on the mail provider end.

You can find more details on how to configure the atlassian/email-notify pipe using the official documentation :

* [https://bitbucket.org/product/features/pipelines/integrations?\&p=atlassian/email-notify](https://bitbucket.org/product/features/pipelines/integrations?&p=atlassian/email-notify)

In that documentation you will also find links to some common email providers' docs with instructions and how to set them up.

Thank you, [@Karthik Arun R](/t5/user/viewprofilepage/user-id/5122050) !

Patrik S


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

email

notification
Moving my local source files to Bitbucket repository
Asked by Seshadri Ramaswami:

I have two copies of my programs, one in a Mac laptop and another in an Ubuntu machine. To eliminate inconsistency, I want to copy these programs to my Bitbucket repository and subsequently work only on this to ensure version control and consistency. How do I copy the set of source files from (a) Ubuntu machine and (b) Mac laptop?


Answers:
author: Jens Schumacher - Released_so
body: Sure, there are a few ways to copy the set of source files from your Ubuntu machine and Mac laptop to your Bitbucket repository.

**(a) Ubuntu machine**

1. Open a terminal window.
2. Navigate to the directory where the source files are located.
3. Run the following command to clone the repository:

    git clone git@bitbucket.org:your_username/your_repository.git

4. The repository will be cloned to a new directory called `your_repository`.

**(b) Mac laptop**

1. Open a terminal window.
2. Navigate to the directory where the source files are located.
3. Run the following command to clone the repository:

    git clone https://bitbucket.org/your_username/your_repository.git

4. The repository will be cloned to a new directory called `your_repository`.

Once the repository has been cloned, you can start working on it locally. Any changes you make to the files will be automatically tracked by Git. When you are ready to push your changes to the remote repository, you can run the following command:  

    git push origin master

This will push your changes to the `master` branch of the repository on Bitbucket.

To ensure version control and consistency, you should always work on the `master` branch of your repository. If you need to create a new branch, you can do so by running the following command:  
Code snippet

    git checkout -b new_branch

Once you have created a new branch, you can work on it independently of the `master` branch. When you are ready to merge your changes back into the `master` branch, you can run the following command:  

    git merge new_branch

This will merge the changes from the `new_branch` branch into the `master` branch.

I hope this helps! Let me know if you have any other questions.


Tags: bitbucket-cloud

cloud
Can't log into BitBucket
Asked by Mark Catley:

I can't log into bit bucket. I've tried Firefox and Safari on my mac.

<br />

I can log into id.atlassian.com but when I hit the bitbucket button I get "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."

I have no issues logging into trello the same way.

I've tried incognito mode and clearing the cookies as suggested on the community but nothing seems to work. It is a very old bitbucket account that I probably haven't logged into for 5 years or so - perhaps that's the issue? Can anyone help?


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

Welcome to the Bitbucket Cloud community! :)

I've had a look at your workspace and could see that it was marked as DORMANT due to a long period of inactivity. I've just removed this flag from the account so you should be able to log in now without any issues.

Can you please check and verify this for me?

Cheers!

- Ben (Bitbucket Cloud Support)

comments: author: Mark Catley
body: Thanks, it works now.


Tags: bitbucket-cloud

cloud
Bitbucket Pipeline
Asked by Rajat Roy:

Just like we have Bitbucket pipeline available in Bitbucket cloud , do we have this feature available in any version of Bitbucket datacentre ?

Thanks


Answers:
author: Christian Glockner
body: Hi Rajat,  

pipelines is a Cloud-only feature.

Cheers,  
Christian  

Premier Support Engineer  
Atlassian

comments: author: Rajat Roy
body: Thanks for confirming Christian !!!


Tags: bitbucket-server

server
I want to install PlantUml Viewer but it is not available in the marketplace
Asked by fkhan-mbl:

I would like to install the PlantUML Viewer plugin to my personal bitucket cloud instance but it is not available in the marketplace

[https://marketplace.atlassian.com/apps/1220172/bitbucket-plantuml-viewer?tab=support\&hosting=cloud](https://marketplace.atlassian.com/apps/1220172/bitbucket-plantuml-viewer?tab=support&hosting=cloud)


Answers:
author: Patrik S
body: Hello [@fkhan-mbl](/t5/user/viewprofilepage/user-id/553284) and thank you for reaching out to Community!

The PlantUML Viewer app is developed and supported by a third-party, so I would recommend reaching out to the vendor of that App, as there's likely some setting in the app that is preventing it to be correctly listed in the workspace's Marketplace.

You should be able to submit a support request to the developers of that app using [this link](https://github.com/kylec32/bitbucketplantumlviewer/issues).

Thank you, [@fkhan-mbl](/t5/user/viewprofilepage/user-id/553284) !

Patrik S


Tags: bitbucket-cloud

cloud
Monitoring the limit of my build minutes
Asked by Kurt Riveros:

Hello guys,

I have a question about how I can monitor the limit of the build minutes in my bill period. Maybe get a notification mentioning when time is low or something like that.  
Some previous month we went over the minute limit by far and billing was a problem.  
Can someone help me with this, please?


Answers:
author: Theodora Boudale
body: Hi Kurt and welcome to the community.

Pipelines minutes usage shows in the **Plan details** page of the workspace's settings:

* <https://bitbucket.org/workspace-id/workspace/settings/plans-and-billing>

Replace **workspace-id** in the URL with the id of your workspace. You can view this page if you are an admin of the workspace, and you can see there how many build minutes have been used in the current billing period and how many minutes remain.

I'm afraid it is not possible to send notifications warning of a low limit at the moment.

We have a feature request for sending such an email based on a user-configured threshold:

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

I would suggest adding your vote to that feature request (by selecting the **Vote for this issue** link) as the number of votes helps the development team and product managers better understand the demand for new features. You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the **Start watching this issue** link) if you'd like to get notified via email on updates.

Implementation of new features is done as per our policy [here](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html) and any updates will be posted in the feature request.

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

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud