Adding git repo fails due to Permission denied error

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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

Problem

Getting UI error message below when adding GIT repository:

(Auto-migrated image: description temporarily unavailable)

Also following entry can be found in Fisheye logs:

1 2 3 4 5 6 7 8 9 10 11 12 Fisheye is using '/usr/bin/ssh' to authenticate with SSH authenticated repositories. Exception executing command "/usr/bin/git ls-remote -h ssh://git@your-git-address.com/opt/git/ops.git " Non-zero exit code: 128 com.atlassian.utils.process.ProcessException: Non-zero exit code: 128 Error executing command "/usr/bin/git ls-remote -h ssh://git@your-git-address.com/opt/git/ops.git ": Permission denied (publickey,gssapi-with-mic,password). fatal: The remote end hung up unexpectedly Error testing connection. Error talking to repository: Permission denied (publickey,gssapi-with-mic,password). fatal: The remote end hung up unexpectedly at com.atlassian.fisheye.git.GitScmConfig.testConnection(GitScmConfig.java:162) at com.cenqua.fisheye.RepositoryConfig.testConnection(RepositoryConfig.java:450) at com.atlassian.fisheye.spi.admin.impl.DefaultRepositoryAdminService.testConnectionFor(DefaultRepositoryAdminService.java:540) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) Connection failed.

Cause

This GIT executable is not defined in Fisheye UI and the ssh keys are not configured.

Resolution

First step is to define the Git executable inside Fisheye by doing:

  1. Go to Fisheye Administration.

  2. Click on Server.

  3. Look for Git Executable then click on Edit details.

  4. Set the path to your Git executable and save.

Once Git executable is defined refer to this article to generate SSH keys and have Fisheye authenticating against the GIT Server.

Updated on April 10, 2025

Still need help?

The Atlassian Community is here for you.