youngmon/atlassian-qna huggingface dataset:
Unable to SSH into my EC2 instance via Pipeline
Asked by Kunal Dubey:

So, I have been struggling with this issue over the weekend and have tried everything that was available on the internet.   

The Issue: I need to SSH into my EC2 instance but I'm unable to.  
Error: Permission Denied Permission denied (publickey).   

Things I've Done:   
1. Tried pasting the private public key pair that I have generated from the AWS console (.pem )  
2. When the above way didn't work I tried generating the key pairs from the bitbucket pipeline console and pasted the public key in the .ssh/authorized_keys   
3. Fetched hosts and added them in my pipeline configuration   
4. tried ssh -t ( didn't work ) \|  
5. tried ssh - i \~./ssh/config root@ip ( didn't work )   

pipelines:  
default:  
- step:  
name: Deploy to AWS EC2  
deployment: development  
caches:  
- node  
script:  
- sudo apt install ssh-askpass  
- ssh-keyscan -t rsa bitbucket.org \>\> \~/.ssh/known_hosts  
- ssh $root@$ip 'sudo su \&\& cd /home/ubuntu/scripts \&\& sh deployment.sh'  

Can someone please help me out here?


Answers:
author: Igor Stoyanov
body: [@Kunal Dubey](/t5/user/viewprofilepage/user-id/5335625) hi. In additional to [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) response you could also try to [follow this medium guide,](https://amity786.medium.com/ci-cd-pipeline-integration-atlassian-bitbucket-to-aws-ec2-for-php-application-955abe0b8dd0) where you could use one of the ssh type pipes: [rsync-deploy](https://bitbucket.org/atlassian/rsync-deploy/src/master/).

To discover more ssh type pipes check the [Marketplace](https://bitbucket.org/product/features/pipelines/integrations?&search=ssh).

Regards, Igor


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

The 'Permission denied' error indicates an issue with SSH authentication. Can you please follow these steps:

**1.** Open the repo on Bitbucket Cloud website, go to **Repository settings** \> section **PIPELINES,** and select **SSH keys**

**2.** Fetch the fingerprint of the EC2 instance on that page, in the section **Known hosts**

If there are any errors, please let us know what error you see.

**3.** Generate an SSH key pair on that page by selecting the option **Generate keys**

**4.** Copy the public key to **\~/.ssh/authorized_keys** on the EC2 instance, for the user $root you are connecting with

**5.** Add the option **-vvv** in the ssh command in your yml as follows:

```
- ssh -vvv $root@$ip 'sudo su && cd /home/ubuntu/scripts && sh deployment.sh'
```

The -vvv argument will print verbose output that may give an indication of the cause of this error. Afterwards, when you run a build, please post the full output of the ssh command here (after sanitizing any private/sensitive data) so we can check any errors that may be reported.

You can also remove the ssh-keyscan command from your yml file. You are not trying to connect to Bitbucket Cloud, but even if you were, Bitbucket Cloud's host key is automatically added to known_hosts so this command is not needed.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Does anyone knows atlassian is supporting GraphQL specifically for Bitbucker Server
Asked by Dhruv Suthar:

i want to access my**bitbucket server** workspace data like repo, branch and its files but by **GraphQL api** so can you answer Does the Atlassian platform **GraphQL** **API** support Bitbucket Server? and if yes how to access bitbucket server workspace data like repo, branch and its files by **GraphQL** api.


Answers:
author: Ulrich Kuhnhardt _IzymesCo_
body: No - Atlassian Bitbucket server doesn't offer a GraphQL API.


Tags: atlassian-guard

atlassian-support

bitbucket-server

server
Required Email address during Bitbucket Rest 1.0 PUT operation for updating a file
Asked by Garudaprasad K:

Hi I'm using bitbucket 1.0 API in my daily activities, and we are trying to build a feature which can update a file from our app, and which uses repository HTTP Tokens,

It works absolutely file when I use the tokens for read operations but when I apply the same in Write operations I get the below error:

"{"errors":\[{"context":null,"message":"When performing an edit, the author must have an e-mail address.","exceptionName":"com.atl",  
"assian.bitbucket.validation.ArgumentValidationException"}\]}"

I checked most of the community answers but no where this problem or Solutions were given.  

Please send me out an answer if there is any solution.  

Right now my coding language is python and I'm using the http tokens as below:

headers = {  
'Authorization': f"Bearer {token}",  
}  
NOTE: the token which I generated is a verified EDIT permission one.


Answers:
author: Christian Glockner
body: Hi,

Does the user who this token is associated with have an e-mail address?

Cheers,  
Christian  

Premier Support Engineer  
Atlassian

comments: author: Garudaprasad K
body: Hi [@Christian Glockner](/t5/user/viewprofilepage/user-id/527595) ,

Yes I'm the user and I created this in the repository, and I do have an email address.

it works fine when I use the format

Basic username:password,

But not with the Bearer token.


author: ljubomirsinadinovski
body: Did u manage to resolve this, i stumbled on the same problem, I am trying using Bearer token as well? [@Garudaprasad K](/t5/user/viewprofilepage/user-id/5335352) [@Christian Glockner](/t5/user/viewprofilepage/user-id/527595)


Tags: bitbucket-server

server
Cannot access to user profiles
Asked by Yunliang Jiang:

I am admin of my team and neither me nor my teammates cannot click the user to get access to user profile and see the statistics and progress, just like github (even JIRA supports this).

Spent a lot of time by checking the permission/settings... didn't have a clue why we cannot do this ...


Answers:
author: Ash Yadav
body: Hi [@Yunliang Jiang](/t5/user/viewprofilepage/user-id/5335019) welcome to the Atlassian Community!

I don't believe this is currently supported in Cloud, but it is being reviewed.

See below:

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

Hope this helps,

Ash

comments: author: Yunliang Jiang
body: Thanks Ash, any bitbucket product supports this? and what upgrade do we need if so?


author: Ash Yadav
body: No problem,

I don't believe there is anything out of the box to enable this, possibly a 3rd party add-on on the Atlassian Marketplace but I wouldn't be able to recommend any from the top of my head.

KR,

Ash


Tags: bitbucket-cloud

cloud
Slack Settings screen not loaded
Asked by ted bilisim:

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

I encountered such a result when I wanted to integrate Slack. When I click on the page I don't see anything. I tried from different accounts and browsers but the result is the same. How can I solve the problem?


Answers:
author: Ben
body: Hi Ted,

I have attempted to reproduce this issue but was unable to on my own repository. Are you accessing this from Repository Settings \> Slack: Settings?

I would suggest disabling all add-ons in any browser you may have been using (or Incognito mode if using Chrome) while also performing a hard browser refresh/clearing all cache and cookies before attempting to load the page again.

If this still does not load, please let me know and I will raise a support ticket as we would need further information that would not be appropriate to share on a public forum such as this.

Cheers!

- Ben (Bitbucket Cloud Support)

comments: author: ted bilisim
body: Hi Ben,

Yes, I tried from Repository Settings \> Slack: Settings. Also, I made your all suggestions including incognito but there is no effect.  

Respectfully,


author: Ben
body: Hey Ted,

I've raised a ticket and my colleague has responded on it - please check your email and continue correspondence on that ticket.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Is there a secure ssh step for bitbucket pipelines
Asked by Stephan Eicher:

I saw that the \`ssh-run\` bitbucket pipeline still relies on \`alpine:3.9\` container image.

<https://bitbucket.org/atlassian/ssh-run/src/798568418ced843e20e6465092a74b1a04a8dd66/Dockerfile#lines-1>

As far as i could find the security updates for that release were stopped on 01 Jan 2021

I suspect that this old release includes many security issues which were fixed in newer versions of alpine linux.

This should definitely be fixed as this container has access to private keys used to deploy software to production systems.


Answers:
author: Igor Stoyanov
body: [@Stephan Eicher](/t5/user/viewprofilepage/user-id/1259191) hi. The alpine image updated in following pipes:

* [rsync-deploy](https://bitbucket.org/atlassian/rsync-deploy/src/0.11.0/)
* [sftp-deploy](https://bitbucket.org/atlassian/sftp-deploy/src/0.8.0/)
* [ssh-run](https://bitbucket.org/atlassian/ssh-run/src/0.7.0/)

Regards, Igor


author: Igor Stoyanov
body: [@Stephan Eicher](/t5/user/viewprofilepage/user-id/1259191) hi. Thanks for your investigation.  
We will update the ssh-run pipe docker image and notify you.

Regards, Igor

comments: author: Stephan Eicher
body: The following pipelines are also affected:

* <https://bitbucket.org/atlassian/rsync-deploy/src/f8dd0734642683d2e9a1b2d616ccd94fb227be2b/Dockerfile#lines-1>
* <https://bitbucket.org/atlassian/sftp-deploy/src/5564629cc640da1b026c79318a5472f8a6442661/Dockerfile#lines-1>
* <https://bitbucket.org/atlassian/scp-deploy/src/940c6675ccb117a211f87003bba7275b9db3ec92/Dockerfile#lines-1> (python 3.10 EOL)
* <https://bitbucket.org/atlassian/vault-secrets/src/0363522414531c0fac9d762ba7976e23cc5c4394/Dockerfile#lines-1> (python 3.10 EOL)  

  It looks like a general issue some pipelines are not really maintained.


author: Igor Stoyanov
body: [@Stephan Eicher](/t5/user/viewprofilepage/user-id/1259191) hi. According to [this page](https://devguide.python.org/versions/):

*python 3.10 EOL will be 2026-10,*so no changes needed.

But we will update **alpine** image in your listed in the comments pipes.

We have more than 50 pipes to maintain, so, unfortunately, our strategy usually when no new features to be implemented is to wait for users feature request.  
You could always ask us in the community to bump a pipe version or even [create a pull-request](https://bitbucket.org/atlassian/rsync-deploy/src/master/CONTRIBUTING.md) by yourself since it is open-sourced.

Also keep in mind that pipes are not the same as pipelines.

Pipes provide a simple way to configure a pipeline. They are especially powerful when you want to work with third-party tools. [More details here](https://support.atlassian.com/bitbucket-cloud/docs/what-are-pipes/).

Regards, Igor


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

ssh
How to access parent docker from inside a pipe?
Asked by Tomer Horowitz:

I have the following step in my pipeline:

> - step:  
> deployment: Client  
> script:  
> - apt-get stuff  
> - ssh -N -L 4430:some_ip:4430 some_host \&  
> - sleep 10 # Give SSH tunnel some time to establish  
> - curl -k <https://localhost:4430> # Works  
> - pipe: docker://tomerh2001/gitlab-merge-request-pipe:latest  
> variables:  
> GITLAB_TOKEN: $GITLAB_TOKEN  
> GITLAB_URL: **<https://host.docker.internal:4430>**

I am trying to understand which IP/Host I need to specify for the pipe to access the tunnel from the main flow. I tried \`host.docker.internal\` but that doesn't work.

For context, I have locally replicated the docker run command that bitbucket creates to run the pipe, and it works locally with host.docker.internal when I run the docker image of the custom pipe

I guess that in the pipeline context, the host.docker.internal resolves the host of the docker service itself? And since the SSH tunnel was created inside the pipeline (I.e. a docker container), would I need to somehow find the IP of that container in order to access the tunnel?

My goal is to access the tunnel from within the pipe. Any help will be greatly appreciated!


Answers:
author: Theodora Boudale
body: Hi Tomer,

What error do you get when you run the pipe?

Have you tried using **<http://host.docker.internal:4430>** (instead of https)?

I'm not sure about the tunneling, but if I start an HTTP server on the build container on port 8000, the curl command works from within the pipe container if I use **curl <http://host.docker.internal:8000>**

I was also curious, why are you using an SSH tunnel instead of the GitLab URL in the GITLAB_URL variable?

Kind regards,  
Theodora


Tags: bitbucket-cloud

bitbucket-pipelines

docker

ssh
Is it possible to share variables between two different pipelines?
Asked by Val?ria Bezerra dos Santos:

I have a development pipeline that triggers a QA pipeline. In this development pipeline, it is possible to deploy in 3 different environments.

And after each deployment, the testing pipeline is triggered. But just as deployment occurs automatically in each branch, I wanted the test pipeline to know in which environment it should run automatically. So I thought, is it possible to share values between two different pipelines, so that, for example, if I run the deployment in the DEV environment when triggering the test pipeline, it sets the value 1 in the environment without needing me to intervene manually?


Answers:
author: Mark C
body: Hi [@Val?ria Bezerra dos Santos](/t5/user/viewprofilepage/user-id/5333989),

Welcome to the community.

It is not possible to directly share variables from one Pipelines build to another.  
However, you can try to leverage this existing Pipes script called [atlassian/trigger-pipeline](https://bitbucket.org/atlassian/trigger-pipeline/src/master/) which will allow you to trigger a custom Pipelines build and pass variables.  

Here's an example:

```
script:  - pipe: atlassian/trigger-pipeline:5.3.0    variables:      BITBUCKET_USERNAME: $BITBUCKET_USERNAME      BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD      REPOSITORY: 'your-awesome-repo'      REF_TYPE: 'branch'      REF_NAME: 'master'      CUSTOM_PIPELINE_NAME: 'deployment-pipeline'      PIPELINE_VARIABLES: >          [{            "key": "AWS_DEFAULT_REGION",            "value": "us-west-1"          },          {            "key": "AWS_ACCESS_KEY_ID",            "value": "$AWS_ACCESS_KEY_ID",            "secured": true          },          {            "key": "AWS_SECRET_ACCESS_KEY",            "value": "$AWS_SECRET_ACCESS_KEY",            "secured": true          }]      WAIT: 'true'
```

Regards,  
Mark C

comments: author: Val?ria Bezerra dos Santos
body: Hello,@Mark C

Thank you very much for getting back to me.

I managed to solve it yesterday and precisely with a similar code that I found in this article:

[CI/CD: An introduction using Bitbucket pipelines](https://itnext.io/ci-cd-an-introduction-using-bitbucket-pipelines-8701a400b97d)

I did it like this:

**Dev pipeline "sending":**

```
PIPELINE_VARIABLES: >

[ {

"key": "TEST_VARIAVEL",

"value": "1"

}]

- echo $TEST_VARIAVEL
```

<br />

<br />

**QA Pipeline "Getting the value of the variable":**

<br />

```
- cucumber -t @requests $FEATURE TEST_ENV=$TEST_VARIAVEL
```

<br />

It worked, the QA pipeline was able to point out that the environment value was = 1, and the test ran without needing me to interfere with the flow.  
![03.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/285511iF4B2038BC0B68A9F/image-size/large?v=v2&px=999 "03.PNG")  

Thank you very much, again.


author: Mark C
body: Great, glad to know it worked for you.  

Regards,  
Mark C


Tags: bitbucket-pipelines

cloud
How to add env variables to lambda function via pipe: atlassian/aws-lambda-deploy:1.10.0 in pipeline
Asked by Tarun Kamra:

I am using the pipe (  
atlassian/aws-lambda-deploy:1.10.0

)  
in my bitbucket pipeline for deploying to lambda.   
Now i need to add a few environment variables to my function .e.g. pixelUrl and other custom env var to be used inside lambda.  

How can i add?  

<br />

script:  
- pipe: atlassian/aws-lambda-deploy:1.10.0  
variables:  
AWS_DEFAULT_REGION: ...  
AWS_OIDC_ROLE_ARN: ''  
FUNCTION_NAME: 'source-vast'  
COMMAND: 'update'  
ZIP_FILE: 'values.zip'  

can i add env variables below in variables?


Answers:
author: Igor Stoyanov
body: [@Tarun Kamra](/t5/user/viewprofilepage/user-id/5333837) hi. This pipe does not support adding environment variables.

Regards, Igor


Tags: bitbucket-cloud

cloud
bashrc is not taking effect in the remote server using ssh
Asked by Bhushan Patil:

Hello,

I have a pipeline which contains a "atlassian/ssh-run:0.6.1" pipe added. I am executing some custom command which has been added in the bashrc. Those commands are not working for example. I have added "alias cecho='echo -e'" in bashrc, when I run this command through pipeline's pipe command section. I also tried alias "alias cecho='echo -e'" directly in the command key, but I still get command not found. I get command not found. Although I am able to run it on the server directly when I try to access the remove server from my local. I have checked my connection to the remote server is established, and other basic commands like ls and cd works and I am in correct directories and also I am able to navigate. But bashrc is not executing when the remote server connection is established.

Is there anything wrong I am doing?

this is the small piece of block in the pipeline

```
- stage:
    name: Build and Deploy
    steps:
      - step:
          name: Build the Application
          deployment: development staging
          script:
            - echo "This is building phase"
            - pipe: atlassian/ssh-run:0.6.1
              variables:
                SSH_USER: $BUILD_USER
                SERVER: $BUILD_SERVER
                COMMAND: 'alias cecho="echo -e" && cecho "=====This should work"'
```


Answers:
author: Igor Stoyanov
body: [@Bhushan Patil](/t5/user/viewprofilepage/user-id/5333832) hi. Try this example (move your complex command into myscript.sh):  

```
script:  - pipe: atlassian/ssh-run:0.6.1    variables:      SSH_USER: 'ec2-user'      SERVER: '127.0.0.1'      SSH_KEY: $MY_SSH_KEY      MODE: 'script'      COMMAND: 'myscript.sh' # path to a script in your repository
```

Regards, Igor


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
Search showing results from old commits
Asked by Alec Yevilov:

HI

Im doing a global search for all old email addresses used in our code. The search results are showing files that have already been modified. How can I search and only get results from latest commits on all repositories.


Answers:
author: Ben
body: G'day Alec!

Welcome to the Bitbucket Cloud community :)

Before assisting further, may you please clarify what is meant by "global search"? Are you using our CodeSearch functionality?

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Enable Smart Commits for existing DVCS - like git - project
Asked by Santeri Vesalainen:

I am using Crucible + FishEye with Git repository having application links configured to Jira.

**I wondered why my JIRA-123 #start Started progress commits won't change the JIRA ticket. But then I discovered**

<https://confluence.atlassian.com/display/FISHEYE/Enabling+Smart+Commits> :

[Go to start of metadata](https://confluence.atlassian.com/display/FISHEYE/Enabling+Smart+Commits#page-metadata-start)  
\<colgroup\>\<col width="24"\>\<col\>\</colgroup\>

|------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ![](https://confluence.atlassian.com/images/icons/emoticons/information.png) | Because Git and Mercurial allow commits to be attributed to users other than those pushing changes to the repository, if your FishEye instance has any DVCS repositories then Smart Commits will be disabled. This is a security measure to prevent privilege escalation. This only occurs when the feature is first initialised, and will not be disabled if new Git or Mercurial repositories are added afterwards. |

Q: Is there a somehow doable workaround for this?

I mean another than delete git repository and recreate it, and I bet won't do this.

Fisheye analysis with Crucible code review. (Version 2.7.13 Build:20120517072828 2012-05-17)


Answers:
author: seb
body: If you continue to read down that page which you linked to (Enablng Smart Commits), you can still enable the functionality. It is simply disabled by default if you have a Git repository. Once you enable it, it will stay enabled.

comments: author: Santeri Vesalainen
body: You mean that this should work if I have configured Application Links for repository and Crucible, although Day 1 the Smart Commits were disabled and Day 2 Repositories and Projects were added Day 3 Smart Commits were enabled?


author: Santeri Vesalainen
body: Now, it seemed that Crucible integration started working by +review command. Nice. Did not try that first.

Yet, jira is in other server could that be issue?

Eg. "Issue not found" is shown in mouse-hover on link top of JIRA-123 when commit message was "JIRA-123 #start Show starts"

When I click the link in commit message it opens ok, yet no progress is made.

Does the Jira need some configuration for Smart Commits . I was not able to find such a information.

Jira version is (v4.2.4-b591#591)


author: Sten Pittet
body: Have you created an application link between your JIRA instance and your FishEye instance? See <https://confluence.atlassian.com/display/FISHEYE/JIRA+Integration+in+FishEye> for more details about this.
FishEye Setup - What Is Expected Platform? What Is Envisioned Customer Architecture?
Asked by Jose Rosario:

I downloaded the FishEye product and attempt to run start.bat according to the instructions on my Win7 PC and a couple of command prompts flicker on and off but nothing happens.

I have VS2010 projects I am hoping to share with other developers in another region and was hoping JIRA OnDemand could help. It seemed I needed to download FishEye but I'm spinning my wheels. Do y'all have any knowledgeable, technically oriented and available sales people that could help a guy out during his evaluation period?


Answers:
author: Matthew Hunter
body: Hi Jose,

If you sign up for JIRA OnDemand and FishEye/Crucible on OnDemand then you won't need to install a local version of FishEye. Atlassian OnDemand has an inbuilt subversion repository that is hooked in to FishEye, so you don't need to perform any set up or installation at all. :)

You can check out the getting started documentation for more information:

<https://confluence.atlassian.com/display/AOD/Getting+started+with+Source+and+Review+Bundle>

If you'd like to import a local repository you can do so by following:

<https://confluence.atlassian.com/display/AOD/Importing+Versioned+Data+into+Subversion>

Cheers,

Matt


Tags: cloud

fisheye-crucible-svn-ondemand
Fisheye configuration
Asked by l:

Hi,

We want to configure FishEye to use the UNC path for a CVS repository. Is this a possibility? If so, what the steps that need to be completed?

thanks


Answers:
author: Gurleen Anand _Atlassian_
body: Hi Craig,

This should not be a problem. Please refer to the guide below to help configure Fisheye with your CVS repository.

<https://confluence.atlassian.com/display/FISHEYE/CVS>

Thanks,

Gurleen