youngmon/atlassian-qna huggingface dataset:
How do I switch the Windows runner to use PowerShell 7?
Asked by Mattias Vannerg?rd:

In the argument list of runner.jar, there is

-Dbitbucket.pipelines.runner.runtime=windows-powershell

How do I get the runner to execute in PowerShell 7?


Answers:
author: Mateus T
body: Hi [@Mattias Vannerg?rd](/t5/user/viewprofilepage/user-id/4637154)

Thank you for reaching out to the Atlassian Community!

Currently, Windows runners will always use the same version of PowerShell as the path to the executable is hardcoded into the runner. I can see how having the ability to specify the version could be helpful, so in order to address this, I've raised the following Feature Request with our development team:

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

Our development team will give a first-hand update through that ticket if there's any progress made so I would suggest keeping a watch for it. Please note that all enhancements are implemented with this [policy](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html) in mind.

In the meanwhile, you can work around this by switching the hardcoded path to have the new desired PS version locally. You can find all the detailed steps on how to achieve this inside the Feature Request.

Cheers,

Mateus T


Tags: bitbucket-cloud

cloud

windows
Is there a way to deploy laravel app through pipelines to AWS using ssh and Git Pull?
Asked by Jeffrey Jacobo:

I plan to deploy the master branch onto the AWS EC2 instance by using ssh and git pull to retrieve the resource merged in the master branch and update the resources on EC2.

so the script goes as :  
**apt-get install -y ssh**  
**ssh -i user@ipaddress**  
**cd \<directory\>**  
**git pull repository-url**  
**php artisan migrate**  
**php artisan optimize**  
**composer dump-autoload**  
Somehow I get the error when using ssh  
**`E: Unable to locate package ssh`**  
**`./devops/build-for-production.sh: line 4: ssh: command not found`**  
I am using PHP:7.4-fpm image. Can anyone help me with this? I have been stuck for weeks.


Answers:
author: Patrik S
body: Hello [@Jeffrey Jacobo](/t5/user/viewprofilepage/user-id/4998786) ,

Welcome to Atlassian Community.

This error usually happens when the package list of your system, in this case the container with php:7.4-fpm image, is not updated or does not have this package (ssh) available to be installed.

In order to re-synchronize the package index files from their remote sources, you should first execute :

```
apt-get update
```

This will download the package lists from the repositories and "updates" them to get information on the newest versions of packages and their dependencies.

After it, you can then install the package by running

```
apt-get install -y ssh
```

You can try changing your script to include the commands above and let us know how it goes.

Thank you, [@Jeffrey Jacobo](/t5/user/viewprofilepage/user-id/4998786) .

Kind regards,

Patrik S


Tags: bitbucket-cloud

cloud
Is it possible to use self-hosted runners combined with the cloud runners?
Asked by ewout_van_gossum:

I just got some self-hosted runners working which is great, but it seems like the runs-on configuration in the bitbucket-pipelines.yml makes it run exclusively on self-hosted runners?

Is it possible to run on the cloud if the self-hosted runners are offline? (if not, this would be a great feature!)


Answers:
author: Syahrul
body: Hi [@ewout_van_gossum](/t5/user/viewprofilepage/user-id/137341)

Welcome to the community!

Currently, the pipeline build will fail automatically when the build is unable to communicate with the runner, and we don't have a failover that will let the build run on the Bitbucket pipeline when this happens. Unless you manually remove the runs-on: in YAML to let Bitbucket pipeline know that you are not using runner anymore.

We do have an existing feature request on this at:

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

I highly suggest you **Vote \& Watch** the feature request so that you'll receive an update whenever we have any.

I hope this helps

Cheers,  
Syahrul


Tags: bitbucket-cloud

bitbucket-pipelines

bitbucket-runners

cloud
Branch restrictions not working with user groups
Asked by vikramiron:

I have added two groups Admin and Dev on the repository and added following branch restriction

**Write access : Admin**

**Merge via pull requests : Dev**

But these restrictions are not working and when I push from Dev user it shows following error

remote: Permission denied to update branch Dev.  
To <https://bitbucket.org/myapi/apiv3.git>  
! \[remote rejected\] Dev -\> Dev (pre-receive hook declined)  
error: failed to push some refs to

