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

Could not read from remote repository.

wapplertibor
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!
September 28, 2024

 

I welcome you.
I have been using their free bitbucket repository service for a long time. I haven't been able to upload and download files for a while because it throws an error: ( Before, the ssh authentication was done fine ) git pull Unauthorized fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

2 answers

1 vote
vikram
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.
September 30, 2024

Hi @wapplertibor 

Welcome to Atlassian Community. 

This question is already resolved you can check the below thread 

https://community.atlassian.com/t5/Bitbucket-questions/Unable-to-push-code-to-my-private-repo/qaq-p/708507

and below knowledge document url

https://support.atlassian.com/bitbucket-cloud/docs/configure-repository-settings/

Vikram P

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 1, 2024

Hi @wapplertibor and welcome to the community!

Did you set up SSH keys for Bitbucket Cloud on this computer in the past? I assume you did, since you mention that SSH authentication was working before. But just in case you haven't, I am sharing the links from our documentation on how to do it:

If you have already set up SSH keys on this computer, and assuming that you use OpenSSH as an SSH client, I suggest adding the following in the ~/.ssh/config of this computer (if the file doesn't exist, you can create it and add this content):

Host bitbucket.org
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa

where id_rsa replace with the name of your private SSH key, whose public key has been added to Bitbucket (in case it is different). Please also ensure that this key exists in the ~/.ssh directory. This configuration will ensure that this key is offered every time you clone, pull or push to a Bitbucket repo via SSH.

Another thing to check is whether you have access to this repo. Can you see this repository after you log in to https://bitbucket.org/ on your browser?

If you are still experiencing issues, can you run the git pull command with the following option and share the output here?

GIT_SSH_COMMAND="ssh -vvv" git pull

This will show more verbose output so we can investigate the issue further. Please make sure you sanitize any private data in the output before sharing it (like repo name, workspace id).

Kind regards,
Theodora

wapplertibor
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!
October 3, 2024

ssh key ok.

My error, push output now:
Unauthorized
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 4, 2024

Hi @wapplertibor,

1. Can you access this repository on our website, https://bitbucket.org/, after you log in to your account? If this is not your own repo, have you been granted write access to it?

I can see that some repositories of your workspace were recently deleted, so I'm not sure if you're trying to pull or push to a deleted repo.

If the repository exists and you do have write access:

2. Is the git pull successful, or does the git pull also fail?

If the git pull is successful and the git push fails, please ensure that the public SSH key is added to your account settings here https://bitbucket.org/account/settings/ssh-keys/ and not as an Access key. An Access key that is added to a repo or a prject provides read-only acccess to a repo, so you will be able to clone and pull, but not push. If you have added this SSH key as an Access key, remove it from the Access keys and add it here https://bitbucket.org/account/settings/ssh-keys/.

If that step is also ok:

3. Are you using OpenSSH as an SSH client? If so, have you followed these steps from my previous reply?

If you have already set up SSH keys on this computer, and assuming that you use OpenSSH as an SSH client, I suggest adding the following in the ~/.ssh/config of this computer (if the file doesn't exist, you can create it and add this content):

Host bitbucket.org
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa

where id_rsa replace with the name of your private SSH key, whose public key has been added to Bitbucket (in case it is different). Please also ensure that this key exists in the ~/.ssh directory. This configuration will ensure that this key is offered every time you clone, pull or push to a Bitbucket repo via SSH.


Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events