SSH clone failing with error "fatal: Could not read from remote repository" in Bitbucket Server

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible


SSH clone requests failing almost immediately when tried to clone

git clone -v ssh://git@bitbucket.internal:7999/at/atlasts.git

14:52:49.366381 git.c:344 trace: built-in: git 'clone' '-v' 'ssh://git@bitbucket.internal:7999/at/atlasts.git'
Cloning into 'atlasts'...
14:52:49.375286 run-command.c:626 trace: run_command: 'ssh' '-p' '7999' 'git@bitbucket.internal' 'git-upload-pack '\''/at/atlasts.git'\'''
fatal: Could not read from remote repository.

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




  • Enable debugging on Bitbucket server
  • Check the Bitbucket server logs atlassian-bitbucket.log for the below error
2021-05-14 14:41:32,704 DEBUG [sshd-SshServer[116c3165](port=7999)-nio2-thread-7]  c.a.s.i.s.g.p.ssh.GitSshScmRequest upload-pack was canceled before git could be started


  • Modified values for the SSH related parameters on file might cause this issue. 
  • Check the for any SSH-related customizations.


Check the file for if it's set to a higher value than the default 4096 then that could possibly cause this issue.

The default value for the is 4096 and it defines the buffer size in bytes which is used when marshaling data between the git process and the SSH socket. The default is 4K, with a 1K minimum.

To fix the issue remove the parameter and then restart the Bitbucket service for the updated config to take effect and then try to clone again

Last modified on Jan 20, 2022

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.