Forums

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

Bitbucket issue not able to interact with repository however can login into bitbucket by the browser

MayurMMC September 6, 2018

We are able to login to Bitbucket by the browser, but when we try to clone we are getting a Connection refused,
We have tried:

git clone https://someuser.id@mybitbucket.FQDN.com:7990/proejct/repository.git

git clone https://someuser.id@mybitbucket.FQDN.com/proejct/repository.git
 

also by ssh and the connections is successful but the password says that is wrong, even if we add a ssh key

git clone ssh://fernando.cervantes@bitbucket.mmc.com/ow/owv2.git

$ git clone https://user.id@mybitbucket.FQDN.com:7990/scm/test1/testconversion_mmcosgi01.git
Cloning into 'test conversion_mmcosgi01'...
fatal: unable to access 'https://user.id@mybitbucket.FQDN.com:7990/scm/test1/testconversion_mmcosgi0
1.git/': Failed to connect to my bitbucket.FQDN.com port 7990: Connection refused but to same Bitbucket sever (same  FQDN) with port 7990 I am able to access over Browser with similar UserName and Password.

3 answers

0 votes
MayurMMC September 18, 2018

Hi Mikael,

 

I run similar command  but seems there is some issue with key file. Seems it is getting is_rsa type 1 but on next line immediately shows debug1: key_load_public: No such file or directory

 

debug1: Connection established.
debug1: identity file /p/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory

...

but post 

debug1: SSH2_MSG_SERVICE_ACCEPT received

 

seems it is not able to use id_rsa public key.

debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /p/.ssh/id_rsa

 

And falls back on password mechanism.

 

=-=-=-=-=

 

U1102983@USHBKML8XSPXZ1 MINGW64 ~
$ ssh -v mayur.rami@bitbucket.mmc.com 7999
OpenSSH_7.5p1, OpenSSL 1.0.2l 25 May 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to bitbucket.mmc.com [54.177.200.45] port 22.
debug1: Connection established.
debug1: identity file /p/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /p/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /p/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /p/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /p/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /p/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /p/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /p/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.5
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Authenticating to bitbucket.mmc.com:22 as 'mayur.rami'
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: aes128-ctr MAC: umac-64@openssh.com compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: umac-64@openssh.com compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:CbiyAyRyHD2JqGzzpMija3GdcMAURP5OObHNzKInwkw
debug1: Host 'bitbucket.mmc.com' is known and matches the ECDSA host key.
debug1: Found key in /p/.ssh/known_hosts:1
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
###############################################################################################
ALERT! You are entering into a secured area!
Your IP, Login Time, Username has been noted and has been sent to the server administrator!
This service is restricted to authorized users only. All activities on this system are logged.
Unauthorized access will be fully investigated and reported to the appropriate authorities.
###############################################################################################
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /p/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /p/.ssh/id_dsa
debug1: Trying private key: /p/.ssh/id_ecdsa
debug1: Trying private key: /p/.ssh/id_ed25519
debug1: Next authentication method: password
mayur.rami@bitbucket.mmc.com's password:
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
mayur.rami@bitbucket.mmc.com's password:
Received disconnect from 54.177.200.45 port 22:2: Too many authentication failures for mayur.rami
Authentication failed.

Mikael Sandberg
Community Champion
September 18, 2018

The first error you see indicate that your SSH keys are not where your Windows Home directory is. So if your home is on P: you need to either put the SSH folder under that drive, or set the environment variable HOME to point to where you store your SSH folder. Example:

My Windows profile is under c:\users\mikael and here I have my .ssh folder. But my login script sets my home to the Z:. In this case I would either have to copy my .ssh folder to Z: or set the HOME environment variable to equal c:\users\mikael

0 votes
MayurMMC September 18, 2018

Hi Mikael,

 

I asked user to run above command. Please, see the output

 

$ ssh -vT bitbucket.mmc.com
OpenSSH_7.5p1, OpenSSL 1.0.2k 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to bitbucket.mmc.com [54.177.200.45] port 22.
debug1: Connection established.
debug1: identity file /c/Users/David.Lubin/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/David.Lubin/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/David.Lubin/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/David.Lubin/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/David.Lubin/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/David.Lubin/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/David.Lubin/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/David.Lubin/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.5
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Authenticating to bitbucket.mmc.com:22 as 'david.lubin'
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: aes128-ctr MAC: umac-64@openssh.com compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: umac-64@openssh.com compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:CbiyAyRyHD2JqGzzpMija3GdcMAURP5OObHNzKInwkw
debug1: Host 'bitbucket.mmc.com' is known and matches the ECDSA host key.
debug1: Found key in /c/Users/David.Lubin/.ssh/known_hosts:5
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
###############################################################################################
ALERT! You are entering into a secured area!
Your IP, Login Time, Username has been noted and has been sent to the server administrator!
This service is restricted to authorized users only. All activities on this system are logged.
Unauthorized access will be fully investigated and reported to the appropriate authorities.
###############################################################################################
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /c/Users/David.Lubin/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /c/Users/David.Lubin/.ssh/id_dsa
debug1: Trying private key: /c/Users/David.Lubin/.ssh/id_ecdsa
debug1: Trying private key: /c/Users/David.Lubin/.ssh/id_ed25519
debug1: Next authentication method: password
david.lubin@bitbucket.mmc.com's password:
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
david.lubin@bitbucket.mmc.com's password:
Received disconnect from 54.177.200.45 port 22:2: Too many authentication failures for david.lubin
Authentication failed.

