When I do a git pull on an existing repository I get the following
"remote: You may not have access to this repository or it no longer exists in this workspace"
Details. I am confused and this is new. I am not sure what has changed. Can you please help?
```
$ git pull
Username for 'https://bitbucket.org': cenla1
Password for 'https://cenla1@bitbucket.org':
remote: You may not have access to this repository or it no longer exists in this workspace. If you think this repository exists and you have access, make sure you are authenticated.
fatal: Authentication failed for 'https://bitbucket.org/cenla1/yf-erl/'
```
Hi @cenla1
Welcome to the community!
What authentication method did you use previously? Could you generate a new App Password and check if it works?
Regards,
Syahrul
I either used username and password (as in my original post) or I used ssh (with a ssh key).
I am not sure an "app password" is even relevant here. I just simply want to perform git push/pull/clone from the command line.
Depending on whether I want to use username/password or ssh (key), I either have the following set
ssh -> git remote set-url origin ssh://git@bitbucket.org/cenla1/yf-erl.git
https -> git remote set-url origin https://cenla1@bitbucket.org/cenla1/yf-erl.git
My ssh "test" looks good when I execute the following
$ ssh -Tv git@bitbucket.org
I get
debug1: Reading configuration data /Users/cenla1/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to bitbucket.org port 22.
debug1: Connection established.
debug1: identity file /Users/cenla1/.ssh/id_rsa type 0
debug1: identity file /Users/cenla1/.ssh/id_rsa-cert type -1
debug1: identity file /Users/cenla1/.ssh/id_dsa type -1
debug1: identity file /Users/cenla1/.ssh/id_dsa-cert type -1
debug1: identity file /Users/cenla1/.ssh/id_ecdsa type -1
debug1: identity file /Users/cenla1/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/cenla1/.ssh/id_ed25519 type -1
debug1: identity file /Users/cenla1/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/cenla1/.ssh/id_xmss type -1
debug1: identity file /Users/cenla1/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.8
debug1: Remote protocol version 2.0, remote software version conker_a59a2ea2c5-dirty 52337c77ac7e
debug1: no match: conker_a59a2ea2c5-dirty 52337c77ac7e
debug1: Authenticating to bitbucket.org:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:FC73VB6C4OQLSCrjEayhMp9UMxS97caD/Yyi2bhW/J0
debug1: Host 'bitbucket.org' is known and matches the ECDSA host key.
debug1: Found key in /Users/cenla1/.ssh/known_hosts:93
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-dss,ecdsa-sha2-nistp384,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,rsa-sha2-256,rsa-sha2-512,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp521,ssh-rsa,ecdsa-sha2-nistp256>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:tEchcM05V5vbeUQC0IZrEAGlgC1UR8CNUZ1Xntyk7PI /Users/cenla1/.ssh/id_rsa
debug1: Server accepts key: pkalg rsa-sha2-512 blen 279
debug1: Authentication succeeded (publickey).
Authenticated to bitbucket.org ([104.192.142.26]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
authenticated via ssh key.
You can use git to connect to Bitbucket. Shell access is disabled
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2684, received 2456 bytes, in 0.1 seconds
Bytes per second: sent 22315.7, received 20420.0
debug1: Exit status 0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @cenla1,
Thanks for the update.
Bitbucket cloud doesn't support account passwords for authentication. You need to use either an App Password or an API token for HTTPS connections. If you're still using an account password, please update it and switch to one of these credentials.\
The SSH test you ran confirms that you can SSH into Bitbucket, but it doesn't guarantee that other Git activities will work without issues. This depends on whether your SSH key is correctly configured for your workspace and repository.
The best way to troubleshoot SSH connection problems is to run these verbose commands:
GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_SSH_COMMAND="ssh -vvv" <git command>
This will provide more detailed information about your SSH connection and whether the correct SSH keys are being used.
Regards,
Syahrul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FWIW, your suggested troubleshooting showed that my SSH was NOT the problem but instead was some type of bitbucket auth. Some how I missed the fact that account user/password was no longer allowed.
I noticed that "App Passwords" are going away soon. Instead of alternatively using "API token", I decided as another option to use repository "access tokens". It is not perfect, but I am relatively happy with the results.
@Syahrul thanks for getting me pointed in the correct direction.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.