youngmon/atlassian-qna huggingface dataset:
Workspace default settings
Asked by Jean-Fabien:

Hello, i would like to define default permissions, branching models, restrictions,... for all my projects/repos (we have a lot), but i can not find where it is configured.

Is it possible ?


Answers:
author: Theodora Boudale
body: Hi Jean-Fabien and welcome to the community!

These settings cannot be configured on the workspace level, but they can be configured per project.

While viewing a workspace on Bitbucket Cloud website:

1. select **Projects** from the top menu
2. select a certain project
3. select **Project settings** from the left sidebar

You will see options to set a branching model, permissions, etc that will be applied to all repos of that project. Repeat steps 2 and 3 for each project that you want to set default settings.

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

Kind regards,  
Theodora

comments: author: Jean-Fabien
body: It seems this issue <https://jira.atlassian.com/browse/BCLOUD-21248> is related, in progress but last updated in 2022, sounds worrying


author: Theodora Boudale
body: Hi Jean-Fabien,

Even though this feature request mentions "workspace" in the title, it is used to track project default settings.

I went ahead and created a new feature request specific to workspace default settings:

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

You can add your vote to it (by selecting the **Vote for this issue** link) to express your interest. 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.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Error: Workspace with this Slug already exists
Asked by Ayush Mathur:

Unable to name a new workspace with same name as old workspace which is now deleted. Error: Workspace with this Slug already exists.


Answers:
author: Ben
body: Hi Ayush,