Mikael Sandberg
Community Champion
September 18, 2018

Have you tried using the URL that Bitbucket provide you when you click clone in the repository? The SSH URL should look something like this:

ssh://git@bitbucket.myserver.com:7999/pr/repository.git

MayurMMC September 18, 2018

Hi Mikael,

 

Yes I tried with both Ports 7990 & 7999.

Through port 7990 on Browser I am able to login.

 

U1102983@USHBKML8XSPXZ1 MINGW64 ~
$ ssh -T mayur.rami@bitbucket.mmc.com 7990
###############################################################################################
ALERT! You are entering into a secured area!
Your IP, Login Time, Username has been noted and has been sent to the server administrator!
This service is restricted to authorized users only. All activities on this system are logged.
Unauthorized access will be fully investigated and reported to the appropriate authorities.
###############################################################################################
mayur.rami@bitbucket.mmc.com's password:
Permission denied, please try again.
mayur.rami@bitbucket.mmc.com's password:
Received disconnect from 54.177.200.45 port 22:2: Too many authentication failures for mayur.rami
Authentication failed.

U1102983@USHBKML8XSPXZ1 MINGW64 ~
$ ssh -T mayur.rami@bitbucket.mmc.com 7999
###############################################################################################
ALERT! You are entering into a secured area!
Your IP, Login Time, Username has been noted and has been sent to the server administrator!
This service is restricted to authorized users only. All activities on this system are logged.
Unauthorized access will be fully investigated and reported to the appropriate authorities.
###############################################################################################
mayur.rami@bitbucket.mmc.com's password:
Permission denied, please try again.
mayur.rami@bitbucket.mmc.com's password:
Received disconnect from 54.177.200.45 port 22:2: Too many authentication failures for mayur.rami
Authentication failed.

MayurMMC September 18, 2018

same behavior with port 22, too.

U1102983@USHBKML8XSPXZ1 MINGW64 ~
$ ssh -T mayur.rami@bitbucket.mmc.com 22
###############################################################################################
ALERT! You are entering into a secured area!
Your IP, Login Time, Username has been noted and has been sent to the server administrator!
This service is restricted to authorized users only. All activities on this system are logged.
Unauthorized access will be fully investigated and reported to the appropriate authorities.
###############################################################################################
mayur.rami@bitbucket.mmc.com's password:
Permission denied, please try again.
mayur.rami@bitbucket.mmc.com's password:
Received disconnect from 54.177.200.45 port 22:2: Too many authentication failures for mayur.rami
Authentication failed.

Mikael Sandberg
Community Champion
September 18, 2018

I should have clarified, have you tried to clone using the URL that Bitbucket provide you when clicking on Clone? The only port SSH is using is 7999 and the URL should not contain any reference to a username. The URL, with the clone command, should look something like this:

git clone ssh://git@bitbucket.myserver.com:7999/pr/repository.git

Replace the URL in my example with the one that Bitbucket is showing. 

MayurMMC September 18, 2018

 

See the output with referred 

 

If you want to simply clone this empty repository then run this command in your terminal.

git clone ssh://git@bitbucket.mmc.com:7999/test1/testconversion_mmcosgi01.git

 

U1102983@USHBKML8XSPXZ1 MINGW64 ~
$ git clone ssh://git@bitbucket.mmc.com:7999/test1/testconversion_mmcosgi01.git
Cloning into 'testconversion_mmcosgi01'...
ssh: connect to host bitbucket.mmc.com port 7999: Connection refused
fatal: Could not read from remote repository.

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

 

But I have checked in Bitbucket server the referred User has Admin, Write and Read access for above repository.

Mikael Sandberg
Community Champion
September 18, 2018

Is this the same user that got the no such file or directory error when doing the ssh test? If that is the case then you need to look at where your windows home directory is, see my comments below. Also, have you tried cloning using the HTTP URL to rule out any connection issues between the client and the server?

0 votes
Mikael Sandberg
Community Champion
September 6, 2018

Have you tried using the URL that you get from Bitbucket when you click on clone button? The SSH URL does not look correct, it should look something like this:

ssh://git@bitbucket.myserver.com:7999/pr/repository.git

Do you have a firewall in between your Bitbucket Server and the clients?

MayurMMC September 13, 2018

Hi Mikael,

 

We are doing both connectivities from my company network. So, for your query I can say certainly there would be a firewall. Our network team already allowed (opened) port # 7990 on our firewalls.

 

Strange issue is - from browser with same user name & password we are able to connect to Bitbucket server.

However, whenever we try same for any GIT operations it is not working. We are not able to do GIT clone/pull/fetch etc.

I have checked that the users who are trying for GIT operations they are allowed to work on that repository. Even repository owners are also not able to clone/push/pull on the repositories or server.

 

Can you, please, guide me how to determine that issue is lying at what level?

Is there any configuration supposed to be enable at Bitbucet server level ?   OR  Is something is blocking from network?   How to determine issue remains at which end ?

Mikael Sandberg
Community Champion
September 13, 2018

@MayurMMC I am not a network expert, so cannot tell you how to determine were the issue is. If you have a SSH key setup you could try and see what the output from this command tells you:

ssh -vT bitbucket.myserver.com

If you get to the point that it asks for a password your firewall/proxy is setup to allow ssh connections to you Bitbucket server. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events