youngmon/atlassian-qna huggingface dataset:
How should I start a Windows Runner without needing to keep the host terminal open?
Asked by Gabe Klavans:

After following the instructions to start up a Windows runner, I noticed that the \`start.ps1\` script runs in the foreground, and ends if I close the terminal session that started it. I'd like to be able to start this script without needing to keep the terminal open, more specifically to start it over SSH.

What is the recommended way to do this? I've tried using \`Start-Job\` in Powershell 7.3.4, but I get the following error:

```
OpenError: [localhost] There is an error processing data from the background process. Error reported: [2023-05-02 16:08:53,453] Runner version: 1.463.
```


Answers:
author: Patrik S
body: Hello [@Gabe Klavans](/t5/user/viewprofilepage/user-id/5209739) ,

Just adding to [@Erez Maadani](/t5/user/viewprofilepage/user-id/5018344) response, currently Windows runners are not natively packaged to run as a Windows service, and we do have a feature request to implement this functionality :

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

I would encourage you to add your **vote** to that ticket and also mark yourself as a **watcher** to receive first-hand updates.

While that feature is not implemented, you can make use of a third-party WinSW wrapper to encapsulate the runner script and run it as a Windows service. You can find detailed instructions on how to achieve that in the below article :

* [Bitbucket Cloud Pipelines - Setup runners for Windows as a Windows service](https://confluence.atlassian.com/bbkb/bitbucket-cloud-pipelines-set-up-runners-for-windows-as-a-windows-service-1223821219.html)

By using the service wrapper, you will not be required to keep the user session alive on the host, as the runner will be executed in the background. You can try to follow the instructions in that article and let us know how it goes.

Thank you, [@Gabe Klavans](/t5/user/viewprofilepage/user-id/5209739) !

Patrik S

comments: author: Gabe Klavans
body: Awesome, thank you for the article. I'll try it out.


author: Gabe Klavans
body: The steps were fairly simple and work great! I did have to make sure my machine-wide script execution policy was set to Unsigned so the runner could clone the repo, but that was straight-forward enough from the pipeline execution errors.

Thanks again


author: Erez Maadani
body: Hi [@Gabe Klavans](/t5/user/viewprofilepage/user-id/5209739)

This might help: <https://community.atlassian.com/t5/Bitbucket-questions/Start-and-restart-Windows-self-hosted-runner-automatically/qaq-p/2158834>

comments: author: Gabe Klavans
body: Yeah I did see that post. It looks pretty manual, basically bypassing Atlassian's script. I figured there would be some way recommended by Atlassian themselves to do this considering it's kind of a huge wall to have to keep a session alive for as long as you want the runner to stay up over SSH, or need graphical access to spawn a terminal to keep it up.

But I suppose I can follow that method if things get cumbersome enough.


Tags: bitbucket-cloud

bitbucket-runners

cloud
Snippets, filter by : All - Page change causes crash
Asked by Olivier Doyon-Karout:

Hi there,

When I go from this page (Snippets page + Filter by : All)  
**<https://bitbucket.org/nomadis/workspace/snippets/?status=all>**

and try to go on another page (Let's say page 4)  
**<https://bitbucket.org/nomadis/workspace/snippets/?page=4>** I get the **Resource not found** error message  

Using this URL manually works.  
**[https://bitbucket.org/nomadis/workspace/snippets/?status=all\&page=4](https://bitbucket.org/nomadis/workspace/snippets/?status=all&page=4)**

Any ideas?  

EDIT:  

For anyone having the issue, a bug was opened but from the comment it seems Altassian was not able to reproduce it and needs you to contact them:  
''  
[Stanislav Kudriashev](https://jira.atlassian.com/secure/ViewProfile.jspa?name=f0106c630e05) added a comment - [09/Mar/2023 6:34 AM](https://jira.atlassian.com/browse/BCLOUD-22528?focusedCommentId=3257683&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-3257683)  
We tried to reproduce this issue but were unable to given the steps provided. If this is still a problem, please file a support request at [support.atlassian.com/contact](http://support.atlassian.com/contact) and share with us the affected repository and detailed steps to reproduce this issue. Our support engineers will work with you to gather additional details and communicate the next steps as applicable.

Thanks!''

<br />

<br />

<br />


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

This is a bug, we have an open bug report about this issue here:

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

You can add your vote to it and add yourself as a watcher if you'd like to get notified via email on updates. Our development team tracks bugs over there and will post an update on that issue when this is fixed. Please note that we don't provide ETAs and bug fixing is implemented as per our policy [here](https://confluence.atlassian.com/support/atlassian-cloud-bug-fix-policy-206865884.html).

Until this is fixed, you can manually navigate to the page URL, as you have already figured out.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud

jira
Unable to locate package git-ftp
Asked by shuvo47:

![Screenshot 2023-05-02 at 7.25.34 PM.png](/t5/image/serverpage/image-id/254838i9589CF08D0F2048C/image-size/large?v=v2&px=999 "Screenshot 2023-05-02 at 7.25.34 PM.png")


Answers:
author: Ben
body: G'day!

May I please know what image you are trying to use (if public, if not let me know the base image) so that I can attempt to reproduce this issue from my end?

I would suggest as a first step to use the :latest tag next to your image just in case it is out-of-date

For example, if you were using the node image it would be:

```
image: node:latest
```

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Pipeline with apt update started to fail
Asked by Matt Bielawski:

We started receiving the below error end of last week from the apt update step. Note our pipeline didn't change:

+ apt update  
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.  
Ign:1 <http://deb.debian.org/debian> stretch InRelease  
Ign:2 <http://security.debian.org/debian-security> stretch/updates InRelease  
Ign:3 <http://deb.debian.org/debian> stretch-updates InRelease  
Err:4 <http://deb.debian.org/debian> stretch Release  
404 Not Found \[IP: 146.75.34.132 80\]  
Err:5 <http://deb.debian.org/debian> stretch-updates Release  
404 Not Found \[IP: 146.75.34.132 80\]  
Err:6 <http://security.debian.org/debian-security> stretch/updates Release  
404 Not Found \[IP: 146.75.34.132 80\]  
Reading package lists...  
E: The repository '<http://deb.debian.org/debian> stretch Release' does not have a Release file.  
E: The repository '<http://deb.debian.org/debian> stretch-updates Release' does not have a Release file.  
E: The repository '<http://security.debian.org/debian-security> stretch/updates Release' does not have a Release file.

Our pipeline was running successfully prior to last week. Below is a snippet of our pipeline. Has anyone encountered this issue and resolved it?

- step:  
image: maven:3.6.1  
caches:  
- maven  
name: Build and Run Unit Tests  
script:  
- cp settings.yaml $BITBUCKET_CLONE_DIR/src/main/resources/settings.yaml  
- cp appSettings.yaml $BITBUCKET_CLONE_DIR/src/main/resources/appSettings.yaml  
- cp settings.xml \~/.m2/settings.xml  
- apt update  
- apt install jq -y


Answers:
author: Erez Maadani
body: Hi [@Matt Bielawski](/t5/user/viewprofilepage/user-id/4886549)

I think this might help: <https://community.atlassian.com/t5/Bitbucket-questions/Recently-Pipeline-apt-get-update-Fails/qaq-p/2340127#M93155>

comments: author: Matt Bielawski
body: Hi Erez, thank you for the suggestion. We are looking to take a similar action and are still reviewing what version of maven to update to


author: Matt Bielawski
body: What we found is that is that Debian 9/stretch moved to archive.debian.org  
++For a short term solution:++   
We will point apt to the archived version by adding the following line before the apt update line in our pipeline:  
echo "deb <http://archive.debian.org/debian> stretch main" \> /etc/apt/sources.list  

We found this solution here: <https://unix.stackexchange.com/questions/743839/apt-get-update-failed-to-fetch-debian-amd64-packages-while-building-dockerfile-f>

++For our Long term solution:++   
We will look for a newer version of the maven image that supports an updated version of apt

comments: author: Khalid Khushal
body: Thank you [@Matt Bielawski](/t5/user/viewprofilepage/user-id/4886549) , saved my day!


Tags: bitbucket-cloud

cloud
Can I stream a video from my bitbucket repository
Asked by Richard O_Brien:

Hi,

I have a short training video in my bitbucket repository.

Ideally, I would like to be able to share the bitbucket/video URL to team members to allow them to view the video without them needing to download the video.

Therefore, does bitbucket support this streaming function?

Thanks,

Richie.


Answers:
author: Aron Gombas _Midori_
body: There is no such feature in Bitbucket. I don't even know about an app that provides that.

If video streaming is critical to you, then there are much better-fitting platforms for that. It is a bit like using a screwdriver as a hammer.

comments: author: Richard O_Brien
body: Thanks for the reply.

I'm using Bitbucket for many functions...hosting a video file that could be streamed by the team would have been handy but I can implement another solutions for that now.


Tags: bitbucket-server

server
Deploy to environments in any order
Asked by Ernesto Perez:

Hello everyone!

We have several Staging and Production environments, in different regions, and the versions we deploy on each region could be completely different.

In the image below you can find how we want to deploy:

![Screenshot 2023-05-02 at 11.25.52.png](https://community.atlassian.com/t5/image/serverpage/image-id/254811iED6A587FDBC57A01/image-size/large?v=v2&px=999 "Screenshot 2023-05-02 at 11.25.52.png")

As you can see in the image above, for each version that is built in QA, we want to choose if we want to deploy it in Staging-EU, Staging-US, or Staging-Asia. And then, from that environment, it will go to its corresponding Production environment, in the same region.

Unfortunately, we are struggling to handle something like that with the current implementation of the Bitbucket Pipelines and Deployments, because it forces us to deploy/promote the same version in all Staging environments before going to Production.

In other words, it forces us to deploy in this way: QA -\> Staging-EU -\> Staging-US -\> Staging-Asia -\> Prod-EU -\> Prod-US -\> Prod-Asia.

The only solution we have found is to create a different branch per region: EU, US, ans Asia, and merge from master to those brances. But the solution looks over complicated to me.

Is there a better way to implement this?

Thanks in advance.

Ernesto.


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

If you have a pipeline with seven steps (QA, and six for the Staging and Production regions), there is no way to skip a step in the middle and execute another one that comes after that.

We have a feature request for the ability to skip a step in a pipeline that you can vote for  
(by selecting the **Vote for this issue** link) to express your interest:

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

<br />

Another approach would be to create three custom pipelines, one per region, each one with a Staging step and a Production step:

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

You could then trigger manually the custom pipeline for the region you want.

Custom Pipelines do not run automatically when you push to a certain branch. They can be triggered manually in one of the following ways:

1. From the **Pipelines** page of the repo, option **Run pipeline** (near the top right corner)  

2. From the **Branches** page of the repo, if you select the three dots in **Actions** for a certain branch and then **Run pipeline for a branch**
3. While viewing a commit's details from the **Commits** page \> **Run pipeline** (at the right sidebar)  

4. You can also trigger a custom pipeline using our API:  

   <https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-post>  

5. You can create a schedule for a custom pipeline:  

   <https://confluence.atlassian.com/bitbucket/scheduled-builds-for-pipelines-933078702.html>  

Would something like that work for you?

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
How to create a 'n' no of parallel step based on user input ?
Asked by oboe_ada:

i have one parameter called number_of_org that is used to create n number of scratch org parallely .how based on the user input for eg:if 4 i want to create run commands that create 4 scratch parallely .  
so , i want to create n no of step that run parallely?


Answers:
author: Patrik S
body: Hello [@oboe_ada](/t5/user/viewprofilepage/user-id/5208966) ,

Welcome to the Atlassian Community!

My understanding of your requirement is that you would like to programmatically generate pipelines parallel steps based on the user input. I'm afraid this is not currently possible in Bitbucket Pipelines.

One option, in case you need to repeat sections of your yml file, is to use **YML anchors.**With anchors, you can define a "template" of the step and can re-use it multiple times in the rest of your YML file :

```
definitions: 
  steps:
    - step: &build-test
        name: Build and test
        script:
          - mvn package
        artifacts:
          - target/**
?
pipelines:
  branches:
    develop:
      - step: *build-test
    main:
      - step: *build-test
```

In the example above we are defining an anchor step named **build-test**which acts like the "template", and then we can reference it in the pipeline definition multiple times without having to repeat the entire step's code.

For more details about how to use anchors, you can refer to our documentation [YAML Anchor - Bitbucket Pipelines](https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/).

Thank you, [@oboe_ada](/t5/user/viewprofilepage/user-id/5208966) !  
Patrik S

comments: author: oboe_ada
body: Thank you [@Patrik S](/t5/user/viewprofilepage/user-id/4603309)


Tags: bitbucket-cloud

cloud
How to achieve partial deployments using bitbucket pipelines
Asked by NIKHILESH:

In lower environment ,if 10 US moved from DEV to SIT using bitbucket pipeline after merging Pr's.

But 7 are passed/approved , and only those 7 needs to move/merged in higher environment . What is the best practice to achieve this in bitbucket


Answers:
author: Theodora Boudale
body: Hi [@NIKHILESH](/t5/user/viewprofilepage/user-id/5208459) and welcome to the community.

I'm not sure I understand your use case. What are US, DEV, and SIT? Could you also please provide some more details on your workflow, how you have pipelines configured now, and what you mean by partial deployment?

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Is there a way to access old mercurial repos?
Asked by eyath-it:

Hello everybody,

It's been years since I last accessed my bitbucket repos and when I tried I realised that I no longer can see my mercurial repos. Is there a way to regain access to them? I don't have any paid subscription.

Thanks for the help in advance!


Answers:
author: Ben
body: G'day!

Unfortunately, Mercurial repositories are no longer accessible as they have all been completely removed/deleted from our platform.

++**Timeline**++

* Back in 2019, we announced [sunset of Mercurial repositories](https://community.atlassian.com/t5/Bitbucket-articles/What-to-do-with-your-Mercurial-repos-when-Bitbucket-sunsets/ba-p/1155380) with our customers.
* On August 26, 2020 in our public blog post the team then [announced that Mercurial repos](https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket) will no longer be available for access.   
  "Mercurial features and repositories will be officially removed from Bitbucket and its API on July 1, 2020"
* As of March 30, 2022 support no longer exists for restoring and uploading these repositories as they have been officially deleted after a 2-year customer grace period

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Cant add ssh keys
Asked by Yura:

Hi  
When i add my ssh key to workspace, sees this message:

"Someone has already added that key as an access key to a repository."


Answers:
author: Nic Brough -Adaptavist-
body: There's no easy way to work this out because the keys that belong to other accounts should not be shared.

If you shared the key with someone or used it with a different account, you should already know who it is. If someone gave you the key, you will need to ask them.

If you have no luck chasing it down, you can raise a support request with Atlassian, and they can search out the key for you and identify the account you shared it with.

If you don't want to spend ages chasing down the share, you can (and should) create a new key for your account and use that instead.

For a better explanation, see Theodora's answer on [![](https://community.atlassian.com/html/@D429FEBDA9386F85E874453DCFFCC546/assets/favicon-16x16.png)Problem adding SSH key: "Someone has already added that key as an access key to a repository."](https://community.atlassian.com/t5/Bitbucket-questions/Problem-adding-SSH-key-quot-Someone-has-already-added-that-key/qaq-p/2166987)

I deleted your public key from this posting, to try to prevent it being copied and misused.


Tags: bitbucket-cloud

cloud
Unable to login to bitbucket
Asked by Ravi:

Hi Team,

I am not able to login to my account using my gmail id (\<email_removed\>). Please do the needful. I tried to login with different browsers i am getting the same issue.


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

You will need to talk to the administrators of your Bitbucket, we, the community, are not they, and we don't have any access to it.


author: Theodora Boudale
body: Hi [@Ravi](/t5/user/viewprofilepage/user-id/5208328) and welcome to the community!

Your Bitbucket Cloud account was inactive. I went ahead and reactivated it, so you should be able to log in now.

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

Kind regards,  
Theodora


author: Ash Yadav
body: Hi [@Ravi](/t5/user/viewprofilepage/user-id/5208328)

Can you share a screenshot and/or error message you're seeing upon login?

KR,

Ash


Tags: bitbucket-cloud

cloud
Someone has already added that key as an access key to a repository.
Asked by Muhittin:

It gives me this error when i try to add my ssh key to bitbucket  
Someone has already added that key as an access key to a repository.


Answers:
author: Nic Brough -Adaptavist-
body: There's no easy way to work this out because the keys that belong to other accounts should not be shared.

If you shared the key with someone or used it with a different account, you should already know who it is. If someone gave you the key, you will need to ask them.

If you have no luck chasing it down, you can raise a support request with Atlassian, and they can search out the key for you and identify the account you shared it with.

If you don't want to spend ages chasing down the share, you can (and should) create a new key for your account and use that instead.

For a better explanation, see Theodora's answer on [![](https://community.atlassian.com/html/@D429FEBDA9386F85E874453DCFFCC546/assets/favicon-16x16.png)Problem adding SSH key: "Someone has already added that key as an access key to a repository."](https://community.atlassian.com/t5/Bitbucket-questions/Problem-adding-SSH-key-quot-Someone-has-already-added-that-key/qaq-p/2166987)


Tags: bitbucket-cloud

cloud
Workaround for secure variables not substituted correctly
Asked by Sebastian Hens:

Hello!

I'm trying to build a docker container and for that I defined a number of build args for it so data like a DB connection string is secured in the bitbucket repository per deployment (Test, Stage, Production). I noticed that the variables are not substituted.

Take this simplified version:  

```
docker build -t test:dev-1 -f ./Dockerfile --build-arg DATABASE_URL=$CI_DB_URL . 
```

<br />

**CI_DB_URL** is a secure value for my deployment **Test**. The container build will fail because it verfies the db connection and don't have a working value because it will get a "$CI_DB_URL" as a string instead of the substituted CI_DB_URL variable value.  
I tested my own integration with a not secured value and this worked like expected. But I would prefer a secure value instead.  
Does anyone know about this issue and how I can work around this?  
Cheers,  
Sebastian


Answers:
author: Mark C
body: Hi [@Sebastian Hens](/t5/user/viewprofilepage/user-id/5207650),

Welcome to the community.

Would it be possible for you to confirm if you've declared the variable **DATABASE_URL** as **ARG** in your Dockerfile?  

For example:

```
ARG DATABASE_URL
```

Regards,  
Mark C

comments: author: Sebastian Hens
body: Hi [@Mark C](/t5/user/viewprofilepage/user-id/1210823)

thanks for your responds.

Yes I can confirm that. Something I also tried was writting the variable values into a .env file and copy that file with the other project files into the Dockerfile. After building the image I can confirm that in the .env file also just $CI_DB_URL is written and not the actual value.

```
echo "DATABASE_URL=$CI_DB_URL"?>> .env
```

The above code line works when I use a not secured variable in bitbucket for CI_DB_URL but not if it is a secure variable.

Regards,

Sebastian


author: Mark C
body: Hi [@Sebastian Hens](/t5/user/viewprofilepage/user-id/5207650)  

I actually tried following [this KB](https://confluence.atlassian.com/bbkb/passing-ssh-key-variable-from-bitbucket-pipelines-to-a-dockerfile-1155481742.html) on essentially doing a similar example where I'm passing a secured variable to a Docker container.  

Although Pipelines didn't print the secured variable value on my Pipelines build logs, I'm able to use it in a Docker container within Pipelines while cloning a repository.  

This means the secured variable should work as expected.  

Could you try to use different environment variable names and see how it goes?  

Regards,  
Mark C  

<br />


Tags: bitbucket-cloud

bitbucket-pipelines

cloud