youngmon/atlassian-qna huggingface dataset:
Pipeline with ssh submodule failing git@bitbucket.org: Permission denied (publickey)
Asked by Andy Tomlin:

I have a private repo which is including an open source repo as a submodule. (I am owner of both)

> The pipeline fails  
> + git submodule update --init --recursive  
> Submodule 'archdef' ([git@bitbucket.org](mailto:git@bitbucket.org):andytomlin/archdef.git) registered for path 'archdef'  
> Cloning into '/opt/atlassian/pipelines/agent/build/archdef'...  
> Warning: Permanently added the RSA host key for IP address '18.205.93.0' to the list of known hosts.  
> [git@bitbucket.org](mailto:git@bitbucket.org): Permission denied (publickey).  
> fatal: Could not read from remote repository.  
> Please make sure you have the correct access rights  
> and the repository exists.  
> fatal: clone of 'git@bitbucket.org:andytomlin/archdef.git' into submodule path '/opt/atlassian/pipelines/agent/build/archdef' failed  
> Failed to clone 'archdef'. Retry scheduled  
> Cloning into '/opt/atlassian/pipelines/agent/build/archdef'...  
> Warning: Permanently added the RSA host key for IP address '18.205.93.1' to the list of known hosts.  
> [git@bitbucket.org](mailto:git@bitbucket.org): Permission denied (publickey).  
> fatal: Could not read from remote repository.  
> Please make sure you have the correct access rights  
> and the repository exists.  
> fatal: clone of 'git@bitbucket.org:andytomlin/archdef.git' into submodule path '/opt/atlassian/pipelines/agent/build/archdef' failed  
> Failed to clone 'archdef' a second time, aborting
>
Suggestions?


Answers:
author: Andy Tomlin
body: Nevermind, figured out I needed to add an ssh key to the pipeline

comments: author: Krzysztof/Chris
body: Hi Andy. You added ssh public key of your open source repo and added it to Access keys in private one? I did it like that and still getting this error


author: Andy Tomlin
body: No, other way round. I added pipelines key to my open source repo. ie my pipeline now has a key recognized by the open source repo. I found this link useful <https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/>


Tags: bitbucket-cloud

cloud
unable to access clone repo : The requested URL returned error: 400
Asked by SushrutS:

using latest git version, still getting 400 while clone repo.

unable to access clone repo : The requested URL returned error: 400


Answers:
author: Pramodh M
body: Hi [@SushrutS](/t5/user/viewprofilepage/user-id/4868408)

Are you able to access the repo in Bitbucket UI

\[ If YES, Clone the repo with clone URL - Instructions given below \]

Create the access token and form the clone URL as

https://{token}@bitbucket.org/workspace/repo-name.git

Remove the flower brackets in URL

\[ If NO, ask your administrator to give access to the repo \]

let me know if this works

Thanks,

Pramodh


Tags: bitbucket-server

server
Unable to get the artifacts
Asked by SAGAR PAWADI:

Hi Team,  

##Here is my pipeline  
image: node:16.14.2-alpine  
pipelines:  
default:  
- step:  
name: Install NPM  
clone:  
enabled: false  
script:  
- node -v  
- npm install npm@latest -g  
- npm -v  
caches:  
- node  
- step:  
name: Linting to check code quality  
clone:  
enabled: false  
script:  
- echo "yet to add ng lint, Holding here as its opening up many bad code std errors"  
- step:  
name: Build and Install Satellite Modules  
script:  
- cd satellite/  
- mkdir projects/corelib/dist  
- echo "Install Angular CLI"  
- npm install @angular/cli@latest -g  
- ng --version  
- npm install --save-dev @angular/cli@latest --force  
- ng --version  
- echo "Building Corelib Module"  
# - ng build corelib  
- npm run build corelib  
- npm install corelib  
caches:  
- node  
artifacts:  
# - dist/\*\*  
- /opt/atlassian/pipelines/agent/build/satellite/library/corelib/\*  
My Pipeline job is successful but not able to see "Artifacts" in the Artifacts section - Pls help on this.  
![Artifact_Not_Found.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/192259i96692FE9EBBCA193/image-size/large?v=v2&px=999 "Artifact_Not_Found.PNG")  


Answers:
author: Syahrul
body: G'Day [@SAGAR PAWADI](/t5/user/viewprofilepage/user-id/4868345)

Could you share with me the build teardown output of your pipeline? I suspect that the artifacts did not get generated at all from the path given.

Can you change the artifact URL to the following instead as you don't have to use the full path of the clone dir :

```
artifacts:- satellite/library/corelib/**
```

Let me know how it goes.

Cheers,  
Syahrul


Tags: bitbucket-pipelines
Help with pipeline cache clearing
Asked by helberlucio:

Hi,

Even creating a new user and having all the permissions and writing is giving an authentication error when I run the pipeline in the cash cleaning part;


Answers:
author: o_kyrdan
body: Hi [@helberlucio](/t5/user/viewprofilepage/user-id/3519427)

Have you tried to use [bitbucket-clear-cache](https://bitbucket.org/atlassian/bitbucket-clear-cache/src/master/) pipe ?

Note! According to the [Readme](https://bitbucket.org/atlassian/bitbucket-clear-cache/src/master/README.md) documentation:

This pipe requires Bitbucket credentials (username and [app password](https://confluence.atlassian.com/bitbucket/app-passwords-828781300.html)) so that the pipe can communicate with Bitbucket APIs to retrieve and clear dependency caches. When generating the app password, remember to check the `Pipelines Write` and `Repositories Read` permissions.

Hope, this could solve your problem.  

Best regards,  
Oleksandr Kyrdan


Tags: bitbucket-cloud

bitbucket-pipelines

cache
Not able to clone or check in the project.
Asked by Sibsankar:

I have faced issues with permissions on BitBucket Server and using them from Visual Studio. We are able to login to the BitBucket but in Visual Studio and we are not able to get to and clone public repositories. Git failed with a fatal error. Authentication failed for (path to repository).

Please look into this on top priority.


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

I would like to ask a few questions so we can better help you:

**1.** You mention "BitBucket Server", but your post has the tag 'bitbucket-cloud'.

Can you please confirm whether these repos are hosted in Bitbucket Cloud (<https://bitbucket.org/>) or Bitbucket Server (self-hosted instance)?

**2.** Are you using HTTPS or SSH to clone these repos?

**3.** Are you able to clone these repos from a command-line application?

Kind regards,  
Theodora

comments: author: Sibsankar
body: Hi Theodora,  
Please find the below answer:  
**1.** You mention "BitBucket Server", but your post has the tag 'bitbucket-cloud'.  
Can you please confirm whether these repos are hosted in Bitbucket Cloud (<https://bitbucket.org/>) or Bitbucket Server (self-hosted instance)?  
--Repos are hosted in Bitbucket Cloud.  
**2.** Are you using HTTPS or SSH to clone these repos?  
--HTTPS  
**3.** Are you able to clone these repos from a command-line application?  
--No.Using Visual Studio


author: Theodora Boudale
body: Hi Sibsankar,

Thank you for the info.

When you enter the HTTPS URL of the repo in Visual Studio, does it include your Bitbucket username, e.g. like this:

```
https://Bitbucket-Username@bitbucket.org/Workspace/Repo.git
```

or does it **not** include the username, e.g. like this:

```
https://bitbucket.org/Workspace/Repo.git
```

Git usually attempts to clone without authentication first, which should succeed if the repo is public, but I'm not sure if Visual Studio behaves in a different way. Are you using the Git plugin in Visual Studio or a different plugin?

<br />

Another thing: we deprecated account passwords for Git over HTTPS. It's possible that Visual Studio or your credential manager has the account's password stored and is trying to use that.

I would suggest clearing all saved credentials and generating an app password (which should be used instead of a password when cloning/pulling/pushing via HTTPS), see here for more info:

* <https://community.atlassian.com/t5/Bitbucket-articles/Announcement-Bitbucket-Cloud-account-password-usage-for-Git-over/ba-p/1948231>

> <br />
>
> Are you able to clone these repos from a command-line application?  
> --No.Using Visual Studio

Finally, I would suggest trying to clone using the same HTTPS URL from a command-line application and let me know what the output is.  
This is to narrow down whether the issue is specific to Visual Studio or not.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Bitbucket Pipeline Unexpectedly Errors
Asked by Gabriel:

I got a net solution that I can run/build/test locally.  

I can also run/build/test inside a docker container no problem.  

In my setup I have the following folder Structure  

<br />

```
/root

? ?/Backend

? ? ? ? /Backend

? ? ? ? ? ? ?Backend.csproj

? ? ? ? /Tests

? ? ? ? ? ? ?Tests.csproj
        /Lib

```

```

 <Reference Include="DataExtensions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\Lib\DataExtensions.dll</HintPath>
</Reference>
```

Locally it all works. It also works in other Pipelines, but in Bitbucket pipeline, for some reason, it fails to find the required dependency. I validated its there in the repo.  

Here's the full test log:  

Build setup23s  
REPORTS_PATH=./test-reports/build_${BITBUCKET_BUILD_NUMBER}

<br />

<br />

cd Backend \<1s

<br />

<br />

cd Lib \<1s

<br />

<br />

ls \<1s

<br />

<br />

+ ls  
DataExtensions.dll

<br />

<br />

cd .. \<1s

<br />

<br />

cd Tests \<1s

<br />

<br />

+ cd Tests

<br />

<br />

cat Tests.csproj\<1s

<br />

<br />

+ cat Tests.csproj  
<Project Sdk="Microsoft.NET.Sdk">  
<PropertyGroup>  
<TargetFramework>net6.0</TargetFramework>  
<Nullable>enable</Nullable>  
<IsPackable>false</IsPackable>  
<LangVersion>latest</LangVersion>  
</PropertyGroup>  
<ItemGroup>  
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />  
<PackageReference Include="NUnit" Version="3.13.2" />  
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />  
<PackageReference Include="coverlet.collector" Version="3.1.0" />  
</ItemGroup>  
<ItemGroup>  
<Reference Include="DataExtensions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">  
<HintPath>..\Lib\DataExtensions.dll</HintPath>  
</Reference>  
</ItemGroup>  
</Project>

<br />

<br />

dotnet test4s  
+ dotnet test  

Determining projects to restore...  

Restored /opt/atlassian/pipelines/agent/build/Backend/Tests/Tests.csproj (in 1.52 sec).  

/usr/share/dotnet/sdk/6.0.201/Microsoft.Common.CurrentVersion.targets(2301,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DataExtensions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/opt/atlassian/pipelines/agent/build/Backend/Tests/Tests.csproj]


Answers:
author: Gabriel
body: Problem was that in Bitbucket LFS is off by default.  

Turning it back on solved the issue.


Tags: bitbucket-cloud

cloud
Accessing a bit bucket repo form java sdk
Asked by sangameshwar.puramwar:

Hi Team,

I am trying clone a git repo from out side using [https://client_id:secret@bitrepourl.git:develop](http://client_id:secret@bitrepourl.git:develop), though i have oauthcosumer i am getting invalid authentication error

Am I referring it wrongly

Regards,

Sangameshwar


Answers:
author: Theodora Boudale
body: Hi Sangameshwar,

Could you please confirm if this is a Bitbucket Cloud repo (<https://bitbucket.org/>)?

If so, the client and secret of the OAuth consumer cannot be used for cloning.  
You will need to generate an access token using the key and secret, and then use this access token to clone as follows:

```
git clone https://x-token-auth:{access_token}@bitbucket.org/<workspace-id>/<repo-slug>.git
```

I am listing below the step to generate an access token for an OAuth consumer:

**1.** First, create an OAuth consumer (I assume you have already done this, so you can skip that step).  
Make sure that the consumer has a **Callback URL** , you can use <http://localhost>

**2.** Then in your browser address bar enter the following URL  
(replace {consumer_key} with the key of your consumer, no brackets in the URL):

```
https://bitbucket.org/site/oauth2/authorize?client_id={consumer_key}&response_type=code
```

When you hit Enter, the URL will be like the following:

```
http://localhost/?code=fpYPDYsryEpsRawrj4
```

Copy the code in the response, in this example it is fpYPDYsryEpsRawrj4

**3.** You can then obtain an access token by executing the following command in terminal

```
curl -X POST -u "key:secret" https://bitbucket.org/site/oauth2/access_token -d grant_type=authorization_code -d code=fpYPDYsryEpsRawrj4
```

Replace **key** with your consumer's key  
Replace **secret** with your consumer's secret  
Replace the code value in there (fpYPDYsryEpsRawrj4) with your code from the previous step

<br />

**4.** You can use the access token that you obtained from the previous step, to clone a repo, as follows:

```
git clone https://x-token-auth:{access_token}@bitbucket.org/<workspace-id>/<repo-slug>.git
```

Replace **access_token** with your access_token from the previous step, but leave the brackets in the URL.  
The literal string **x-token-auth** as a substitute for username is required.

<br />

**5.** Our access tokens expire in two hours. When this happens you'll get 401 responses.

You will have to use the refresh token from the output in step 3 to get a new access token.

```
curl -X POST -u "key:secret" https://bitbucket.org/site/oauth2/access_token -d grant_type=refresh_token -d refresh_token={2Eoiw6UJ707AD9aIyUR}
```

Replace **key** with the consumer's key  
Replace **secret** with the consumer's secret  
Replace the value of the **refresh_token** in the example I gave (2Eoiw6UJ707AD9aIyUR) with the one from the output of step 3

The output of the above command will give you a new access token (with the same 2 hour expiry) and also a refresh token.

<br />

Please feel free to let me know how it goes and if you have any questions.

Kind regards,  
Theodora
ssh reset by peer when fetching from several repos
Asked by Ofek Ishay:

Hey,  
I have several git repos in one pycharm project,  
I also have a pycharm plugin that auto fetch my repos every hour or so.  
ever since I changed my connection to ssh I get the following notifications  
ssh_exchange_identification: read: Connection reset by peer

If I fetch one by one I can but it's a hassle, so is there any reason for that?

seems like bitbucket is limiting the connections


Answers:
author: Theodora Boudale
body: Hi Ofek,

There are many possible causes for the error you are seeing:

* The most common one is misconfigured Access Control Lists and Firewalls that may be rejecting traffic to Bitbucket's IP addresses. I suggest checking that the IPs listed in the following link are whitelisted
  * <https://support.atlassian.com/bitbucket-cloud/docs/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall/>
* The second most common cause is higher MTU/MSS values in the packets we receive, you can check the following article for troubleshooting:
  * <https://confluence.atlassian.com/bbkb/troubleshooting-bitbucket-cloud-mtu-mss-issues-858778091.html>
* Another less common cause for TCP resets may be due to Anycast Shift:
  * <https://community.atlassian.com/t5/Bitbucket-articles/Diagnosing-and-Troubleshooting-TCP-Resets-from-Bitbucket-Cloud/ba-p/1562132>  

    You can try modifying the hosts file of the operating system to direct traffic to one of Bitbucket's legacy IP addresses  

    ```
    18.205.93.2
    18.205.93.0
    18.205.93.1
    ```

    <br />

    and check if the issue is resolved afterwards.

Kind regards,  
Theodora

comments: author: Ofek Ishay
body: Hi Theodora,  
Thank you for your answer,  
I've tried all tested all issues, seems like I still cannot fetch or pull my several repos.  


author: Theodora Boudale
body: Hi Ofek,

I see that the repos you have access to belong to workspaces on a paid billing plan, so I would suggest creating a ticket with Bitbucket Cloud support team for further investigation.

You can create a ticket via <https://support.atlassian.com/contact/>, in "What can we help you with" select "Technical issues and bugs" and then Bitbucket Cloud as product.

Please make sure to mention in the ticket what you have tried/tested from my suggestions above. You may also be asked for additional info from the engineer that will work on your ticket, in order to troubleshoot this.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
bitbucket + TortoiseGIT => Connection faild
Asked by Franti?ek Dolej??:

Hello,

I'm trying to upload data using TortoiseGit to the BitBucket Repository, but it's giving me an authentication error.

* I generated a PuttyKey
* I created an App Password
* I set up Wincred

Unfortunately, nothing works. Please advise. Thank you

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/191960i38CF02ED02D10D01/image-size/large?v=v2&px=999 "image.png")

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/191962iC15846619B670CC0/image-size/large?v=v2&px=999 "image.png")


Answers:
author: Syahrul
body: G'Day [@Franti?ek Dolej??](/t5/user/viewprofilepage/user-id/4864657)

Welcome to the community!

While I am not an expert on TortoiseGIT but I believe the URL you use is invalid since you are using HTTPS the URL should be in the following format:

```
https://<username>@bitbucket.org/<WorkspaceName>/<RepositoriesName>.git
```

I hope this helps and if you are present with an Atlassian login, please ensure to input your username and App Password.

Cheers,  
Syahrul
I can't login to bitbucket
Asked by Eden:

bitbucket we couldn't log you in 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.

![bitbucket login issue 2.png](https://community.atlassian.com/t5/image/serverpage/image-id/175349i36A11693548D3D91/image-dimensions/2000?v=v2&px=-1 "bitbucket login issue 2.png")


Answers:
author: Caroline R
body: Hi, Eden! Welcome to the community!

I confirmed that your Bitbucket account was set as inactive, so I reactivated it. Could you please try to access it now and let me know how it goes?

Looking forward to hearing from you.

Kind regards,  
Caroline


Tags: atl-rvw

bitbucket-cloud
Bitbucket Cloud SSH keys rejected after 24 hours
Asked by echoblue_marcus:

SSH keys generated for a specific user in my workspace only work for about 24 hours. I've tried creating the SSH keys in the workspace as well as within the personal settings for that user's Bitbucket account.

The SSH keys loaded onto my personal account are working perfectly and have done so for months.

Once created they work for about 24 hours and thereafter she gets the "permission denied (public key)" error when attempting to perform any sort of operation (push, pull, fetch...)


Answers:
author: Caroline R
body: Hi, [@echoblue_marcus](/t5/user/viewprofilepage/user-id/3949127), thank you for reaching out to Atlassian Community.

This seems to be related to the key that is added to the ssh-agent. Either the agent is losing the key after 24h, or a different SSH key is being offered (if you have multiple keys in the .ssh directory).

The first thing I would suggest when you face this issue is to try to add this key to your agent again. You can run the following command to achieve this:

```
ssh-add ~/.ssh/<private_key_file>
```

You can run the following command to confirm which key is being offered when interacting with your repo, to confirm if it's the correct one or not:

```
GIT_SSH_COMMAND="ssh -vvv" <git command>?
```

And you can also try specifying the private SSH key in the config file. You can add the following to the file named **config** in your **\~/.ssh** directory (if the file named **config** doesn't exist, you can create it):

    Host bitbucket.org    HostName bitbucket.org    User <YourBitbucketUsername>    PreferredAuthentications publickey    IdentityFile </Users/YourUser/.ssh/my_ssh_key>

Replace **YourBitbucketUsername** with your Bitbucket username and **/Users/YourUser/.ssh/my_ssh_key** with the path to the private key that is added to your Bitbucket user.

Please let me know how it goes and feel free to share any additional information regarding this case.

Kind regards,   
Caroline


Tags: bitbucket-cloud

cloud

ssh

ssh-key
Elasticsearch not starting automatically after update of Bitbucket to 7.6.14
Asked by Stephan Krull:

I updated a Bitbucket instance from 7.6.2 to 7.6.14 yesterday. Recognized later that the bundled Elasticsearch sub process has not been started by the start up scripts. That was the case until the upgrade, so elasticsearch has always been started by the parental Bitbucket process before.

I think I found the root cause:

- the installer file for the Bitbucket upgrade on Linux changed the /etc/rc.d/init.d/atlbitbucket file and calls "/opt/atlassian/bitbucket/7.6.14/bin/start-bitbucket.sh --no-search", which, of course, prevents the elasticsearch process from starting

Any idea why this has been introduced? I did not find anything in the release notes: <https://confluence.atlassian.com/bitbucketserver/bitbucket-server-7-6-release-notes-1018780800.html>


Answers:
author: Christian Glockner
body: Hi Stephan,

Did you use the installer to install 7.6.14 or did you use the zip or tar file?

Cheers,

Christian

Premier Support Engineer

Atlassian

comments: author: Stephan Krull
body: Hello!

I used the installer.

BR

Stephan


author: Christian Glockner
body: Is there any chance you selected to install Data Center when running the installer? In that situation it would expected that ES is not started together with Bitbucket.

Cheers,

Christian

Premier Support Engineer

Atlassian


author: Stephan Krull
body: True, I chose Data Center because that is the license that we run. And we run the package in standalone mode. So it is a feature, not a bug?


author: Christian Glockner
body: Yep, that's expected because with a multi-node DC deployment you'll need to have your own installation of Elasticsearch on a separate machine.

Cheers,

Christian

Premier Support Engineer

Atlassian


author: Stephan Krull
body: I additionally asked via support request and got this documentation link about the issue, just for completeness: <https://community.atlassian.com/t5/Bitbucket-questions/Elasticsearch-not-starting-automatically-after-update-of/qaq-p/1995708#M80531>


Tags: bitbucket-server

server
FEEDBACK: New color scheme is hard on the eyes.
Asked by rebelcoder:

The new color scheme in source tree makes it hard to pick out individual elements in the UI. Everything looks washed out.


Answers:
author: Seth
body: Vote up issues that you think should receive attention:

<https://jira.atlassian.com/browse/SRCTREEWIN-4306>

<https://jira.atlassian.com/browse/SRCTREEWIN-4766>

<https://jira.atlassian.com/browse/SRCTREEWIN-4196>


author: Larry Eisenstein
body: I agree. Icons are smaller and harder to distinguish. Also, there needs to be a few more colors to make things easier to pick out.