I am not sure how to resolve this issue as I am following the guidelines written here <https://support.atlassian.com/bitbucket-cloud/docs/use-branch-permissions/>

Can anyone help me to resolve the issue and setup branch permissions.


Answers:
author: Fabio Racobaldo _Herzum_
body: Hi [@vikramiron](/t5/user/viewprofilepage/user-id/3413982) ,

please could you share your repo permissions and branch permissions scrennshot? We need to figure out your current setup so that we can support you on that.

Please keep in mind that, in order to complete a pull-request a user need to have WRITE permissions on the target branch.

Fabio

comments: author: vikramiron
body: Hi [@Fabio Racobaldo _Herzum_](/t5/user/viewprofilepage/user-id/781528)

Please check screenshots

User group permissions: <https://nimb.ws/hXljB0>

Branch permissions: <https://nimb.ws/5UhjYu>

I have changed the group name to Reviewer, when I try to push with a reviewer it shows the error mentioned in the question.


author: Fabio Racobaldo _Herzum_
body: Hi [@vikramiron](/t5/user/viewprofilepage/user-id/3413982) ,

in my opinion there is an inconsistence due to Write access just to admininstrators. If you remove that branch restriction all should be ok.

<https://bitbucket.org/blog/take-control-with-branch-restrictions>

Fabio


Tags: bitbucket-cloud

branch

cloud

permission
Bitbucket pipeline integration with Sysdig
Asked by Nataraj:

Is there Bitbucket pipelines integration with Sysdig ? have anybody tried it ?


Answers:
author: Eduardo Minguez Perez
body: There are a few examples on the new scanner integration with different CI providers such as Jenkins, GitHub or Azure pipelines (see the [official documentation](https://docs.sysdig.com/en/docs/sysdig-secure/vulnerabilities/pipeline/#integrating-in-your-cicd-pipelines.)) Nothing specific with Atlassian's Bitbucket but it should be super easy to integrate. At the end of the day is just downloading a binary and run it!

comments: author: Nataraj
body: Thanks for your input. Let me give this a try and get back to you


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

integration
Artifacts not uploaded
Asked by Abhinay Sutrakar:

Hi ,

We are trying to build simple maven project pipeline where we are trying to expect below actions to be happen.

Pipeline triggered and the artifacts to be uploaded in the target folder of current bitbucket repository path.

In the below example post pipeline trigger we are able to see results file site/serenity/index.html is generated at location during build but that file we would like to upload as artifacts in the target folder.

Even moving the file or directory not worked

image: radut/openjdk-15-maven

pipelines:  
default:  
- parallel:  
- step:  
name: Triggering Test Automation  
script:  
- mkdir --p $BITBUCKET_CLONE_DIR/target  
- mvn clean install -f sps-api-automation/pom.xml -U  
- cd /opt/atlassian/pipelines/agent/build/sps-api-automation/target  
- cat site/serenity/index.html  
- mv /opt/atlassian/pipelines/agent/build/sps-api-automation/target/site/serenity/index.html /opt/atlassian/pipelines/agent/build/sps-api-automation/target  
artifacts:  
- target/\*\*


Answers:
author: Ben
body: Hey Abhinay,

Artifacts are always relevant to the actual clone path ($BITBUCKET_CLONE_DIR) and therefore the cd/mv lines are not needed.

By default, you will always start within the clone directory. Therefore when making the target directory, if you simply run the following line - this will make a "target" directory within the clone directory:

```

mkdir target
```

When calling the directory later on in the artifacts line, you have the correct config (as this will point to $BITBUCKET_CLONE_DIR\\target):

```
artifacts:

- target/**
```

Try this configuration and then click on the "Artifacts" tab in the build itself to verify if the downloaded artifact is what you are expecting to see.

**NOTE:** This method preserves the artifact for 14 days and does not actually upload the file into your Bitbucket source directory, it is simply to preserve artifacts in between builds.

Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
authentication problems with my Bitbucket account
Asked by George Howell:

**i constantly get these mesages:**   

*fatal: Authentication failed for '<https://bitbucket.org/my-remote-repo.git/>'*   

*remote: Invalid credentials*   
*fatal: Authentication failed for '<https://bitbucket.org/my-remote-repo.git/>'*   

<br />

**how do i marry this up locally throug MacOS/Terminal:**   
*<https://id.atlassian.com/manage-profile/security/api-tokens>*


Answers:
author: Patrik S
body: Hello [@George Howell](/t5/user/viewprofilepage/user-id/4983745) ,

Welcome to Atlassian Community!

Bitbucket has its own kind "api token" that is called [App Passwords](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/), and this is different from the API tokens you create under your Atlassian account settings.

To authenticate git over HTTPS and calls to Bitbucket API you should use your bitbucket username (not the e-mail address), which you can find in your [account's personal settings](https://bitbucket.org/account/settings/), along with an [App Password](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/) as your credentials.

Would you please try to use an App password instead of API token and let us know how it goes?

Thank you [@George Howell](/t5/user/viewprofilepage/user-id/4983745) .

Kind regards,

Patrik S


Tags: bitbucket-cloud

cloud
Project View is empty
Asked by Andreas Ernst:

Hi,

since some Versions of Bitbucket Server the Projects View is empty:

https://\<ownServer\>/projects/\<project\>

All Projects still exists, i am admin of this server.

Any hints?

Thx Andreas


Answers:
author: Andreas Ernst
body: For all, i got now 8.4.1 running. If the issue has gone, i don't now.

I moved Bitbucket to a new Server, here is everything fine.

Maybe it could help in such case, to ex- and import the Database.


author: Andreas Ernst
body: Meanwhile i have 8.4.0 running, German Umlaut issue has gone.

But the Project View is still empty.


author: Christian Glockner
body: Hi Andreas,

Are you using Postgres as your backend database by any chance?

If so, try running these queries to reindex the tables - you can do this online, i.e. Bitbucket does not need to be restarted:

    REINDEX TABLE project;REINDEX TABLE repository;

Cheers,

Christian

Premier Support Engineer

Atlassian

comments: author: Andreas Ernst
body: Hi Christian,

thx for your answer. Hmm, i did not a get mail...

However, yes, it's a PostgresSQL, but no effect. I restarted Bitbucket, but still no Projects in the View.

Meanwhile i have 8.3.0 running, which have a German Umlaut issue too.

Regards

Andreas


Tags: bitbucket-server

server
Bitbucket Runners - Self hosted - 403 errors
Asked by Jack Warnes:

We have suddenly started receiving these errors on our self-hosted runners:

Response Summary: HttpResponseSummary{httpStatusCode=403, httpStatusMessage=Forbidden, bodyAsString={"error":{"message":"Forbidden","detail":"Could not find runner associated with oauth client.","data":{"key":"rest-service.rest-service.forbidden","arguments":{}}}}}

The error is very random, happens on different projects. There have been no changes to our pipeline.yml files or permissions in our BB instance.

I've upgraded all of our runners to the latest version but still seeing the issue.

Any ideas?


Answers:
author: Jack Warnes
body: I understand this is now fixed on the Bitbucket side.


author: ?000-????????
body: I've just killed all previsious images and containers, run with

```
Runner version:
current: 1.342
latest: 1.342

```

and it's alive

comments: author: Grigory Kazachenkov
body: Great! Did the same. Works! Thank you! Looks like they have just updated worker images


author: Jack Warnes
body: I did try this earlier without much success...


author: ?000-????????
body: What versions do you have ?


author: Jack Warnes
body: same, 1.342. It's working now after BB fixed it on their side.


author: Grigory Kazachenkov
body: Hello! Can just approve. We have 2 runners on our kubernetes platform and both of them receive such errors

comments: author: Jack Warnes
body: When did you start receiving the 403s?


author: Grigory Kazachenkov
body: I noticed that about an hour ago. But there were no builds before


author: Jack Warnes
body: Same - 3pm UTC.


author: Grigory Kazachenkov
body: And our runners are updated to the latest version


author: Grigory Kazachenkov
body: Now my builds are stuck in Queued state. No error but also they are not assigned to runner. Looks like there is some global problem in bb pipelines.


author: Jack Warnes
body: I've tried to raise a separate ticket with BB


author: Jack Warnes
body: Received a response, they're aware of the issue and are looking to fix.


author: Craig.Dawson
body: We are also seeing this issue.


author: Jonathan Gafner
body: We are also seeing this issue.


Tags: bitbucket-pipelines

cloud
Bitbucket Pipelines Artifact - Modification date in built files
Asked by Kamil Fogel:

Recently we've found out that files built by Pipelines as a Artifacts has modified date set to 1970-01-01 02:00, no created date, no accessed date.   
Created and accessed are changed to current date/time when file is extracted from archive, but modification date doesn't change.   

In further steps we are using some tool to host these files on Client's side, and these tools are relying on modification date, so this value is required.

What was changed on Pipelines side that it doesn't work as previously?

Or how to fix that behavior without modifying that date with file change.


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

Thank you for raising this to our attention. I have tested this on my end and indeed, after extracting the archive - I see the same incorrect "created date" as you have mentioned.

This has been logged as a bug in the past for our developers to address - please feel free to "Watch" this for future updates and also click "This Affects Our Team" to improve its visibility:  
<https://jira.atlassian.com/browse/BCLOUD-20655>

In the interim as a workaround, the date can be manually modified by running the "touch" command, you could create a script that pulls the current date/time and then apply this recursively to all files within a given folder - for example:  
touch -t datetimehere

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: artefact

bitbucket-cloud

bitbucket-pipelines

cloud
Not receiving account recovery link on an email
Asked by faq_zuel:

[@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) I am also facing the same problem. This is a 2FA recovery email. Waited for more than 24 hours.  
Can you please check for me?  
My email address is: \<email_removed\>


Answers:
author: Theodora Boudale
body: Hi [@faq_zuel](/t5/user/viewprofilepage/user-id/2025479),

Your email address is not in any of our suppression lists. I also checked your accounts in our system, and 2FA is disabled both for your Bitbucket account and also for the respective Atlassian account.

Can you please confirm if you have received the email and if the issue is resolved for you?

Just a heads up, I moved your post to a new question. It's best to create a new question when you need assistance with an issue, because a) if I'm out of office, a new question will have better visibility to the rest of my team and b) a question can become convoluted if we try to solve multiple users' issues in the same question.

I also removed your email address to protect your privacy; there is no need to include it in the post if you are posting from an account with the same email, Atlassian staff can see the email of the account you are posting from.

Please feel free to let me know if the issue is resolved or if you still need assistance.

Kind regards,  
Theodora

comments: author: faq_zuel
body: Thanks for the response.

Actually, multifactor authentication was activated at that time. I did not receive the email for the previous day. I waited for more than 24 hours. But, sometime after commenting here, the email came and could recover the account. My assumption was it was resolved with your assistance.

Thanks,  
Zuel


author: Theodora Boudale
body: Hi Zuel,

Thank you for the update, it's good to hear that the issue is resolved. Please feel free to reach out if you ever need anything else!

Kind regards,  
Theodora
ssh key duplicates
Asked by dibus2:

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


Answers:
author: Nic Brough -Adaptavist-
body: This means what it says - you've added an access key to a repository with another account.

You should not be sharing keys between accounts, it's insecure, and Bitbucket explicitly does not allow it.

You will either need to log in with the old account and delete the key, or, better, generate a new key for the new account.


Tags: bitbucket-cloud

cloud
Detect Auto Merge in Pipeline
Asked by xicond:

If the user dont have merge privilege, the pipeline not suppose doing auto deploy

furthermore, the admin must rerun the deployment step to make sure  

the deployment vs merged to master, and

version in master vs production is more controllable  

How to detect in pipeline, whether the pull-request triggering pipeline is auto merge ?


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

Thank you for reaching out to the community.  
Based on my understanding, you'd like to restrict users from deploying through Pipelines.  
If that's correct, you can leverage and set up the [Pipelines Deployments](https://support.atlassian.com/bitbucket-cloud/docs/set-up-and-monitor-bitbucket-deployments/) feature where you can restrict the ability to deploy to admins, or to specific branches.

You can check this link for more information: [Set up and monitor deployments](https://support.atlassian.com/bitbucket-cloud/docs/set-up-and-monitor-deployments/)

Do let me know if you have further questions.

Regards,  
Mark C


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
I'm not able to clone, pull and push my repository via ssh
Asked by Fabio Marras:

Hi,

despite being the administrator of the repository, I cannot execute any of the basic commands - such as git pull and git push - via ssh. I always get the error message The requested repository either does not exist or you do not have access. If you believe this repository exists and you have access, make sure you're authenticated.  
fatal: Could not read from remote repository.".

And when I try to add my public ssh key through access key of the repository I always get the error "Someone has already added that SSH key to another account.".

Where I'm being wrong?

Regards,

Fabio


Answers:
author: Mateus T
body: Hi [@Fabio Marras](/t5/user/viewprofilepage/user-id/4817448)!

Welcome to the Atlassian Community!

Based on the behavior you mentioned on this thread, I believe that your Git authentication through SSH is failing due to your private SSH key not being added to your local SSH agent. In order to check this, you can run the following commands locally:

```
$ eval `ssh-agent`

$ ssh-add ~/path/to/private_key
```

These commands should start your local agent and add your private key to it, making sure that your local machine is able to authenticate with your remote Bitbucket repositories.

You can also check more about the SSH setup process through the following documentation:

[Set Up an SSH Key](https://support.atlassian.com/bitbucket-cloud/docs/set-up-an-ssh-key/)

In case you are still facing this issue after spinning up your agent and locally adding your private key, please run the following commands locally and share the output with us so we can have a deeper look into it!

```
$ ssh -Tv git@bitbucket.org
```

**Make sure to scatter through the logs and mask any sensitive information before sharing it in this thread!**

Thanks!

Mateus T


Tags: cloud

ssh
jenkins bitbucket integration status code 128 error
Asked by beyza ayd?n:

I am using my company's atlassian account for our project because we want to develop our local project(our aim is creati?ng new web app also we've already use jenkins as cloud way) so I wanna make some trial with ready project but when I try to integrate the repository with jenkins. we faced this issue like that:  

Failed to connect to repository : Command "git.exe ls-remote -h -- <https://bitbucket.etiya.com/scm/mar/mrvl-ui-automation.git> HEAD" returned status code 128:  
stdout:  
stderr: fatal: Cannot prompt because user interactivity has been disabled.  
fatal: Authentication failed for '<https://bitbucket.etiya.com/scm/mar/mrvl-ui-automation.git>

Please help me :)


Answers:
author: Syahrul
body: Hey [@beyza ayd?n](/t5/user/viewprofilepage/user-id/4221123)

G'day.

I believe you are not authenticating with App Password; hence you are getting the "user interactivity".

We no longer support Account passwords for git authentication, so you need to generate a new App Password to authenticate. Please find the steps in our KB below:

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

Let me know how it goes.

Cheers\<  
Syahrul


Tags: bitbucket-cloud

cloud
How to set CI\CD for unreal engine project?
Asked by 1121:

I am new for CI\\CD.

Is there a tutorial of how to set the pipeline to build UE4 project? I can see build c++, but totally no idea how to configure it.

I see there is jenkins plugins. Is Bitbucket ok for local jenkins server?


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

Welcome to the community.

For Bitbucket Cloud Pipelines CI/CD, you can run builds as long as you have the Docker image that can run your desired environment for building UE4 projects and that Pipelines infrastructure is suitable for your build requirements.  
You can check this link for Bitbucket Cloud Pipelines limitations - <https://support.atlassian.com/bitbucket-cloud/docs/limitations-of-bitbucket-pipelines/>

Having said that, I came across this link that describes how to build and deploy Unreal Engine projects and plugins.

* [Continuous Integration and Deployment (CI/CD) - Use reproducible environments to build and deploy Unreal Engine projects and plugins.](https://unrealcontainers.com/docs/use-cases/continuous-integration)

I do believe you can start from there.  
Hope it helps and do let me know if you have further questions.

Regards,  
Mark C


Tags: bitbucket-cloud

cloud
Repository is over the size limit (4 GB)
Asked by manuelmollis:

Thanks!


Answers:
author: Syahrul
body: Hey [@manuelmollis](/t5/user/viewprofilepage/user-id/3299880)

G'day

I have triggered GC on all your repositories under your Workspace that is beyond 3GB, and most repository size has been reduced.

You should be able to make changes or push.

Cheers,  
Syahrul


Tags: bitbucket-cloud

cloud