Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-59737

sshUserPrivateKey's "KeyFileVariable" is missing drive letter on windows

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Environment:
    • Similar Issues:

      Description

      I am seeing a bug when using 

      withCredentials([sshUserPrivateKey(credentialsId: 'myCred', keyFileVariable: 'privateSshKey')]){}

       

      Documentation for keyFileVariable states that it is "an environment variable to be set to the temporary path of the SSH key file".

       

      The problem is that the value of the variable is a nearly, but not quite, absolute path.  On Windows specifically, it is missing the drive letter and colon.  This causes it to fail with commands such as "ssh -i ${privateSshKey} myUrl".

       

      Example:  If the actual path is

      `C:\home\jenkins\agent\workspace\myjob@abc\def\ghi-privateSshKey`,

      then the environment variable is incorrectly set to

      `/home/jenkins/agent/workspace/myjob@abc/def/ghi-privateSshKey`

       

      This was very difficult to debug because the plugin masks/censors all output containing the path.  There should be a way to opt out of the masking of logs.

       

       

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              cowlinator p cowlinator
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: