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

WHY?: repository access denied. access via a deployment key is read-only.

cosmicelf August 3, 2017

 

I am trying to commit my new application to the repository for the first time.   Thought I followed the directions to a tee however I am getting the error in the subject line no matter what I try.

What is the trick to getting the first commit though?   Did I not set up my key properly?   It seems to tell me that keys are for read only access only but how does one commit with only read access?

 

1 answer

0 votes
Boris Berenberg - Atlas Authority
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 3, 2017

Deployment keys are to deploy. You need to install an ssh key, or push via HTTP.

cosmicelf August 4, 2017

I was looking for a place I could do that but was finding it not too obvious.   "Access Keys" was the only setting I could find.

Boris Berenberg - Atlas Authority
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 4, 2017
cosmicelf August 4, 2017

that link is broken

Like DHurtadoPz likes this
cosmicelf August 4, 2017

oops.  it was broken when i clicked on it for some reason but a copy and paste found it

Boris Berenberg - Atlas Authority
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 4, 2017

Hmm weird, trying again https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html If it doesn't work, try copy pasting it in

cosmicelf August 4, 2017

that got it!   i just didn't see the other place to add keys before.  it's going now.   thanks!

Greg Mercer October 24, 2018

Here is what I was struggling with and the answer I discovered.

I was trying to run pipeline in one repo 'A', and then in the last step have it git clone repo 'B' which has another pipeline, make a change to a file in repo 'B', commit that change and push up to repo 'B', and then trigger the pipeline in repo 'B' to run a custom step.

I had the code in place to trigger the run of pipeline in 'B' using a call to curl. That call looks like this:

 curl -X POST -is -u <username-goes-here>:<app-password-goes-here> \
-H 'Content-Type: application/json' \
https://api.bitbucket.org/2.0/repositories/<repo-project-name-goes-here>/<repo-b-name-goes-here>/pipelines/ \
-d '
{
"target": {
"ref_type": "branch",
"type": "pipeline_ref_target",
"ref_name": "master",
"selector": {
"type":"custom",
"pattern":"<custom-step-name-goes-here>"
}
}
}'

The app-password is a key point here. You need to get this from a settings page under your profile.

https://bitbucket.org/account/user/<username-goes-here>/app-passwords

The point that I struggled with is getting the git commit and git push to work.

The answer: I found that I had to add a ssh key under my profile:
https://bitbucket.org/account/user/<username-goes-here>/ssh-keys/

Then importantly... when I did the git clone I had to use https instead of ssh. So the clone looks like this:

git clone https://<username-goes-here>:<app-password-here>@bitbucket.org/<repo-project-name-goes-here>/<repo-b-name-goes-here>.git

Add that did the trick. Wee... Hopes this helps other.

Ps. The reason I do this git clone, commit and push is to pass arg values to the triggered pipeline. Which BTW seems to be the only way I could find to be able to run a pipeline with args. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events