youngmon/atlassian-qna huggingface dataset:
Connection issue from Bitbucket server --> Bitbucket cloud
Asked by Jagadeeswar Reddy:

Hello Team,

We are using "Bitbucket Cloud Migration Assistant" plugin for the migration of Bitbucket server to cloud. But when it is trying to connect to cloud Bitbucket it is not able to reach and we get below error logs are server level.

===

2022-05-10 11:22:36,602 DEBUG \[http-nio-8991-exec-5\] xxxxx @KWOZFWx682x18466x0 1qkobh5 "POST /rest/migration/latest/mas/event/screen HTTP/1.0" c.a.b.p.bcma.version.VersionService Found version 1.3.11 for plugin with key com.atlassian.bitbucket.migration.bitbucket-migration-plugin.  
2022-05-10 11:22:38,697 DEBUG \[http-nio-8991-exec-1\] xxxxxx@KWOZFWx682x18470x0 1qkobh5 "POST /rest/migration/latest/mas/event/screen HTTP/1.0" c.a.b.p.bcma.version.VersionService Found version 1.3.11 for plugin with key com.atlassian.bitbucket.migration.bitbucket-migration-plugin.  
2022-05-10 11:22:42,890 ERROR \[http-nio-8991-exec-6\] xxx @KWOZFWx682x18472x0 1qkobh5 "POST /rest/migration/latest/cloud/generate-setup-url HTTP/1.0" c.a.p.r.c.e.j.ThrowableExceptionMapper Uncaught exception thrown by REST service: service matching filter=\[(objectClass=com.atlassian.analytics.api.services.AnalyticsConfigService)\] unavailable

===

Using browser "Development tool" we could see below error message.

===

