Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-21903

SSH or SCP tasks will fail if the SSH private key is of type ed25519

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 9.1.0, 8.2.7, 9.0.2
    • 8.2.4
    • Tasks
    • None

    Description

      Issue Summary

      SCP Task will fail if the SSH private key is of type ed25519

      Steps to Reproduce

      1. Create an ed25519 SSH keypair using ssh-keygen or putty-keygen
      2. Add the equivalent public key to the target SSH host authorized_keys file
      3. In Bamboo, use an SCP or SSH task to connect to the SSH host
      4. Run the plan/deployment

      Expected Results

      The SSH connection should succeed

      Actual Results

      Build fails with the below exception

      error	29-Sep-2022 10:00:36	Error occurred while running Task '(3)' of type com.atlassian.bamboo.plugins.bamboo-scp-plugin:sshtask.
      error	29-Sep-2022 10:00:36	java.lang.ClassCastException: class net.i2p.crypto.eddsa.EdDSAPublicKey cannot be cast to class net.i2p.crypto.eddsa.EdDSAPublicKey (net.i2p.crypto.eddsa.EdDSAPublicKey is in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @3b620b21; net.i2p.crypto.eddsa.EdDSAPublicKey is in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @4da5f22c)
      error	29-Sep-2022 10:00:36		at net.schmizz.sshj.common.KeyType$6.writePubKeyContentsIntoBuffer(KeyType.java:202)
      error	29-Sep-2022 10:00:36		at net.schmizz.sshj.common.KeyType.putPubKeyIntoBuffer(KeyType.java:388)
      error	29-Sep-2022 10:00:36		at net.schmizz.sshj.common.Buffer.putPublicKey(Buffer.java:499)
      error	29-Sep-2022 10:00:36		at net.schmizz.sshj.userauth.method.KeyedAuthMethod.putPubKey(KeyedAuthMethod.java:55)
      error	29-Sep-2022 10:00:36		at net.schmizz.sshj.userauth.method.AuthPublickey.buildReq(AuthPublickey.java:62)
      error	29-Sep-2022 10:00:36		at net.schmizz.sshj.userauth.method.AuthPublickey.buildReq(AuthPublickey.java:81)
      error	29-Sep-2022 10:00:36		at net.schmizz.sshj.userauth.method.AbstractAuthMethod.request(AbstractAuthMethod.java:68)
      error	29-Sep-2022 10:00:36		at net.schmizz.sshj.userauth.UserAuthImpl.authenticate(UserAuthImpl.java:73)
      error	29-Sep-2022 10:00:36		at net.schmizz.sshj.SSHClient.auth(SSHClient.java:221)
      error	29-Sep-2022 10:00:36		at net.schmizz.sshj.SSHClient.authPublickey(SSHClient.java:342)
      error	29-Sep-2022 10:00:36		at com.atlassian.bamboo.plugins.scp.SshTask.execute(SshTask.java:114)
      error	29-Sep-2022 10:00:36		at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$3(TaskExecutorImpl.java:323)
      error	29-Sep-2022 10:00:36		at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:258)
      error	29-Sep-2022 10:00:36		at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:323)
      error	29-Sep-2022 10:00:36		at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:118)
      error	29-Sep-2022 10:00:36		at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:73)
      error	29-Sep-2022 10:00:36		at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.executeBuildPhase(DefaultBuildAgent.java:205)
      error	29-Sep-2022 10:00:36		at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:177)
      error	29-Sep-2022 10:00:36		at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.lambda$waitAndPerformBuild$0(BuildAgentControllerImpl.java:169)
      error	29-Sep-2022 10:00:36		at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:118)
      error	29-Sep-2022 10:00:36		at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:162)
      error	29-Sep-2022 10:00:36		at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.lambda$start$0(DefaultBuildAgent.java:122)
      error	29-Sep-2022 10:00:36		at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48)
      error	29-Sep-2022 10:00:36		at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)
      error	29-Sep-2022 10:00:36		at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)
      error	29-Sep-2022 10:00:36		at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41)
      error	29-Sep-2022 10:00:36		at java.base/java.lang.Thread.run(Thread.java:829)
      

      Workarounds

      1. On the SCP/SSH Task use a different type of SSH private key such as RSA
      2. Use a Script Task with proper "ssh" or "scp" commands – This will require setting the authentication and key exchange manually on the Server and Agents

      Attachments

        Issue Links

          Activity

            People

              mgardias Marcin Gardias
              feeaafc2eddb Mohamed Ayman
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: