Forums

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

repository access denied. deployment key is not associated with the requested repository.

surendra-we
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 21, 2018

I am trying to setup 2 rails app on same server. First rails app is setup successfully. Now with second rails app, I am getting following issue:

repository access denied. deployment key is not associated with the requested repository.

 

I followed same steps to setup second rails app as first app. I created different ssh-key for second rails app repo on bitbucket, added that key as deployment key in second rails app's repo. Even when I tried 

ssh -T git@bitbucket.org

it shows me message following message:

authenticated via a deploy key.


You can use git or hg to connect to Bitbucket. Shell access is disabled.

This deploy key has read access to the following repositories:

But when I am trying to deploy my rails app via Capistrano, it's just not allowing that and throwing that first error. I am able to clone the repo on server with proper command, but not able to access it via capistrano deploy.

Can someone let me know what is wrong here? Again, I followed same steps as I followed for my first rails app.

Any help or suggestion would be highly appreciated. 

 

 

 

1 answer

2 votes
jredmond
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 21, 2018

You can use the same deployment key on multiple different repositories.

If you'd prefer to keep separate keys for each, though, then you'll need to use the ssh config file to set separate aliases for each:

Host bitbucket-repoA
Host bitbucket.org
IdentityFile /path/to/first/key

Host bitbucket-repoB
Host bitbucket.org
IdentityFile /path/to/second/key

Once that's done, you'll need to adjust the remote URL on each repository to refer to either "bitbucket-repoA" or "bitbucket-repoB" (or whatever you chose to name the two aliases) instead of bitbucket.org. That will ensure that SSH uses the correct private key to connect.

surendra-we
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 23, 2018

Thanks @jredmond

I wasn't aware that I could use same deployment key for multiple different repositories. I used same deployment key for that 2nd repo and it worked.

Thanks for the help! :)

Marcos Lima September 30, 2018

I'm trying to access the repository with edit permissions via ssh. I've added the ssh key to my account, but I'm getting the same error above. Am I missing to setup something on my profile in order to use ssh keys as usual?

jredmond
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 3, 2018

Access keys are read-only, by design. If you want to be able to write then you need to add the key to your account.

Like CMSABNAV_storb likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events