youngmon/atlassian-qna huggingface dataset:
Can I capture a Bitbucket build number in a Jira issue?
Asked by Erik Spears:

We are using the Cloud products, and while I keep finding server product answers to this online, they don't immediately seem workable in the Cloud versions.

So, my use case / ask is this: After a PR is merged and build process completes (or even if it doesn't), I'd like to get that Bitbucket build number displayed (and linked, ideally) in the corresponding Jira ticket.

I know the BB build number is available in some sense from this page (and others): <https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/>

See the second row of the table: BITBUCKET_BUILD_NUMBER

However, the custom field options I'm seeing in the Cloud version of Jira aren't obvious candidates for pulling this in, but I'm open to all options or ideas! :D

Thanks for any suggestions!


Answers:
author: Theodora Boudale
body: Hi Erik,

The BITBUCKET_BUILD_NUMBER is a Pipelines variable and it is accessible only to the build while it is running. It cannot be used outside of the build.

We have an integration for Bitbucket Pipelines and Jira Software that allows you to see build information on a Jira issue, however, it requires that you put the issue key in the branch name:

* <https://support.atlassian.com/bitbucket-cloud/docs/integrate-jira-and-pipelines/>

I am quoting the example from the documentation, if you have a branch named 'feature/ST-1-build-mk2-boosters', then build information would appear in the Jira issue ST-1 every time your pipeline runs against a commit within that branch. I'm not sure if this is something that would suit your needs?

Another idea would be to have a custom field in Jira, and then update its value via an API call in the after-script of the Pipelines build. One issue here would be how to get the Jira issue key during the build, in order to update the Jira issue.

I was wondering if you could give us some more details on your use case, so we can see if there's a way to achieve what you like:

**1.** You mention "After a PR is merged and build process completes": how are these builds defined in the yml file? Is it builds that run automatically on a specific branch, e.g. master or develop, and they get triggered when you merge a PR to that branch? Or are they custom builds?

**2.** Do you use the source branch of each PR for only one Jira issue?

**3.** Do you have Jira issue keys references in the commits of the source branch of the PR? In the title of the PR? Or in the merge commit? And, related to the previous question, do you only reference one Jira issue in each source branch?

Kind regards,  
Theodora


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

custom-field

jira-cloud

jira-software-cloud
Bitbucket pipeline to deploy to ECS started to Fail
Asked by vitali:

Our Bitbucket pipeline didn't have any changes and now started to fail for some reason with:

ontent-type:application/x-amz-json-1.1host:ecs.us-east-1.amazonaws.comx-amz-date:20210817T154801Zx-amz-target:AmazonEC2ContainerServiceV20141113.UpdateServicecontent-type;host;x-amz-date;x-amz-target3850981412382e2c1ae4cd3325ded13c1006413ac6eda6cab047a39db44a2d85DEBUG: StringToSign:AWS4-HMAC-SHA25620210817T154801Z20210817/us-east-1/ecs/aws4_request05b2ff041099d36abbf116367d5f17808ba28d046d0e31188ece3e77868154c3DEBUG: Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=<https://ecs.us-east-1.amazonaws.com/>, headers={'X-Amz-Target': b'AmazonEC2ContainerServiceV20141113.UpdateService', 'Content-Type': b'application/x-amz-json-1.1', 'User-Agent': b'Boto3/1.9.139 Python/3.7.4 Linux/5.4.92-flatcar Botocore/1.12.187', 'X-Amz-Date': b'20210817T154801Z', 'Authorization': b'AWS4-HMAC-SHA256 Credential=AKIAZIZFNPKKL4HVQT55/20210817/us-east-1/ecs/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=4142a6faf487347b4568c2db1fb1f9cde43c425fa4a1c88ef43ce0631b6455ab', 'Content-Length': '160'}>DEBUG: Converted retries value: False -> Retry(total=False, connect=None, read=None, redirect=0, status=None)DEBUG: Starting new HTTPS connection (1): [ecs.us-east-1.amazonaws.com](http://ecs.us-east-1.amazonaws.com/)DEBUG: [https://ecs.us-east-1.amazonaws.com:443](https://ecs.us-east-1.amazonaws.com/) "POST / HTTP/1.1" 400 37DEBUG: Response headers: {'x-amzn-RequestId': 'aba9ae17-13e1-42b6-8265-94d14ccc4bc9', 'Content-Type': 'application/x-amz-json-1.1', 'Content-Length': '37', 'Date': 'Tue, 17 Aug 2021 15:48:02 GMT', 'Connection': 'close'}DEBUG: Response body:b'{"__type":"ClusterNotFoundException"}'DEBUG: Event needs-retry.ecs.UpdateService: calling handler <botocore.retryhandler.RetryHandler object at 0x7f968020ad50>DEBUG: No retry needed.? ECS cluster not found. Check your ECS_CLUSTER_NAME.

Does anyone know, if some outage is happening on Bitbucket side or AWS side? Or some configuration changed? My current pipeline was working and deploying to ECS all this 1 year already and no changes actually were added to repo,

Best Regards,

Vitali


Answers:
author: Halyna Berezovska
body: [@vitali](/t5/user/viewprofilepage/user-id/4192774) you did not change the pipeline, but , perhaps, did change the setup in your cloud.

It says: ClusterNotFoundException , that means that someone with access to your aws deleted specific cluster that you want to update.

Regards, Galyna


Tags: bitbucket-pipelines

bitbucket-cloud

cloud
One-time Recovery Link does not work. Oops you've made a malformed request.
Asked by hab:

Hello.

Switched phones, and forgot to switch my 2FA settings before I did so. I no longer have access to the old phone.

So I submitted a request to recover the account, which makes you wait 12 hours or what. Fine. Got the email this morning containing the recovery link.

It doesn't work. "Oops you've made a malformed request" every time. After poking thru the distressingly large number of threads here of ppl having the same issue, here's what I have tried so far, based on those threads:

**3 browsers: Firefox, Chrome, Safari. I have disabled all extensions in each one, I have cleared all site data on each one. They are all the latest version. Tried both regular and incognito windows.**

No luck at all.

The error prompts me to contact support, which would be a neat trick, since I need to log in to do that and I can't. I created this account specifically to ask this question.

Some other info: I am literally the only person on my account. There's no organization/enterprise/anything like that. I am a lone developer. THIS account is NOT the account with the issue.

TIA.


Answers:
author: hab
body: Bump? This is still unresolved.


Tags: bitbucket-cloud

cloud
Import from Github is not working
Asked by Lukasz Dudziak:

Few weeks ago I was able to import successfully few repositories from Github but today I have an error:   
**Your import has failed. For more information, check the log below. You can also try your import again.**Problem is that there are no logs in the gray box below. It is empty. I tried few times and it is not working for me. I tried with few private repos but without success.

Is this bitbucket issue that import from github is no longer possible?


Answers:
author: Lukasz Dudziak
body: **SOLUTION**

1. In your Github settings create Personal Access Token (instruction is here: <https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token>)
2. In the Import Repo page (<https://bitbucket.org/repo/import>) select "Requires authorization" checkbox, then put your Github login and generated access token instead of your normal password.
3. Fill the rest of the form and click Import Repository. It should work!


author: Craig Castle-Mead
body: Wondering if you tested with a public repo just to see if the basic connectivity/import function worked?

CCM

comments: author: jad.bendarkawi
body: I'm also having this issue. Importing a public repo works but I'm still getting an import error (empty log) when I try to import my private repo.


author: Lukasz Dudziak
body: [@Craig Castle-Mead](/t5/user/viewprofilepage/user-id/224850) yes, import of public repositories is working fine.


author: Lukasz Dudziak
body: [@Craig Castle-Mead](/t5/user/viewprofilepage/user-id/224850) this problem might be related to recent change that blocks password authentication. See more details here <https://github.blog/changelog/2021-08-12-git-password-authentication-is-shutting-down/>


author: Craig Castle-Mead
body: Seems like a likely culprit!


Tags: bitbucket-cloud

cloud

github

import
Getting warning when trying to perform ec2 deployment using AWS codedeploy.
Asked by Digvijay Singh:

I m trying to create pipeline for deployment on AWS ec2 instance using AWS codedeploy.I am getting this warning **Expected a section but found sequence.** Below is my image for reference:

![aws.png](/t5/image/serverpage/image-id/156273iFDC2A7BDFFDDABA2/image-size/large?v=v2&px=999 "aws.png")As we can see I am getting a warning in first line.I am unable to understand what is this about. Someone please let know.


Answers:
author: Craig Castle-Mead
body: Stab in the dark here, but have you tried adding script: in line 1?

<https://support.atlassian.com/bitbucket-cloud/docs/deploy-to-aws-with-codedeploy/> shows this in all its examples

CCM

comments: author: Digvijay Singh
body: Yeah I tried it but its showing error **Unexpected property script,did you mean pipelines?**


Tags: bitbucket-pipelines
Is it possible for a 3rd party to access my server code and save data by using bitbucket.?
Asked by Jhak Uss:

Is it possible for a 3rd party to access my server code and save data by using bitbucket.?

one of our server has been accessed by someone and new account created.


Answers:
author: Nic Brough -Adaptavist-
body: Yes.

If you (or another admin) has allowed them to sign up for an account, or given them one, then yes, they'll have access to your code.

My guess is that you'll want to turn off the self-sign-up so they all have to go through your admins.
How to anonymize the file contents inside a Repository in Bitbucket
Asked by Somenath.Chanda:

I am new to BitBucket \& I wish to **anonymize** the content of the files inside a Repository in BitBucket. Suppose there are hundreds of files in a repository and in each of the file, I want to **replace a phrase 'ABC Corp' with 'XXX XXXX'**. Is that possible ? Please note, I do not intend to manually change those files and perform COMMIT.

Thank You.

Somenath Chanda


Answers:
author: Craig Castle-Mead
body: Hi,

While you can checkout, global replace (many methods such as your IDE or sed/other Linux utility) then commit, you'll need to consider that the original content will be available in the previous commits, so if they're sensitive enough (or GDPR issues), you may want to delete the repo and re-push your cleaned code

<https://secretaudit.com/docs/how-to-remove-secrets-from-git-history>

CCM


Tags: anonymous

bitbucket-cloud

cloud
Deploy to private server behind public server using ssh
Asked by L Rico:

Hi, i have application server which can only accessed via bastion server.

the topology is like ![Screenshot from 2021-08-17 10-00-08.png](https://community.atlassian.com/t5/image/serverpage/image-id/156223i8ACC7AFB01F06805/image-size/large?v=v2&px=999 "Screenshot from 2021-08-17 10-00-08.png")

The bastion server itself can be accessed from public, so have no issue to run pipeline.

I already add bitbucket generated "SSH Key" and "known hosts". It runs perfectly if i deploy to Bastion server.  

What i've done :

1. Put bitbucket generated ssh Key to bastion \& application server  
2. add in the yaml file the result is run perfectly

*image: atlassian/default-image:2*   
*pipelines:*   
*default:*   
*- step:*   
*name: 'Deployment to Staging'*   
*deployment: staging*   
*script:*   
*- ssh -v -p 22 user@bastion_public_ip 'cd /var/www/html;git pull"'*

<br />

3. Change in the yaml file the result is cannot connect. (Port 3000 is forwarding, I can access it from other server / my local)

*script:*   
*- ssh -v -p 3000 user@bastion_public_ip 'cd /var/www/html;git pull"'*

4. Add the key directly in the yaml file, cannot connect

*script:*   
*- ........*   
*- ssh -v -p 3000 -i bastion_key user@bastion_public_ip 'cd /var/www/html;git pull"'*

Hope you guys can guide me the step and sample yaml file  
Thank you


Answers:
author: Mark C
body: Hi [@L Rico](/t5/user/viewprofilepage/user-id/4518295)

Welcome to the community.

Based on your updated command, you're now using port 3000.  
For this, would it be possible for you to check if Pipelines can connect to your server via port 3000?  
You can check it by using telnet and using the **ssh -T** command.

```
- apt-get update && apt-get install telnet- telnet bastion_public_ip 3000- ssh -Tv user@bastion_public_ip -p 3000
```

If Bitbucket Pipelines is not allowed to connect to your server, you might want to allowlist Bitbucket Pipelines IPs on your server/network.  
You can find Pipelines IPs on this link. - [What are the IP addresses to configure a corporate firewall?](https://support.atlassian.com/bitbucket-cloud/docs/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall/) (Under "Valid IP addresses for Bitbucket Pipelines build environments")

Let me know how it goes.

Regards,  
Mark C


Tags: bitbucket-pipelines

bitbucket-cloud

cloud
build an apk (v1 signature) using pipeline
Asked by Victor Hernandez:

Hello I already have the steps to build an apk using bitbucket pipelines, the problem I got is, I don't know how to specify how to sign it as V1, it seems the default is V2, here my yml file

```
image: androidsdk/android-30

pipelines:
  branches:
    'base':
      - step:
          name: Create Keystores
          script:
            - mkdir keys # create new directory
            - echo $DEBUG_KEYSTORE_FILE_BASE64 | base64 -d > keys/$DEBUG_KEYSTORE_FILE # decode base64 then use DEBUG_KEYSTORE_FILE as file name defined in repository variable
          artifacts:
            - keys/** # keep these artifacts for subsequent pipeline steps

      - step:
          name: Build & Deploy (Internal)
          caches: # caching speed up subsequent execution https://support.atlassian.com/bitbucket-cloud/docs/cache-dependencies/
            - gradle
          script:
            # publish the aab file to the internal testing channel
            # the plugin publishes to the internal testing track by default
            - chmod +x gradlew
            - "./gradlew -PDEBUG_KEYSTORE_FILE=../keys/$DEBUG_KEYSTORE_FILE
                         -PDEBUG_KEYSTORE_PASSWORD=$DEBUG_PASSWORD
                         -PDEBUG_KEYSTORE_KEY_ALIAS=$DEBUG_KEY_ALIAS
                         -PDEBUG_KEYSTORE_KEY_PASSWORD=$DEBUG_KEY_PASSWORD
                          assembleDebug"
          artifacts:
            - app/build/outputs/** # artifacts are files that are produced by a step https://support.atlassian.com/bitbucket-cloud/docs/use-artifacts-in-steps/
```

Where and how can I specify the V1 jar signature?

Thank you!!


Answers:
author: Victor Hernandez
body: It's working now, I added the signing configs on my android build.gradle, that was the problem.


Tags: android

bitbucket-pipelines

cloud
Checkout Pull Request on Bit Bucket Cloud
Asked by dominic_ks:

Is there a way to checkout a PR on Bit Bucket Cloud from a fork that you don't have read access to?

I read this, but I don't think this works without having read access to the fork that the PR is coming from:

* <https://confluence.atlassian.com/bbkb/how-to-locally-fetch-and-checkout-a-pull-request-724402529.html>

And I read this one, but not sure this is relevant to Bit Bucket Cloud:

* <https://www.atlassian.com/git/articles/pull-request-proficiency-fetching-abilities-unlocked>

Is this possible or no?


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

I'm afraid that at the moment this is not possible. Both links you posted in your question are applicable to Bitbucket Cloud, however, read access is needed to the fork in order to be able to fetch from it.

We have a feature request for having repository refs for pull requests, something that would allow users to fetch PRs locally without needing access to the fork:

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

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

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

Please feel free to let me know if you have any questions.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
SourceTree crash loop
Asked by MaxX Nikishin:

At some point after commit SourceTree crashes.

And when i try to restart it, it crashes again.

(SourceTree_2012-11-06-143008_DesignerMacMini.crash.log)


Answers:
author: MaxX Nikishin
body: btw how can i reset cache or smthing to run SourceTree on different repo?

becouse i think this error caused by current working repository

reinstalling wont help


author: Jana Bales
body: I've got a similar problem. I wanted to commit something today, but just when I opened SourceTree, it instantly crashed with a long list of error messages which would be sent to apple automatically.

My error.log tells me:

Nov 6 15:31:50 \~ SourceTree\[515\]: SourceTree(515,0x100681000) malloc: reference count underflow for 0x200015f80, break on auto_refcount_underflow_error to debug.

Nov 6 15:31:50 \~ /Applications/SourceTree.app/Contents/MacOS/SourceTree\[515\]: open on /Users/taliah/Library/Application Support/SourceTree/MASReceipt/ACaw8qSw: File exists

Nov 6 15:31:50 \~ \[0x0-0x44044\].com.torusknot.SourceTree\[515\]: SourceTree(515,0x100681000) malloc: reference count underflow for 0x200015f80, break on auto_refcount_underflow_error to debug.

Nov 6 15:31:50 \~ SourceTree\[515\]: Could not connect the action registration: to target of class SourceTreeAppDelegate

Nov 6 15:31:50 \~ SourceTree\[515\]: Could not connect the action installCommandLineTools: to target of class SourceTreeAppDelegate

Nov 6 15:31:50 \~ \[0x0-0x44044\].com.torusknot.SourceTree\[515\]: objc\[515\]: GC: 0x101833ef0 + 24 isn't in the auto_zone, break on objc_assign_ivar_error to debug.

Nov 6 15:31:50 \~ \[0x0-0x44044\].com.torusknot.SourceTree\[515\]: objc\[515\]: GC: 0x101833ef0 + 8 isn't in the auto_zone, break on objc_assign_ivar_error to debug.

Nov 6 15:31:50 \~ \[0x0-0x44044\].com.torusknot.SourceTree\[515\]: objc\[515\]: GC: 0x101833ef0 + 64 isn't in the auto_zone, break on objc_assign_ivar_error to debug.

Nov 6 15:31:50 \~ \[0x0-0x44044\].com.torusknot.SourceTree\[515\]: objc\[515\]: GC: 0x101833ef0 + 72 isn't in the auto_zone, break on objc_assign_ivar_error to debug.

Nov 6 15:31:50 \~ \[0x0-0x44044\].com.torusknot.SourceTree\[515\]: objc\[515\]: GC: 0x1003884a0 + 48 isn't in the auto_zone, break on objc_assign_ivar_error to debug.

Nov 6 15:31:50 \~ \[0x0-0x44044\].com.torusknot.SourceTree\[515\]: objc\[515\]: GC: 0x0 + 8 isn't in the auto_zone, break on objc_assign_ivar_error to debug.

Nov 6 15:31:51 \~ com.apple.launchd.peruser.501\[317\] (\[0x0-0x44044\].com.torusknot.SourceTree\[515\]): Job appears to have crashed: Segmentation fault

Nov 6 15:31:51 \~ ReportCrash\[517\]: Saved crash report for SourceTree\[515\] version 1.5.5 (1.5.5) to /Users/taliah/Library/Logs/DiagnosticReports/SourceTree_2012-11-06-153151_Taliahs-MacBook-Pro.crash

I've already restarted my mac and even reinstalled SourceTree, but it still remains the same and instantly crashes again and again.

I wanted to report a bug, but I wasn't able to find out how.

If somebody could help me out, it would be really great.


Tags: crash
"Errors during merge" -- can't resume rebase
Asked by Ken Ficara:

I am doing a rebase, resolved some conflicts using FileMerge, and I have no outstanding conflicts. However when I resume the rebase, I get a dialog saying "Errors during merge," with no further information. Aside from aborting the rebase and starting over, how do I resolve this????


Answers:
author: Ken Ficara
body: OK, this was the problem -- I am working on a Mac and using FileMerge as the external merge tool. FileMerge was set to create a backup of the pre-merge file (with an .orig) suffix. Adding a new file during rebase gets Sourcetree (CORRECTION: git) very upset. Once that was removed, the rebase continues fine.

Atlassian, please improve that error message? (Or include suggestions on possible causes?)

comments: author: stevestreeting
body: The message actually comes from git rather than SourceTree, but if we can we'll try to intercept it in future.


author: Ken Ficara
body: Ah, that makes sense. Just took me a while to figure out what it was so upset about. I've also had trouble if I resolve with a merge tool and THEN hand edit. I had to unstage and restage the file to continue the rebase. Thanks.


author: stevestreeting
body: Ah yes, this is because git requires you to stage all your changes before you continue the rebase. Another way to resolve if you hand-edit is to right-click \> Resolve \> Mark Resolved.


author: stevestreeting
body: Are you sure it's not just because there are further conflicts generated from the next commit in the rebase? The rebase stops every time conflicts are encountered, then when you resolve and continue the rebase it applies the next commits in order and stops again if it hits more conflicts etc.
customized git log output
Asked by Daniel B?chtle:

Hello,

is was wondering if there is the possibility to create a customized git log. We are working with different version and bugfix branches in git and need to know, which of the commits haven't been cherry picked from the bugfix to the version branch.

Via the command line it goes like this:

```
git log --cherry-pick --oneline --no-merges branch1...branch2
```

Greets, Daniel


Answers:
author: stevestreeting
body: Sorry, you can't add extra options to the log display right now. A couple of things that may or may not help:

1. You can multi-select rows in the log and SourceTree will show the difference between those two points in time (although it only shows the changes, not the individual commits)
2. You can run Custom Actions to perform any command you like, but that obviously won't be formatted nicely or allow you explore the content like you can do normally with commits inside ST

comments: author: Daniel B?chtle
body: Is something like this planed? We're a big team and not everybody is capabale of using the command line (or doesn't want to).


author: stevestreeting
body: I've added a feature request for more log filtering options: <https://jira.atlassian.com/browse/SRCTREE-1261>

FWIW, I've always organised bugfix / release branches so that you there's no need to cherry-pick (unless someone commits to the wrong branch), since bugfix branches are always merged forward wholesale into the main development branch, rather than cherry-picking bugfixes back into the fix branch. This is also how git-flow recommends that you work.


author: Daniel B?chtle
body: Thank you. I certainly agree with you that this is be best workflow. Unfortunaltely our workflow isn't like that. We've only got "huge" versions (like 1, 2, 3, 4) and especially bugfixes need to be cherry-picked from the main development branch into the older versions.

It's like this:

```
master -&gt; bugfix_version_1 -&gt; version_1
```

In the bugfix branch the commits are checked and eventually cherry-picked into the older version. With a lot of versions and developers it's hard to keep track. And the command I posted above works fine to determine which of the bugfixes ain't in the version.

If I would be able to get this in the search view it would help a lot.