Request URL: [https://xxxxx/bitbucket/rest/migration/latest/cloud/generate-setup-url](https://test.dev-bosch.com/bitbucket/rest/migration/latest/cloud/generate-setup-url)  
Request Method: POST  
Status Code: 500 Internal Server Error  
Remote Address: xxxxxx:8080  
Referrer Policy: no-referrer

Note: Bitbucket server hosted behind nginx reverse proxy and below is the configuration we are using.

===

}  
location /bitbucket {  
proxy_set_header X-Forwarded-Host $host;  
proxy_set_header X-Forwarded-Server $host;  
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
proxy_set_header X-Real-IP $remote_addr;  
proxy_pass <http://xxxxx:xxx/bitbucket>;  
proxy_redirect off;  
client_max_body_size 20M;


Answers:
author: DH
body: Ever find what was causing this? Just ran into the same issue trying to use the migration assistant, and this server has successfully run the migration previously during testing.


Tags: bitbucket-server

migration-customer-care

server
Pipeline trigger run fails
Asked by Steven Delrue:

When running a trigger in bitbucket pipelines, I get this error :

```
 Error: {"error": {"message": "Bad request", "detail": "bitbucket-pipelines.yml not found.", "data": {"key": "result-service.pipeline.yml-not-found", "arguments": {}}}}
```

The repo which should trigger the pipeline is a private team repo, but I should have all the rights (I can read \& write to the repo)

This is bitbucket-pipelines.yml:  

```
pipelines:
  branches:
    development:
      - step:
          name: Trigger Boilerplate & Xperify Build (development)
          script:
            - pipe: atlassian/trigger-pipeline:5.0.0
              variables:
                BITBUCKET_USERNAME: $TRIGGER_USERNAME
                BITBUCKET_APP_PASSWORD: $TRIGGER_PASSWORD
                REPOSITORY: oculariumfrontendboilerplate
                REF_TYPE: 'branch'
                REF_NAME: 'development'
            - pipe: atlassian/trigger-pipeline:5.0.0
              variables:
                BITBUCKET_USERNAME: $TRIGGER_USERNAME
                BITBUCKET_APP_PASSWORD: $TRIGGER_PASSWORD
                REPOSITORY: ocularium-frontend-xperify
                REF_TYPE: 'branch'
                REF_NAME: 'development'
```

The app password I generated has the correct permissions set


Answers:
author: Mark C
body: Hi [@Steven Delrue](/t5/user/viewprofilepage/user-id/3095421)

Thank you for reaching out to the community.

Based on the error message, it seems there's no recognized file (bitbucket-pipelines.yml) in the "development" branch of your private repository.

Would it be possible for you to check if the file (bitbucket-pipelines.yml) exists in the private repository "development" branch?  
You can use this link to check it, just change it with your workspace ID and repository name:

```
https://bitbucket.org/workspace_id/repo_name/src/development/
```

Let me know how it goes.

Regards,  
Mark C

comments: author: Steven Delrue
body: It turns out that the problem was that the bitbucket-pipelines.yml file was present in the target repository (the repo which is getting triggered), but it didn't contain a pipeline matching the development branch.


author: Tiago Emanuel Felix Mateus
body: [@Steven Delrue](/t5/user/viewprofilepage/user-id/3095421) sorry, Im new at this, could you clarify what you mean with "a pipeline matching the development branch"?

Im having the exact same issue.


author: lissyaka
body: Hi [@Steven Delrue](/t5/user/viewprofilepage/user-id/3095421) .  

Also please check that you enabled pipeline support in your triggered repository.  

Cheers


Tags: bitbucket-cloud

cloud

trigger
Allow branch creation only from JIRA
Asked by Vishal Paike:

I want to restrict branch creation only from JIRA. Devs should not be able to create branches from anywhere else. Is this possible on bitbucket cloud?


Answers:
author: Mark C
body: Hi [@Vishal Paike](/t5/user/viewprofilepage/user-id/2706392)

Thank you for reaching out to the community.

Unfortunately, it is not possible to restrict branch creation only from Jira.  
For this, I went ahead and created a feature request for it that can be located through this link. - <https://jira.atlassian.com/browse/BCLOUD-21894>  
You can upvote and watch it for now so that you'll be notified of any updates from our team when the feature becomes available on Bitbucket Cloud.  
![](https://getsupport.atlassian.com/images/icons/emoticons/information.png) Please do note that we don't have an exact ETA for the feature request as all new features will be implemented according to our policy [here](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html).

Hope it helps and let me know if you have further questions.

Regards,  
Mark C

comments: author: Vishal Paike
body: Hi [@Mark C](/t5/user/viewprofilepage/user-id/1210823) , thanks for clarifying. However, I want to understand if there is an app like

***control freak hook for bitbucket data center*** for bitbucket cloud?


author: Mark C
body: Hi [@Vishal Paike](/t5/user/viewprofilepage/user-id/2706392)

I checked the app in the [Atlassian Marketplace](https://marketplace.atlassian.com/apps/1217635/control-freak-hook-for-bitbucket-data-center?tab=overview&hosting=server), however, it is only available for Bitbucket Data Center.  

I searched some apps but there was no available app for Bitbucket Cloud.  

Alternatively, Bitbucket Cloud has this feature to [require issue keys in commit messages](https://support.atlassian.com/bitbucket-cloud/docs/link-to-a-web-service/).  

Let me know if you have further questions.

Regards,  
Mark C


author: Vishal Paike
body: Hi [@Mark C](/t5/user/viewprofilepage/user-id/1210823) ,

Thanks for response! I explored this feature but it does not validate the JIRA ticket! I can put any random number with correct project prefix and it is accepted. Eg - If *TEST-123* is a valid ticket but if even though *TEST-10000* does not even exist and developers add *TEST-10000* in commit message, bitbucket accepts it.


author: Mark C
body: Hi [@Vishal Paike](/t5/user/viewprofilepage/user-id/2706392)  

Unfortunately, the feature only checks the format for the issue key but it doesn't validate its existence.

There's an existing feature request for it [here](https://jira.atlassian.com/browse/BCLOUD-20644) to validate its existence before linking a Jira issue key. You can also upvote/watch it to get updates from our product team.

Regards,  
Mark C


Tags: bitbucket-cloud

cloud

jira
How do I change diff colors?
Asked by Asmus Koefoed:

I would like to change the diff colors, is it possible?


Answers:
author: Brant Schroeder
body: [@Asmus Koefoed](/t5/user/viewprofilepage/user-id/4918245) Welcome to the Atlassian community

You cannot change the colors through the delivered application. There is this app in the marketplace but I am not sure it has what you are after. [https://marketplace.atlassian.com/apps/1212632/look-and-feel-for-bitbucket-server?tab=overview\&hosting=datacenter](https://marketplace.atlassian.com/apps/1212632/look-and-feel-for-bitbucket-server?tab=overview&hosting=datacenter)

comments: author: Asmus Koefoed
body: Hi Brant. Thank you for your reply.

I was hoping to be able to change the diff colors away from pastel colors to something darker and thought there might have been a user setting I've missed.


author: Brant Schroeder
body: [@Asmus Koefoed](/t5/user/viewprofilepage/user-id/4918245) You could change the theme. This still does not give you access to change individual colors but it does provide you with the ability to have a different look and feel.

Go to your repository's admin-tab, and click "Appearance Settings" under "Additional options/settings".

Here you can choose from a list of themes, and when switching theme in the dropdown the preview to the right will update immediately.


Tags: bitbucket-server

server
Problem: "Someone has already added that key as an access key to a repository."
Asked by yang8392:

I cannot add my SSH key to my account because of this: "Someone has already added that key as an access key to a repository."

I have checked all the places (company user, all the repositories I see etc.) but this key is not associated to none of the repositories nor users I know of.

I have tried to SSH bitbucket.org, but is does not say any details:


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

I have created a ticket with the support team so you can share the public SSH key you are trying to add and we can then check in our system where this key is added. The support ticket is visible only to you and Atlassian staff.

I used the email of your community account to create the ticket, you should have received an email with a link to the support ticket. Please leave a reply in the ticket and share the public SSH key you are trying to add, and one of the Bitbucket Cloud support engineers is going to look into this.

Kind regards,  
Theodora


Tags: bitbucket-cloud
API request failed with status 401. Check your account and app password and try again.
Asked by SAGAR PAWADI:

#Given below parameters correctly in the pipeline, but still getting errors  

script:  
- pipe: atlassian/trigger-pipeline:5.0.0  
variables:  
BITBUCKET_USERNAME: 'sagarpawadi-admin'  
BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD  
REPOSITORY: 'CICDDL.License'  
ACCOUNT: 'LYZERCICD'  
##Errors  
0600a5d33135: Pull complete  
2566fc56a1b4: Pull complete  
839a8a969a56: Pull complete  
Digest: sha256:029e80242186e4668d334622085a0519ebbced0df99a7d540d70870ff9daa15c  
Status: Downloaded newer image for bitbucketpipelines/trigger-pipeline:5.0.0  
? API request failed with status 401. Check your account and app password and try again.  
Note: BITBUCKET_APP_PASSWORD has been created in App password section with all privilege's.


Answers:
author: Ryan Geddings
body: Was there a resolution to this? I've tried passing my user id and generated app password as variables and plaintext with the same results.

comments: author: Ryan Geddings
body: I found the answer here, [Solved: ? API request failed with status 401. Check your u... (atlassian.com)](https://community.atlassian.com/t5/Bitbucket-questions/API-request-failed-with-status-401-Check-your-username-and-app/qaq-p/1371846) I was using my users email not the explicit username associated with the user.


author: o_kyrdan
body: Hi [@SAGAR PAWADI](/t5/user/viewprofilepage/user-id/4868345)

Thank you for your question!

1. Check username.

2. Make sure that current user have rights to access this repository.

3. The next to check, permissions for BITBUCKET_APP_PASSWORD.

More detail you could find in the [Readme of the trigger-pipeline pipe](https://bitbucket.org/atlassian/trigger-pipeline/src/master/README.md).

Best regards,  
Oleksandr Kyrdan

comments: author: SAGAR PAWADI
body: Hi [@o_kyrdan](/t5/user/viewprofilepage/user-id/2862136) ,   

All the above 3 points are taken care, But still same issue persists.


author: o_kyrdan
body: Also, you could re-set up Repository Variables, to make sure you copy-paste values without trail spaces or other symbols in the value.

It's a common issues during setup.


author: SAGAR PAWADI
body: Hi [@o_kyrdan](/t5/user/viewprofilepage/user-id/2862136) Still it's the same ? Can you please come for screen share to troubleshoot it ?


Tags: bitbucket-pipelines

bitbucket-cloud

cloud

trigger
Download Link Returns Access Denied
Asked by Moshe A:

New version of BitBucket 7.21.1 was released on May 5th. I tried downloading the windows EXE - it takes me to this URL and shows an access denied. [403 Forbidden (atlassian.com)](https://product-downloads.atlassian.com/software/stash/downloads/atlassian-bitbucket-7.21.1-x64.exe)

I am able to download 7.21.0 windows or 7.21.1 zip but not this one.


Answers:
author: Moshe A
body: FYI - this started working again late last night and I've gotten it download.


Tags: bitbucket-server

server
Can I login to the bitbucket API with an atlassian account api token?
Asked by Mike Kauspedas:

I created an atlassian account API token but get *Access token expired* when trying to access the bitbucket api (for bitbucket cloud). Using the auth header below.

Authorization: Bearer \<access_token\>


Answers:
author: Mark C
body: Hi [@Mike Kauspedas](/t5/user/viewprofilepage/user-id/325735),

Thank you for reaching out to the community.

When you generated an OAuth access token, would it be possible for you to confirm if you've generated it using one of the grant types mentioned in this documentation? - [Use OAuth on Bitbucket Cloud](https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/)

Also, if you'd like to generate an OAuth access token programmatically, you can use the CURL command below using [Client Credentials Grant (4.4)](https://developer.atlassian.com/cloud/bitbucket/rest/intro/#authentication).

```
$ curl -X POST -u "client_id:secret" \  https://bitbucket.org/site/oauth2/access_token \  -d grant_type=client_credentials
```

Hope it helps and let me know how it goes.

Regards,  
Mark C

comments: author: Mike Kauspedas
body: Thanks for replying. I can generate the tokens but I want to know if I can use an atlassian account token. <https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/>


author: Mark C
body: Hi [@Mike Kauspedas](/t5/user/viewprofilepage/user-id/325735)  

Thanks for the confirmation.  

Unfortunately, it is not possible to use an Atlassian account API token as access token to authenticate with Bitbucket Cloud API endpoints.  

You will need to use OAuth 2.0 access token in this case.  

Regards,  
Mark C


Tags: bitbucket-cloud

cloud
How to securely access bitbucket from corporate firewall? Please help in a detailed SOP.
Asked by TRIVEDI ABHISHEK:

We cannot clone from bitbucket to our system when it is connected to mahindra domain, So please help in a detailed answer which can justify the security concerns of our security team and provide a logical, secured and detailed answer.

The error is as follows:

ssh: Could not resolve hostname bitbucket.org: Temporary failure in name resolution  
fatal: Could not read from remote repository.

Please make sure you have the correct access rights  
and the repository exists.


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

Your network team needs to fix the DNS setup of your network.

The error

\> ssh: Could not resolve hostname bitbucket.org:

is telling us that your server simply can't find Bitbucket, and that's because your DNS is not working for that machine.

comments: author: TRIVEDI ABHISHEK
body: We are able to curl bitbucket.org when used proxy which is set by the organization. and we are also able to access portal from mahindra domain. We are only facing issue while using git clone. So, is it still the problem of dns only?

while I run https git clone, It shows following error. \[ fatal: unable to access 'bitbucket.org/\<account\>/\<repo\>' : could not resolve host: bitbucket.org\]


Tags: bitbucket-cloud

cloud
Need help in running git gc on my repo
Asked by auxa:

Hi, i need help in running the following on my repo on server:

[https://bitbucket.org/a\*\*-\*p-management/a\*\*-\*p/](https://bitbucket.org/a**-*p-management/a**-*p/)

The server repository size is over 3GB, but as a result of running BFG, the local repository size is currently 245MB. Thanks in advance.


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

I ran a git gc for your repository and its size has been reduced.

I also wanted to let you know that we have a feature request in our issue tracker to allow users to run a git gc for their remote repos that you can vote for and add yourself as a watcher if you'd like to get notified via email on updates:

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

Kind regards,  
Theodora


author: Mikael Sandberg
body: Hi [@auxa](/t5/user/viewprofilepage/user-id/4898270),

Welcome to Atlassian Community!

I have notified the Atlassian Support team on the Community and they should reach out to you soon.


Tags: atl-rvw

bitbucket-cloud

cloud
React build failed : "Item.node is not a function"
Asked by Baba Ali:

Hello! I am trying to deploy a react application to AWS using bitbucket pipelines. All my scripts works fine except the build script. It fails with this error "item.node is not a function" without even printing a stacktrace of where the error occurred. The build script however works completely fine locally. I don't know if anyone has encountered this before and could possibly offer my some hints? Thanks

node version: 14.17.0

npm version: 6.14.3


Answers:
author: Gonchik Tsymzhitov
body: Hi!

did you check version on the AWS ?

met the same on another setup


Tags: bitbucket-server

continuous-delivery

node

react.js

server
Why does hg.exe download so much data when SourceTree is running?
Asked by Mike G:

Last month my boss asked me to find out why we went over our monthly data cap for our network connection. I traced it back to SourceTree on my computer. When I leave it running (which used to be 24/7), hg.exe downloads over 300MB every hour.

I use the built in mercurial. I have 20 repositories connected (mostly Bitbucket).

Is this an expected behaviour? A bug? A configuration problem on my part?

Edit (sorry, for some reason the comment window won't open):

Automatic check is the default 10 minutes. The traffic graph seemed to show constant usage rather than spikes every 10 minutes though...

Is there a way to log the commands sent to hg.exe?

I've disabled the automatic check and it seems to have stopped the excessive usage. I still don't understand why it would download so much data just checking for repository changes (especially when my repositories almost never change).


Answers:
author: Seth
body: Do you have SourceTree configured to automatically check remotes for updates (runs a fetch)? It's on by default for every 5 or every 10 minutes. 300MB seems excessive, but that might be the trigger.

comments: author: Mike G
body: I've updated my question with a reply (the comment window wouldn't open for me a few minutes ago).


author: Seth
body: You can configure sourcetree to display the full output of commands that you request in a dialog, but I don't think the auto-fetch commands are included in that.
Email alerts when a file or folder changes in git?
Asked by Kyle Ford:

I would like to be able to configure email alerts when a file in git changes, or then contents of a folder in git changes. Is there a way to do this in Stash or SourceTree?


Answers:
author: thinsoldier
body: You can set up scripts that are executed whenever an actual commit is made. But is this something specific \& advanced in git itself, not sourcetree.
Force opening file with SourceTree TextEditor
Asked by fredvol P:

Hello, I have a internal software producing file with extension (\*.par) , but inside it is a XML file.

SourceTree do not shows me the difference between commit.

Can I force sourcetree to consider \*.par like \*.xml ? without changing the windows file extension association.

I still want the file .par to be open with my internal software when i double click on it.  
I managed to make a "custom action" to open it with Notepad++, but it does not shows ma the difference with the previous commit.

Thanks in advance.


Answers:
author: Seth
body: SourceTree does not decide whether to diff or not, it relies on Git to determine that. There are some solutions and specific causes for what you are seeing here: <http://stackoverflow.com/questions/6855712/why-does-git-treat-this-text-file-as-a-binary-file>


author: fredvol P
body: Thanks for the answer, it help me to look in the good direction to solve it .

cheers  
fred
Can I have one repository for several different local position
Asked by Antoine Britte:

Hello,

On Bitbucket I have multiple repositories, one of them is a general one (like a library)

I have multiple projects that are using this same repository. For the moment each project have different sourcetree repository linked to the same repository on Bitbucket and I would like to know if it's possible to make only one sourcetree repository for multiple different location on my computer

For example :

I have 3 projects call them A, B \& C  
On Bitbucket I have 5 repositories call them (AA, BB, CC, DD, General)

What I have is

Project A need AA, BB \& General  
Project B need CC \& General  
Project C need DD \& General

I would like to know if in sourcetree I can make only 1 repository that is linked to the 3 projects in 3 different places or if only can use one location and I have to make 3 sourcetree repositories for each projects

Thanks for your answers.


Answers:
author: thinsoldier
body: I prefer submodules since they behave a bit more like SVN externals. Managing them would not be unified/embedded with the history each of your individual project repositories.


author: Seth
body: I don't know much about it, but git subtrees may be what you're looking for.

<https://medium.com/@porteneuve/mastering-git-subtrees-943d29a798ec#.tnycb0h3o>

You would still have multiple copies of the General code on your machine, but managing them would be unified with whatever repository they are embedded in.

For a non-git, non-sourcetree answer, you can probably just use symbolic links:

<https://gigaom.com/2011/04/27/how-to-create-and-use-symlinks-on-a-mac/>

<http://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/>
Open a repository in SourceTree using the keyboard (on a Mac)
Asked by Samuel Brow:

(I'm on a mac)

In the SourceTree main (bookmarks) window, I can use the keyboard pretty effectively.

I can press Cmd+F to get into the search window, then type some "filter" text to reduce my long list down to the one repo I want. Then I can press Tab a couple times (and maybe a downarrow) to select the repo I want.

Now I want to open it (using the keyboard). I cannot find a way to do this.

Pressing Return thinks I want to rename it (which admittedly is a "mac" way of doing things).

If there isn't a way, please consider this a request to add a keystroke (Cmd+Return, Alt+Return, etc..) that allows me to open a selected repo using they keyboard.

Ideally, add a preference I can then change to allow a naked Return to open it.

Thanks

-Sam


Answers:
author: Samuel Brow
body: After some searching, I just learned that Shift+Cmd+O will open the currently-selected repository!


author: Seth
body: That sounds like a very common sense feature.

You should submit a feature request to jira.atlassian.com