As per [our documentation](https://support.atlassian.com/atlassian-account/docs/delete-your-atlassian-account/), deletion of a workspace takes 30 days to fully delete in the backend, this means that until the deletion period is complete - the workspaceID of the deleted workspace is still in use until the full deletion occurs:
> After you delete your account, personal data will be also deleted from all Atlassian services accessed by your account within 30 days, unless we're required to keep it for legitimate business or legal purposes.

I can see you have deleted a few workspaces between 1-3 days ago, you will be able to rename your new workspaceID to the old one after 27-29 days have passed:

* <https://support.atlassian.com/bitbucket-cloud/docs/change-a-workspace-id/>

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Key added via REST API not visibile through web interface
Asked by John Lawlor:

Using the following python code, I added an SSH key to bitbucket (version 8.9.5):

```
#!/usr/bin/python

import os
import sys
import json
import base64
import logging
import time
import datetime
import requests
from requests.auth import HTTPBasicAuth

bitbucketBaseUrl = "bitbucket.company.com"
bitbucketUserName = "admin"
logging.basicConfig(filename='post-migration-updates.log', filemode='w', format='%(name)s - %(levelname)s - %(message)s', level=logging.INFO)


public_key = "ssh-rsa key-text your_email@example.com"

headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}

def addAccessKey(projectKey, bitbucketPassword):
logging.info("Update project with key: {}".format(projectKey))
data = {
"text": public_key,
"permission": "PROJECT",
"projects": projectKey,
}
url = "https://{}/rest/ssh/1.0/keys/".format(bitbucketBaseUrl)
logging.info("REST URL {}".format(url))
response = requests.post(
url,
auth=HTTPBasicAuth(bitbucketUserName,bitbucketPassword),
json=data,
headers=headers
)

print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))

def validateScriptParameters():
if len(sys.argv) != 3:
sys.exit("Usage: {} [admin password] [Project Key e.g. FW]".format(os.path.basename(sys.argv[0])))

validateScriptParameters()
logging.info("Connecting to bitbucket")
bitbucketPassword = sys.argv[1].strip()
projectKey = sys.argv[2].strip()
print projectKey
addAccessKey(projectKey, bitbucketPassword)

```

I get the following response:

{  
"algorithmType": "RSA",  
"bitLength": 3072,  
"createdDate": 1704983323891,  
"id": 7185,  
"label": "your_email@example.com",  
"text": "ssh-rsa key-text= your_email@example.com"  
}

When I browse to <https://bitbucket.company.com/plugins/servlet/ssh/projects/>\<project key\>/keys, the key is not there. I can't see it even as the system administrator.

(Key contents have been redacted)

Any thoughts?


Answers:
author: Navpreet Ahuja
body: Hi, Can you please use the below endpoint to add the project SSH key

\`http://{baseurl}/rest/keys/latest/projects/{projectKey}/ssh\`

Reference: <https://developer.atlassian.com/server/bitbucket/rest/v809/api-group-authentication/#api-keys-latest-projects-projectkey-ssh-post>

Thanks


Tags: bitbucket-server

server
Support webhook with ArgoCD?????
Asked by Brook Hans:

Description of the situation where bitbucket webhook does not trigger argocd:  
The status code returned by bitbucket webhook is 200, and argocd can receive the push event normally without reporting an error, but it cannot trigger refresh. Tried the following, but still doesn't work:

1. Modify bitbucket, argocd and other configurations
2. Test and deploy HA version and non-HA version
3. Change argocd version (lower version)
4. Change bitbucket address
5. Troubleshoot network problems (in your own cloud account environment, release all network restrictions, deploy argocd and test)
6. Replace the gitlab code base for comparative testing  
   Comparison found that gitlab returned logs  
   time="2024-01-08T02:54:43Z" level=info msg="Received push event repo: <http://xxx/root/test-deploy>, revision: main, touchedHead: true"  
   time="2024-01-08T02:54:43Z" level=info msg="Requested app 'gitlab' refresh"  
   bitbucket returns log:  
   time="2024-01-08T03:11:51Z" level=info msg="Received push event repo: <https://bitbucket.org/xxx/xxx>, revision: master, touchedHead: true"  
   Compared with cashback, gitlab first receives a push event and then refreshes it to refresh normally. Bitbucket only receives push events, no refresh, and cannot be refreshed.


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

I'm not sure what you are referring to by "Bitbucket only receives push events, no refresh". If you have a webhook set up to trigger on push, then every time commits are pushed to the repo, Bitbucket will send a request to the URL configured on the webhook settings.

If by 'refresh' you mean something that you expect to happen on Bitbucket Cloud side, can you please explain what exactly is the Bitbucket event/action you are referring to?

If by 'refresh' you mean ArgoCD refreshing something after receiving the webhook payload, I would suggest reaching out to ArgoCD's support team for help with troubleshooting.

Kind regards,  
Theodora

comments: author: Brook Hans
body: Hi, Thanks a lot for your comment,  
It should be ArgoCD's refresh action, '  
*Refresh* : Fetches the latest manifests from git and compares diff.  
I wish bitbucket cloud can communication with ArgoCD community to check on this ?  
if not support yet, work with ArgoCD community to make it work.


author: Theodora Boudale
body: Hi,

Thank you for the clarification.

Bitbucket Cloud has no control over what happens on the destination server once the webhook payload has been received. If nothing is triggered at all, I would suggest reaching out to ArgoCD community or support team for further steps with troubleshooting, as this is outside the scope of our support.

If ArgoCD attempts to do a refresh (which I assume may be a git pull or git fetch from a Bitbucket Cloud repo) and that fails e.g. with an authentication error, we can guide you to ensure that the correct credentials are used. But if nothing is triggered at all, then the ArgoCD team will be better equipped to help.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
SSH - git-upload-pack warnings
Asked by Mahesh Vecham:

Hi Team,

Recently we have upgraded Bitbucket 7.2.1 to 7.21.14 We can see in the logs that they are overflowed with some Java error:

2024-01-11 11:00:46,359 WARN \[ssh-scm-request-handler\] 8c4206f147967552 @1THBEWVx660x885x2 1353evp 10.24.141.238 SSH - git-upload-pack '/\<repo url\>.git' c.z.n.windows.ProcessCompletions Aborting processing loop after unexpected exception (2 processes running)

java.lang.RuntimeException: CreateIoCompletionPort() failed, error code: 6

at com.zaxxer.nuprocess.windows.ProcessCompletions.queueWrite(ProcessCompletions.java:262)

at com.zaxxer.nuprocess.windows.ProcessCompletions.checkWaitWrites(ProcessCompletions.java:336)

at com.zaxxer.nuprocess.windows.WindowsProcess.run(WindowsProcess.java:279)

The logs are typically 1GB big, we are using Teamcity to build. Any help on this why this is happening?


Answers:
author: Rafael Parmigiani
body: Hi Mahesh,

The stack trace you shared is typically an indication of another problem, not the cause. Unfortunately, the cause may vary and we would need more information.

[Debug logging](https://confluence.atlassian.com/bitbucketserver/enable-debug-logging-776640147.html) would tell us more about the issue. If log files are already 1GB in size, then it is possible that you already have debug logging enabled; in which case you can try filtering the logs by the request ID (1THBEWVx660x885x2) to see what else got recorded.

In case debug logging is not enabled, then you will have to turn it on, wait for the problem to re-occur and check the logs. Something tells me the problem is somewhat consistent in your environment, so it shouldn't take longer until it surfaces again.


Tags: bitbucket-server

server
Bug: Bitbucket Pipelines Pipe: Email Notify
Asked by Patrick Comes:

Hi,  
I think I have found a bug in the Bitbucket Pipeline Pipe "Email Notify" (<https://bitbucket.org/atlassian/email-notify/src/master/>). The parameter "DISABLE_AUTH" does not work if you set it to "true". The problem is probably that the environment variable can only be passed as a string, but in pipe.py:69 it is explicitly checked for a boolean value.

++This could be a correction for this:++   
from distutils.util import strtobool  
disable_auth = os.getenv('DISABLE_AUTH', 'False')  
if strtobool(disable_auth):

If I have made a mistake in the usage, I would be grateful for a hint.

BR,  
Patrick Comes


Answers:
author: Oleksandr Kyrdan
body: Hi [@Patrick Comes](/t5/user/viewprofilepage/user-id/5403113)

Thanks for your contributions to the community.

It is a bug, we'll fix it and notify you.

Best regards,  
Oleksandr Kyrdan


author: Oleksandr Kyrdan
body: Hi [@Patrick Comes](/t5/user/viewprofilepage/user-id/5403113)

The new version of the pipe is released:

```
script:  - pipe: atlassian/email-notify:0.13.1    variables:      FROM: 'myemail@example.com'      TO: 'example@example.com'      HOST: 'smtp.gmail.com'      DISABLE_AUTH: true
```

Best regards,  
Oleksandr Kyrdan

comments: author: Tharinda Hashen
body: Hi [@Oleksandr Kyrdan](/t5/user/viewprofilepage/user-id/2885705),  

I am still having the issue, the pipe does not work with

```
      DISABLE_AUTH: 'true'
```

It is expecting a boolean value not a string. But we cannot pass a boolean value in pipeline yaml since it gives a syntax error. Any workaround for this?


author: Oleksandr Kyrdan
body: [@Tharinda Hashen](/t5/user/viewprofilepage/user-id/5358954)

Thanks for your question!

Please, provide us with logs about your issue.

Best regards,  
Oleksandr Kyrdan


Tags: bitbucket-cloud

cloud
Maven builds fails complaining about kr.motd.maven:os-maven-plugin:1.7.0
Asked by Mariusz Dullak:

I am maintaing bitbucket cloud for an external team.

We have a build that is completly inside docker (so bitbucket-pipelines uses docker build -t XXX -f Dockerfile

Since yesterday (Jan 10th) the builds are failing with:

```
Unresolveable build extension: Plugin kr.motd.maven:os-maven-plugin:1.7.0 or one of its dependencies could not be resolved: Could not transfer artifact org.apache.commons:commons-lang3:jar:3.5 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar: Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.36.215] failed: Connection timed out -> [Help 2]
```

All of them which use maven. If I try to rerun commits that were passing 2-3 days ago they are failing now.

If there some change in BitBucket which is causing this?

I am using my own builders to run those pipelines and if/when I run the same docker build -t XXX -f Dockerfile it compiles successfully so it has to do something with bitbucket pipelines.

All and any help would be appriciated.


Answers:
author: Theodora Boudale
body: Hi Mariusz,

Do these maven builds last more than 5 minutes?

We have seen this timeout issue reported by other customers in the past. Idle outbound connections from Pipelines will only be maintained by our NAT for 5 minutes. The NAT configuration is there to provide static IPs for people wanting to whitelist Pipelines outbound traffic. The NAT timeout in our AWS infrastructure is not configurable, so connections need to either send data more frequently than every 5 minutes, use TCP keepalive, or reconnect if the connection is reset.

The underlying problem seems like a bug with Maven, where it doesn't either 1) use TCP keepalive on its long-lived HTTP connections, or 2) attempt to reconnect if one of its pooled connections is reset during the build:

* <https://issues.apache.org/jira/browse/WAGON-486>

The issue is resolved for most users by adding the following flag to the maven command (which forces Maven to use new connections and as a result will prevent timeouts):

```
-Dmaven.wagon.http.pool=false
```

The bug report I shared indicates that the issue was fixed with version 3.2.0 of Maven Wagon, so you can also try using that.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Bitbucket Pipeline Runner crashes when there's no internet connection
Asked by Stijn van Kampen:

So when I start up a Linux Shell runner without a working internet connection, it just throws a lot of Java exceptions. Took me a while to figure out that my internet connection was not working, because there wasn't any notification it was "OFFLINE", just a lot of Java exceptions.

Not really a question, this just seems to be a bug in the Bitbucket Pipelines selfhosted runner.

Log (note: when it reports as "OFFLINE" I manually cancelled the runner because it wasn't working properly):

<https://pastebin.com/RvJDSAyW>

Update: Similar thing happens when you try to start it with the runner disable in Bitbucket settings:

<https://pastebin.com/iCwYNnU9>


Answers:
author: Theodora Boudale
body: Hi Stijn!

Thank you for the feedback.

Starting a disabled runner indeed does not return a message that is meaningful to the user. The first log you provided includes the message 'Temporary failure in name resolution' which indicates an issue with the host machine or DNS, but it is buried among the exceptions.

I went ahead and created a request in our issue tracker to improve the errors returned on runner failure (you can add your vote to it to express your interest):

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

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

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
I'm an administrator of workspace of our company, and I'm just kicked out from Bitbucket.
Asked by Takayuki Kawamoto:

![unnamed.png](https://community.atlassian.com/t5/image/serverpage/image-id/300020iE3A38713D722E1F3/image-size/large?v=v2&px=999 "unnamed.png")I'm an administrator of this workspace, but I cannot have any role to move into my own workspace, so all members in this workspace cannot do anything about member adaministration (add/modigy/remove members).

And now I seek for "contact" or customer help in this service, and all suggestions indicate this community forum and I don't know the official customer help department of this company... why? Or should I pay for some way to get help from this company?


Answers:
author: G subramanyam
body: Hi [@Takayuki Kawamoto](/t5/user/viewprofilepage/user-id/5402928) welcome to the Atlassian community.

I understand your frustration at not being able to manage members in your Bitbucket workspace despite being an administrator.

1. I would request you to check within your organization for any new workspace owner. If so, they have the authority to add, modify, or remove members.

2. If you organization Jira instance is on a [paid plans](https://www.atlassian.com/software/bitbucket/pricing), you may directly contact the [Atlassian support team](https://support.atlassian.com/contact/).

comments: author: Takayuki Kawamoto
body: Thank you for a quick and kind reply. I will check a new admin.


Tags: bitbucket-cloud

cloud
Does BitBucket support automated monitoring for GRC frameworks?
Asked by Manisha Yadav:

Does Bitbucket support automated monitoring for GRC frameworks? I don't mean BitBucket's SOC 2 report etc - if I have an account with BitBucket, and need to ensure it has SOC 2 controls set up \& configured - is that possible? Do you know if this information is available for manual reports / API calls? A function similar to the AWS audit manager.


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

Can you please provide some details about what exactly you are looking for? What do you want to monitor automatically in Bitbucket Cloud and what controls do you want to set up \& configure?

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Test reporting in pipelines for Typescript
Asked by Simmi Mourya:

<https://support.atlassian.com/bitbucket-cloud/docs/test-reporting-in-pipelines/>

Do we have similar instructions for JS/TS based project where jest is being used to run unit tests.


Answers:
author: Saxea _Flowie_
body: Hi [@Simmi Mourya](/t5/user/viewprofilepage/user-id/5402715) ,

Have you tried using [jest-junit](https://www.npmjs.com/package/jest-junit) to generate the result in the supported locations?

comments: author: Simmi Mourya
body: Hi [@Saxea _Flowie_](/t5/user/viewprofilepage/user-id/5230209) , thank you for your response. I am using jest-junit. This is my package.json  

```
"scripts": {
"test": "jest --coverage",
},


