Adding an SSH Key on a SCP Task fails with an IOException

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Low
    • 8.1.1
    • Affects Version/s: 6.9.0, 7.2.4
    • Component/s: SCP and SSH tasks
    • None
    • 1
    • Severity 3 - Minor

      Issue Summary

      Adding SSH key to a SCP/SSH task fails on a specific type of SSH key.

      Steps to Reproduce

      1. Create an SSH Key Pair
      ssh-keygen
      1. Inspect the private key and confirm that the header contains the following
      -----BEGIN OPENSSH PRIVATE KEY-----
      1. Create an SCP/SSH Task in a Bamboo build plan
      2. Upload the SSH Key and save the task

      Expected Results

      The private key file is uploaded and the SCP/SSH task saves successfully.

      Actual Results

      The below exception is thrown in the atlassian-bamboo.log file (Must increase com.atlassian.bamboo.ww2.interceptors.BambooWorkflowInterceptor to DEBUG logging):

      2021-05-20 18:46:55,733 DEBUG [http-nio-8085-exec-9] [NavigationAwareInterceptor] Finding Navigation Objects for com.atlassian.bamboo.ww2.actions.build.admin.config.task.EditTask
      2021-05-20 18:46:55,870 DEBUG [http-nio-8085-exec-9] [BambooWorkflowInterceptor] 1 field errors found...
      2021-05-20 18:46:55,870 DEBUG [http-nio-8085-exec-9] [BambooWorkflowInterceptor] * private_key: [There is something wrong with your private key: java.io.IOException: unrecognised object: OPENSSH PRIVATE KEY]
      2021-05-20 18:46:55,870 DEBUG [http-nio-8085-exec-9] [BambooWorkflowInterceptor] 0 action errors found...
      

      Workaround

      • To upload the key in the SCP/SSH Task create an RSA key using the PEM format:
      ssh-keygen -m PEM -t rsa
      

            Assignee:
            Marcin Gardias
            Reporter:
            James Williams (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: