youngmon/atlassian-qna huggingface dataset:
trouble with ping bitbucket.org, git pull, git push
Asked by jwgrenning:

This just started a couple days ago. My ubuntu computer can not reliably interact with bitbucket. My Mac is on the same lan and works fine.

ping, git pull and git push will hang.

Doing ping from ubuntu appears to use ipv6. If I force ipv4, ping prints then hangs:

"PING (104.192.142.24) 56(84) bytes of data"

My Mac uses a different IP 103.224.182.246, and works fine. Mac can push and pull.

I suspect the DNS, but ubuntu seems to ignore my attempts to change the DNS.

I appreciate any suggestions.

thank you.


Answers:
author: Saxea _Flowie_
body: Hi [@jwgrenning](/t5/user/viewprofilepage/user-id/2356770)

Checkout this [reply](https://community.atlassian.com/t5/Bitbucket-questions/Re-SSH-not-working-intermittently/qaq-p/849458/comment-id/30073#M30073) about using AddressFamily to force IPv4.

comments: author: jwgrenning
body: Thank you, that fixed the problem. I wish I understood the problem better. Odd that the IPV6 route does not work.


Tags: bitbucket-cloud

cloud
"We couldn't log you in" error message
Asked by Chris Main:

I am unable to log in. It is not a browser issue. Does my account need to be reactivated?


Answers:
author: Nikola Perisic
body: Welcome to the community [@Chris Main](/t5/user/viewprofilepage/user-id/5572798)

That is right! Your account needs to be reactivated by Atlassian. I will add another tag for a higher visibility.

comments: author: Chris Main
body: Is there something else I need to do?


author: Nikola Perisic
body: Yes, you can raise a support ticket [here](https://support.atlassian.com/contact/)


author: Chris Main
body: That just brings me back to this community forum. How to I get my account unlocked?


author: Nikola Perisic
body: In order to have your account unlocked, you would need to raise a support ticket for Bitbucket by selecting the respective product. Have you tried clicking on the link from the comment?


author: Patrik S
body: Hey [@Chris Main](/t5/user/viewprofilepage/user-id/5572798) ,

Checking internally I confirmed your account was inactive due to a long period of no login.

I went ahead and changed it to active again, so you should be able to log in as usual.

Thank you, [@Chris Main](/t5/user/viewprofilepage/user-id/5572798) !

Patrik S


Tags: atlassian

bitbucket-cloud

cloud

reactivation
why my commits dont appear when I tried to create a pull request
Asked by Carlos Eliseo Soberano Chanona:

It only shows the description of the commits, but also says that the are no changes, so i dont get what I am doing wrong.

If anybody has and idea of whats wrong please feel free to comment.

![pullRequest.png](/t5/image/serverpage/image-id/342817i082CEFD8253A4999/image-size/large?v=v2&px=999 "pullRequest.png")


Answers:
author: Mark C
body: Hi [@Carlos Eliseo Soberano Chanona](/t5/user/viewprofilepage/user-id/5572676)

Just to update you on this one it appears the issue is related to a bug and it is now fixed. You can check this public bug ticket for more information: <https://jira.atlassian.com/browse/BCLOUD-23363>

Let me know if you're still experiencing the issue.

Regards,  
Mark C


author: Mark C
body: Hi [@Carlos Eliseo Soberano Chanona](/t5/user/viewprofilepage/user-id/5572676)

Welcome to the community.  

Based on the screenshot, it seems that you are creating a PR from a forked repository.

Could you confirm if the forked repository is synced with the upstream/parent repository?

Let me know how it goes.  

Regards,  
Mark C


Tags: bitbucket-cloud

cloud
Unable to login (Two factor auth was not set up correctly)
Asked by aaqib7:

Hi,

I have tried setting up two factor authentication when logging into my Bitbucket account, however, I can't even use the six digit code but now I'm locked out of my account.

It says "

Open the two-step [verification app](https://confluence.atlassian.com/x/425QLg#Two-stepverification-Installaverificationappforyourmobiledevice) on your mobile device to get your verification code or enter a [recovery code](https://confluence.atlassian.com/x/425QLg#Two-stepverification-Recoverycodes).

"

I have tried to enter this from Authy (mobile) but it does not work at all and now I'm totally locked out of my account. - Two factor auth was never successful in being set up.

I've tried using emergency recovery code but it does not work either. - "invalid".

Please can anyone help here as I'm totally locked out of my account?

Thanks


Answers:
author: aaqib7
body: Please ignore - I've disabled 2 factor auth in settings and now I can login.

I have a separate two factor auth enabled for Bitbucket in addition to Atlassian in Authy too.


Tags: bitbucket-cloud

cloud
how to trigger a notification step when the previous step failed?
Asked by Xinyu Wang:

I don't mean the after-script, the challenge is the step that hosts the after-script don't even get executed.

Consider this pseudo pipeline yaml:

definitions:

- step: \&step1-will-pass

script:

- step1 script here

- step: \&step2-will-fail

script:

- step2 script here

- step: \&notify-build-status

after-script:

- notification script here

pipelines:

custom:

'release':

- step: \*step1-will-pass

- step: \*step2-will-fail

- step: \*notify-build-status

In the custom pipeline 'release', when step2-will-fail gets executed and failed, the pipeline stops right there, The notify-build-status step will not be executed.


Answers:
author: Saxea _Flowie_
body: Hi [@Xinyu Wang](/t5/user/viewprofilepage/user-id/5178188) ,

Can't you move the notification to step-2?

There is a [discussion](https://community.atlassian.com/t5/Bitbucket-questions/I-need-something-like-a-teardown-step/qaq-p/2753388) for a similar problem and two related feature requests [here](https://jira.atlassian.com/browse/BCLOUD-22157) and [here.](https://jira.atlassian.com/browse/BCLOUD-18012)


Tags: bitbucket-cloud

cloud
Unable to login Bitbucket
Asked by aparicio roa:

Hi, {#toc-hId--349527442}
-------------------------

i am getting following error when login to bit bucket account.

"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."

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

Thanks,

Aparicio Roa


Answers:
author: Mark C
body: Hi [@aparicio roa](/t5/user/viewprofilepage/user-id/5572466)  

Welcome to the community.

It seems that your Bitbucket Cloud account was marked as a dormant account due to not logging in to Bitbucket.org for a long period of time.

I went ahead and reactivated it.

You should be able to log in now.  

Let me know how it goes.  

Regards,  
Mark C


author: aparicio roa
body: I need unlock my account bitbucket


author: aparicio roa
body: SOS


Tags: bitbucket-cloud

cloud
Is it possible to create a new branch type?
Asked by Lucas Gagliano:

I need to add a new branch type: Refactor with a prefix Refactor\\ is it possible?


Answers:
author: Saxea _Flowie_
body: Hi [@Lucas Gagliano](/t5/user/viewprofilepage/user-id/5433684) ,

I'm afraid it is not possible to add a new branch type to the branching model, but you use can use conventions/custom prefixes and setup branch restriction for them. Wouldn't that suffice?


Tags: bitbucket-cloud

cloud
How to rename a project in BitBucket?
Asked by Rodrigo:

Every tutorial refer to a sidebar where should there be settings and stuff, but there is nothing but the project name.


Answers:
author: Ulrich Kuhnhardt _IzymesCo_
body: Hi Rodrigo,

If I get this right you are looking for project permissions? Can you add a screenshot that elaborates on the problem?

It looks like you can't retro-fit project admin permissions for existing projects.

I have tried the following:

1. Create a bitbucket group with permission "Can create projects in this workspace", or modify an existing group permission.
2. Users in this group can *create* projects _AND_ are project admins in these new projects.

Let us know if this addresses your problem.

Cheers Ulrich

// [Izymes](https://marketplace.atlassian.com/vendors/1210584/izymes-pty-ltd)


Tags: bitbucket-cloud

cloud

project
How to Shorten Path Length in Bitbucket Pipeline on Windows Runner to Avoid the 260-Character Limit?
Asked by Yogesh Kumar:

Hello everyone,

I'm running a Bitbucket pipeline on a self-hosted Windows runner and facing an issue where the path length exceeds the 260-character limit. The error I'm getting is:

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

One part of the path causing this issue is:

C:\\atlassian-bitbucket-pipelines-runner\\temp\\3d11a41f-2e60-591a-a062-7bd73203596d\\1722928878980

The numeric value (`1722928878980`) changes every time I start the runner, making it challenging to manage the path length.

Is there a way to shorten or control the path length in Bitbucket pipelines, especially for dynamically generated paths? How can I prevent this error from occurring?

Any advice would be greatly appreciated!


Answers:
author: Patrik S
body: Hello [@Yogesh Kumar](/t5/user/viewprofilepage/user-id/5572153) ,

and welcome to the Atlassian Community!

The 260 character limits is actually a limitation on the Windows environment itself. A few workarounds you may want to try are :

* Using a shorter base path (e.g. "**C:\\runners\\**")
* Change the default maximum characters in Windows See relevant links below
  * [Microsoft Maximum File Path limitation](https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd)
  * [Windows default path length](https://knowledge.autodesk.com/support/autocad/learn-explore/caas/sfdcarticles/sfdcarticles/The-Windows-10-default-path-length-limitation-MAX-PATH-is-256-characters.html)

I hope that helps! Let us know if you have any questions.

Thank you, [@Yogesh Kumar](/t5/user/viewprofilepage/user-id/5572153) !

Patrik S


Tags: bitbucket-cloud

cloud
How to get name of the step of the pipeline and use that name in Email notify subject
Asked by Abinaya Abi:

I am using Cypress and Bitbucket for CI/CD. I have scheduled the run in bitbucket pipeline. I use the email notify feature in after script to get the test result via mail. it is difficult for me to understand which module failed. I have added bitbucket build number, step uuid. But, I want to include the name that I have added in the script.

I want the {BITBUCKET_STEP_NAME} to have the name of the step that is "Module 1". But, it was not working.

step: \<\<: default-step

name: Module 1

after-script:

pipe: atlassian/email-notify:0.13.1

variables:

USERNAME: "xxxx@gmail.com"

PASSWORD: "......"

FROM: "xxxx@gmail.com"

TO: "yyyy@gmail.com"

HOST: "smtp.gmail.com"

PORT: 587

DEBUG: "true"

SUBJECT: "${BITBUCKET_STEP_NAME} \[STAGING\] BUILD# ${BITBUCKET_BUILD_NUMBER} ${STATUS}: ${BITBUCKET_STEP_NAME} Notification for ${BITBUCKET_BRANCH}."

BODY_PLAIN: "The artifacts can be downloaded from the following URL: $ARTIFACTS_URL"

${BITBUCKET_STEP_NAME}

${BITBUCKET_STEP_NAME}

${BITBUCKET_STEP_NAME}


Answers:
author: Ben
body: Hi Abinaya,

BITBUCKET_STEP_NAME is not a default variable that can be referred to, hence why it's not returning the expected result. We have a feature request raised with our developers to include this so that it can be referenced in builds:

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

In the description of the above feature request, there is a workaround for grabbing the step name within the build script by using our [REST API](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/) and authenticating with [App Password](https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password/) - for example:

```
 BITBUCKET_STEP_NAME=$(curl --request GET --url "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_FULL_NAME}/pipelines/%7B${BITBUCKET_PIPELINE_UUID}%7D/steps/%7B${BITBUCKET_STEP_UUID}%7D?fields=name" -u $BITBUCKET_USERNAME:$BITBUCKET_APP_PASSWORD | jq -r '.name')
```

I hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Detect merge done through Pull Request
Asked by Jason Kim:

Hi   
The scenario is as follows.  
1. A user makes a pull request through the Bitbucket UI

2. The use clicks on the "Merge" button

3. The merge occurs and the bitbucket-pipeline gets exectued

4. the bitbucket-pipeline code tries to detect if this particular build got called because of merge.  

I Tried detecting BITBUCKET_PR_ID variable but it doesn't work.   
I tried counting the number of parents but there are times when there are 2 headers or less where there was an actual merge.  

How would you recommend detecting a merge?  

Below is the bitbucket pipeline code

image: docker/compose:latest # Docker image with Docker Compose pre-installed

pipelines:  
default:  
- step:  
name: Detect Merge Commit  
image: atlassian/default-image:3 # Switch to an image with Git pre-installed  
script:  
- \|  
if \[ -n "$BITBUCKET_PR_ID" \]; then  
echo "This build was triggered by a pull request. PR ID: $BITBUCKET_PR_ID"  
else  
echo "This build was not triggered by a pull request."  
fi  
- git rev-parse HEAD # Output the current commit hash  
- echo "Checking if the current commit is a merge commit..."  
- git rev-list --parents -n 1 HEAD  
- \|  
# Get the parent commits of the current commit  
PARENTS=$(git rev-list --parents -n 1 HEAD)  
# Count the number of parents  
NUM_PARENTS=$(echo $PARENTS \| wc -w)  
# Check if there is more than one parent  
if \[ $NUM_PARENTS -le 2 \]; then  
echo "Not a merge commit. Exiting..."  
exit 0 # Exit the step if it's not a merge commit  
fi  
# If it's a merge commit, the following scripts will run  
echo "Merge commit detected! Running merge-specific steps..."  
echo "Deploying to staging environment..."  
- \|


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

Welcome to the community!

First, could you tell me why you must locate the merge commit in your pipeline build? I want to understand your goals so we are on the same page.

That said, when a merge occurs, it should trigger a pipeline build based on that merge, so you don't have to locate a specific commit or PR as a merge.

Also, I noticed that you have paid workspace so if you want to get a quicker response, I suggest raising a ticket directly to us at our [Support portal](https://support.atlassian.com/contact/)

Regards,  
Syahrul

comments: author: Jason Kim
body: I will raise the issue through the paid portal


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
How to Resolve PowerShell Invoke-Expression Error When Using Environment Variables in Bitbucket Pipe
Asked by Yogesh Kumar:

Hello everyone,

I'm encountering an issue with a Bitbucket pipeline running on a self-hosted Windows runner. I'm trying to use environment variables to execute `nuget.exe` via PowerShell, but I'm getting an error related to `Invoke-Expression`.

Invoke-Expression : The expression after '\&' in a pipeline element produced an object that was not valid. It must result in a command name, a script block, or a CommandInfo object. At C:\\atlassian-bitbucket-pipelines-runner\\temp\\...\\tmp\\powershellScript.ps1:11 char:50 + '\& $env:NUGET_PATH restore $env:SOLUTION_PATH' \| Invoke-Expression + \~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~ + CategoryInfo : InvalidOperation: (:) \[Invoke-Expression\], RuntimeException + FullyQualifiedErrorId : BadExpression,Microsoft.PowerShell.Commands.InvokeExpressionCommand

Below is my YAML script:

pipelines:

variables:

NUGET_PATH: 'C:\\Nuget\\nuget.exe'

MSBUILD_PATH: 'some path'

MAIN_PROJECT_PATH:'some path'

SOLUTION_PATH : 'some path'

branches:

branch1:

- step:

name: Building the branch1

runs-on:

- self.hosted

- windows

script:

- "\& $env:NUGET_PATH restore $env:SOLUTION_PATH"

I've tried different variations, including using backticks and escaping, but I'm still facing the same error. Has anyone encountered this issue or know how to correctly use environment variables in this context? (My syntax in yaml file is coorect when i paste in the question bar so it is not properly formatted)

Any help would be greatly appreciated!


Answers:
author: Patrik S
body: Hello [@Yogesh Kumar](/t5/user/viewprofilepage/user-id/5572153) ,

and welcome to the Community!

Checking the YAML file you shared, I can think of two issues that are causing the error :

1. Variables definitions: I see you defined the variables directly in the YML and that syntax is not actually valid. To define variables to be used in your pipelines, you'll need to [create the variables at the workspace, repository or deployment level](https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/).
2. The syntax you have used for the command itself is slightly wrong. The following syntax should work:  

   ```
   script:

    - | 

      & "$env:MyCommand" -v
   ```

<br />

Could you try making those changes and let us know how it goes?

Thank you, [@Yogesh Kumar](/t5/user/viewprofilepage/user-id/5572153) !

Patrik S


Tags: bitbucket-cloud

cloud
New IP ranges not working
Asked by matthiasbrodelet:

Are the new IP ranges working as mentioned in this article?  
<https://bitbucket.org/blog/ip-address-update-2024>  

We have added the new ones and removed the old ones and now we can't deploy anymore with bitbucket pipelines and rsync over SSH.

Are any changes for our end even needed if we only need to SSH into our server from Bitbucket?

Our server has a whitelist of IP's that can get access so we need to whitelist Bitbucket.


Answers:
author: Ben
body: Hi [@matthiasbrodelet](/t5/user/viewprofilepage/user-id/1967889)

Those old IP addresses have not been retired yet and will be active until August 31st, so there's a chance your builds are still trying to use them.

You can verify which IP your pipelines builds are using by executing a check IP command as part of your build script:

*

  ```
  curl http://checkip.amazonaws.com/
  ```

I would suggest adding back the old IP addresses and retiring them after August 31st:

* `18.205.93.0/25`
* `18.234.32.128/25`
* `13.52.5.0/25`

I would also suggest referring to our complete IP whitelisting page for more context regarding our address ranges:

* <https://support.atlassian.com/bitbucket-cloud/docs/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall/>

Please let me know if any issues/further questions.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
How to fetch the list of Python Repos in Bitbucket using API Search Query String?
Asked by krishna murali:

Hi Team,

We are from SonarQube Code Quality Team and we are using the below Bitbucket version.

**Atlassian Bitbcuket v8.9.7**

As part of the Python Code Coverage, we are trying to identify only the **list of Python Repos** in our Bitbucket Repository using an **API Search String Query** which will list out only the **.py repos**.

Thanks,

Murali Sulam


Answers:
author: Aman Shrivastava
body: Hi Murali,  

Welcome to the Atlassian community.  

You may try the following query to list the repositories whose name ending with **.py** . Although this way of querying is not listed in the doc, it may work in your scenario.   

```
curl -u <Admin-User> --request GET --url 'http://{baseurl}/rest/api/latest/repos?limit=1000&name=%.py' --header 'Accept: application/json'
```

<br />

Regards,  
Aman


Tags: api

bitbucket-server

cloud

python

rest-api
Crucible plugin development - Not able to inject and use ReviewService
Asked by Mohan Krishan:

Hello ,

I am trying to write a test plugin to process review closed event in Crucible. EventListener functionality is working fine but i am not able to use ReviewService. Below code snippet does not work , probably reviewService is Null. Could you please help.

@Scanned  
public class NotifyPipeline implements EventListener {

private ReviewService reviewService;  

@Autowired  
public NotifyPipeline(@ComponentImport ReviewService reviewService) { this.reviewService = reviewService; }

public Class\[\] getHandledEventClasses() {  
return new Class\[\] {ReviewStateChangedEvent.class};  
}

<br />

public void handleEvent(Event event) {  
final ReviewStateChangedEvent statechangedevent = (ReviewStateChangedEvent) event;  
if (statechangedevent.getNewState().toString().equals("Closed"))  
{  
System.out.println("Event captured for review ID :: " + statechangedevent.getReviewId());  
System.out.println("Review changed to state:: " + statechangedevent.getNewState());  
PermId\<ReviewData\> cruReviewID=statechangedevent.getReviewId();  
System.out.println("Crucible review ID is :: " + cruReviewID);  
try {  
System.out.println("Review details ::" + reviewService.getAllReviewers(cruReviewID));


Answers:
author: Mohan Krishan
body: Hi All ,

Could you please suggest how to proceed further ? Below are the details.

ATLAS Version: 8.0.7  
AMPS Version: 8.0.0

Thanks in Advance!

Mohan Krishan
Administrator account wont login
Asked by eburnett:

I have reset the administrator password.

but I'm not able to login with Administrator account on server.

![fisheye_login.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/96077i411294D641DEA432/image-size/large?v=v2&px=999 "fisheye_login.jpg")


Answers:
author: Peter-Dave Sheehan
body: Hi

Are you using either crowd or jira as an authentication directory? If so, I've seen the admin password default to the jira admin password. Especially if the directory sequence makes the crowd directory first.

After resetting the fecru admin password, I find it helpful to also disable any crowd/jira directory. Unfortunately, this has to be done in the database.

With a mysql database, while fecru is down, you can try this (requires access to your database):

```
update crowd_directory set active = 'F' where directory_type ='CROWD';
```

This should make sure that you are able to login using the built-in admin password.   
Note: you should be prompted for password only, no username.

Then change the default admin password and re-enable your crowd directories.
"What's new for application links" dialog preventing adding a link
Asked by Alex:

I am trying to link Fisheye to an existing BitBucket service - after I hit the "Create new link" button it brings up a dialog, only to replace it with the "What's new for application links" dialog that was already shown on page entry. It looks at some point after it has shown the dialog a page refresh is being forced and the dialog lost.

I have tried it in an incognito browser with no extensions - still the same.


Answers:
author: Peter-Dave Sheehan
body: This is just a thought, but might you be using the built-in admin login?

Perhaps fecru is unable to store the attribute that this dialog has been dismissed for that user. Try to create a new admin user and log in as that to add your application link. After dismissing the popup, refresh the page to see if it re-appears.