Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bitbucket Pipelines : Permission denied (publickey)

ajaysfdev@gmail.com November 4, 2016

This question is in reference to Atlassian Documentation: Access remote hosts via SSH

I am new to Bitbucket pipelines, and trying to setup with salesforce. I am getting the following issue. Can anyone help me to resolve this issue? I did follow the instructions provided in the document to generate public key, still I am having this issue.

https://confluence.atlassian.com/bitbucket/access-remote-hosts-via-ssh-847452940.html

 

er.png

4 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Tom Bradshaw
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 14, 2016

Hi there,

Unfortunately without more information we can't really address this problem. That being the case could you please raise a support ticket at https://support.atlassian.com/ so we can continue to investigate?

0 votes
Blazej Balakowicz November 4, 2016

how do you base your SSH_KEY? I had similar problem when I use base64 like in documentation and that command return string with new lines. When I run that way:

base64 -w 0 < my_ssh_key

solve my problem

0 votes
ajaysfdev@gmail.com November 4, 2016

I am fetching latest changes from Salesforce. I have added the public key to repo and private key to account environment variables.

 save-changes:
      - step:
          script:
            # Set up SSH key; follow instructions at https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Bitbucket+Pipelines
            - (mkdir -p ~/.ssh ; cat my_known_hosts >> ~/.ssh/known_hosts; umask 077 ; echo $SSH_KEY | base64 -d > ~/.ssh/my_ssh_key)

            # Read update_to_trigger_pipelines.txt into commitmsg variable
            - commitmsg="$(<update_to_trigger_pipelines.txt)"

            # Set up repo and checkout master
            - git remote set-url origin git@bitbucket.org:$BITBUCKET_REPO_OWNER/$BITBUCKET_REPO_SLUG.git
            - git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
            - git fetch
            - git checkout master

            # Get metadata from server
            - ant -buildfile build/build.xml getCode -Dsfdc.username=$SFDC_USERNAME -Dsfdc.password=$SFDC_PASS$SFDC_TOKEN -Dsfdc.serverurl=https://$SFDC_SERVERURL

            # Commit any changes to master
            - git add src/*
            - git config user.name "$GIT_USERNAME"
            - git config user.email "$GIT_EMAIL"
            - if [[ -n $(git status -s) ]] ; then filelist=`git status -s` ; git commit -a -m "$commitmsg" -m "$filelist" ; git push origin master:master ; else echo "No changes detected"; fi
0 votes
jredmond
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 4, 2016

What are you trying to fetch, and from where? The error message implies that Pipelines is attempting to fetch something from somewhere, but that that somewhere doesn't recognize the user or key.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events