"Algorithm negotiation fail" error while creating tags on Jenkins using Bitbucket server

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

Summary

While creating tags on the Bitbucket server, we see the "Algorithm negotiation fail" message in the Jenkins build logs.

Environment

  • Bitbucket server 8.x onwards

  • Jenkins

Diagnosis

The Jenkins Build Console logs have the below:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 03:22:56 Buildfile: /pso-jenkins/deployer/sd-client/git-tasks.xml 03:22:56 03:22:56 create-tag: 03:22:56 [create-tag] Taging EXEL/WM-2017/PHASE1/SDN/SDN1154 Started... 03:22:56 [create-tag] /apps/scope/pso-jenkins-ws/workspace/EXEL-WM2017-PHASE1-SDN/SCPP_base_Base 03:22:58 03:22:58 BUILD FAILED 03:22:58 /pso-jenkins/deployer/sd-client/git-tasks.xml:19: org.eclipse.jgit.api.errors.TransportException: ssh://git@atlgit-01.us.manh.com:7999/soscpp/base.git: Algorithm negotiation fail 03:22:58 at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:160) 03:22:58 at com.manh.pso.ci.git.GitHelper.tagRepository(GitHelper.java:31) 03:22:58 at com.manh.pso.ci.tasks.CreateTag.execute(CreateTag.java:26) 03:22:58 at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) 03:22:58 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 03:22:58 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 03:22:58 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 03:22:58 at java.lang.reflect.Method.invoke(Method.java:498) 03:22:58 at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) 03:22:58 at org.apache.tools.ant.Task.perform(Task.java:348) 03:22:58 at org.apache.tools.ant.Target.execute(Target.java:435) 03:22:58 at org.apache.tools.ant.Target.performTasks(Target.java:456) 03:22:58 at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393) 03:22:58 at org.apache.tools.ant.Project.executeTarget(Project.java:1364) 03:22:58 at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) 03:22:58 at org.apache.tools.ant.Project.executeTargets(Project.java:1248) 03:22:58 at org.apache.tools.ant.Main.runBuild(Main.java:851) 03:22:58 at org.apache.tools.ant.Main.startAnt(Main.java:235) 03:22:58 at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) 03:22:58 at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) 03:22:58 Caused by: org.eclipse.jgit.errors.TransportException: ssh://git@atlgit-01.us.manh.com:7999/soscpp/base.git: Algorithm negotiation fail 03:22:58 at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:142) 03:22:58 at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:121) 03:22:58 at org.eclipse.jgit.transport.TransportGitSsh$SshPushConnection.<init>(TransportGitSsh.java:306) 03:22:58 at org.eclipse.jgit.transport.TransportGitSsh.openPush(TransportGitSsh.java:152) 03:22:58 at org.eclipse.jgit.transport.PushProcess.execute(PushProcess.java:154) 03:22:58 at org.eclipse.jgit.transport.Transport.push(Transport.java:1173) 03:22:58 at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:156) 03:22:58 ... 19 more 03:22:58 Caused by: com.jcraft.jsch.JSchException: Algorithm negotiation fail 03:22:58 at com.jcraft.jsch.Session.receive_kexinit(Session.java:582) 03:22:58 at com.jcraft.jsch.Session.connect(Session.java:320) 03:22:58 at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)

Cause

The setting of plugin.ssh.dhgex.allow-sha1=true in bitbucket.properties would allow the sha1 keys on the Bitbucket side. The default was changed in Bitbucket 8.x to false.

Solution

Specify plugin.ssh.dhgex.allow-sha1=true in your <Bitbucket-home>/shared/bitbucket.properties file. You'll have to restart Bitbucket for this to take effect.

Updated on February 25, 2025

Still need help?

The Atlassian Community is here for you.