"jest": {  "collectCoverage": true,
"reporters": ["default", "jest-junit"],
"coverageThreshold": {
"global": {
"lines": 95
}
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../server/test-reports",}

```

And this is my unit-test step in bitbucket-pipelines.yaml  

```
- step: &unit-test

name: Run jest unit test

caches:

- npm

script:

- cd server

- npm config list

- npm ci

- echo "Running Jest unit tests with coverage"

- npm run test

artifacts:

- server/test-reports/**/*

```

<br />

1. The pipeline step generates the server/test-reports/\*\*/\* but **I can't browse the test-reports directly from bitbucket UI,** it only lets me download the zip of this artifact. Is there a way to view reports from bitbucket UI itself?

This is what the test-reports directory looks like.   

```
test-reports % tree -L 3
.
??? clover.xml
??? coverage-final.json
??? lcov-report
? ??? base.css
? ??? block-navigation.js
? ??? bello
? ? ??? bello.service.ts.html
? ? ??? dto
? ? ??? index.html
? ??? favicon.png
? ??? index.html
? ??? prettify.css
? ??? prettify.js
? ??? sort-arrow-sprite.png
? ??? sorter.js
? ??? hello
? ??? dto
? ??? index.html
? ??? hello.controller.ts.html
? ??? hello.service.ts.html
??? lcov.info

```

2. npm run test also generates a junit.xml inside the server folder, I'm not quite sure how to interpret/use it.


author: Saxea _Flowie_
body: Hi [@Simmi Mourya](/t5/user/viewprofilepage/user-id/5402715) ,

There is an existing thread that gives you an idea of what is displayed when the report files are picked up.

<https://community.atlassian.com/t5/Bitbucket-questions/Where-do-I-view-pipeline-test-reports/qaq-p/689754?lightbox-message-images-1085506=54889iA170F3102F5D63E3>

Hope this helps.


Tags: bitbucket-cloud

cloud
My Workspace and repository have been deleted by another person.How to recover it?
Asked by SANTHOSH P:

I have given permission to my friend.He have deleted my workspace.Now I wanr to recover it?


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

Did you have a backup? If not, then the most you can probably do is recreate it (likely to be much easier and faster than recovering from a backup too)


Tags: bitbucket-cloud

cloud
macOs fatal: Could not read from remote repository.
Asked by Raul Bobletec:

Hello, when I am trying to clone something from bitbucket on my mac I get this errors

Connection closed by 45.60.155.27 port 7999

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

I tried almost every solution I found online but none seem to help. Do any of you know what may be the problem?


Answers:
author: Patrik S
body: Hello [@Raul Bobletec](/t5/user/viewprofilepage/user-id/5402243) and welcome to the Community!

The IP present in the error message is not a Bitbucket Cloud IP, so I suspect the network your machine is connected to is behind a firewall/proxy that is blocking the connection to Bitbucket.

In this case, you will need to make sure that the IPs listed in [Valid IP addresses for bitbucket.org, api.bitbucket.org, and altssh.bitbucket.org](https://support.atlassian.com/bitbucket-cloud/docs/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall/#Valid-IP-addresses-for-bitbucket.org--api.bitbucket.org--and-altssh.bitbucket.org) are allowed in the firewall/proxy.

If that does not work, I would recommend testing the clone operation while connected to a different network (such as the cellular network) to confirm if the issue is network-related.

Hope that helps! Should you have any questions, let us know :)

Thank you, [@Raul Bobletec](/t5/user/viewprofilepage/user-id/5402243) !

Patrik S

comments: author: Raul Bobletec
body: Hi, I tried on different networks and the issue is still the same. Maybe there is something from the firewall that is blocking the connections, do you know how I can change that? I am pretty new with the mac os system so I do not really know what or where exactly to change


author: Patrik S
body: Hello [@Raul Bobletec](/t5/user/viewprofilepage/user-id/5402243) ,

You can find the instructions on how to check and change the current firewall settings on your Mac by following the instructions in Apple's official documentation on this topic :

* <https://support.apple.com/guide/mac-help/change-firewall-settings-on-mac-mh11783/mac>

However, if your Mac is owned by your company, it may be the case that the firewall is configured at your company's network level and/or VPN, so you would need to reach out to your internal IT team to request further assistance on allowing the connection to <https://bitbucket.org> .

Thank you, [@Raul Bobletec](/t5/user/viewprofilepage/user-id/5402243) !

Patrik S


Tags: bitbucket-cloud

cloud