Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Bitbucket Pipeline Failing with "Permission Denied" Error When Accessing Repository

Ben Stokes
Banned
November 3, 2024

Hi Atlassian Community,

I’m running into a "Permission Denied" error with Bitbucket Pipelines when it tries to pull code from one of my private repositories. The pipeline was working fine until recently, and I haven’t changed any of the repository permissions or SSH keys, so I’m not sure what’s causing the failure.

Here’s what I’ve tried so far:

  • Verified that the SSH key is still added to the repository’s access keys.
  • Double-checked my pipeline configuration for any syntax issues or changes.
  • Re-generated and re-added the SSH key to ensure it wasn’t corrupted.

Is there something in the pipeline settings that I might be missing, or has anyone else experienced issues with permission changes affecting pipelines? Any help would be much appreciated!

Thanks in advance for any insights!

1 answer

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 5, 2024

Hi Ben,

Could you please let me know the following, so I can better help you?

1. Are you running this Pipelines step on Atlassian's infrastructure or with one of our self-hosted runners?

2. If you are using a runner, is it a Linux Docker, Linux Shell, MacOS or Windows runner?

What is the version of the runner?

3. In the repository where you run this Pipelines step, I assume you have generated the SSH key pair from Repository settings > section Pipelines - SSH keys?

If so, can you confirm if the public SSH key from that page matches one of the Access keys of the repo you are cloning?

4. Can you adjust your bitbucket-pipelines.yml file and add GIT_SSH_COMMAND="ssh -vvv" to the command that clones the repo?

Like this:

- GIT_SSH_COMMAND="ssh -vvv" git clone git@bitbucket.org:workspace-id/repo-slug.git

where workspace-id and repo-slug should be the values for the repo you are trying to clone.

Then, when another build with this adjusted command runs, please share the output of the command here (please make sure you sanitize any private/sensitive data in the output, before sharing).

This will show us more verbose output, including which SSH key is offered, and it may give us an indication of what is going wrong.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events