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

Windows agent instructions in UI adds superfluous space in secret file

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None
    • Windows Server Core 2019
    • 2.481

      Jenkins Agent instructions in UI tells user to run:

      echo XXXXXXXX > secret-file

      (where XXXXXXXX is a secret)

      This is fine under Linux, but a little bit wrong under Windows. The space between last character of a secret and > sign is actually added into secret-file. Thus agent authentication doesn't work if one tries to use that secret file.

      For it to work under Windows the command should be:

      echo XXXXXXXX> secret-file

          [JENKINS-72979] Windows agent instructions in UI adds superfluous space in secret file

          Would you mind filing a pull request to address your issue found, please?

          Alexander Brandes added a comment - Would you mind filing a pull request to address your issue found, please?

          Vilius added a comment -

          At first I thought I do so, but the code looked a little bit more complicated to me than just "change one string". Since I do not have local development Jenkins environment for testing I thought I would leave this to others, who can fix and test it more quickly.

          Vilius added a comment - At first I thought I do so, but the code looked a little bit more complicated to me than just "change one string". Since I do not have local development Jenkins environment for testing I thought I would leave this to others, who can fix and test it more quickly.

          Debayan added a comment -

          I created a PR to address this issue.

          Debayan added a comment - I created a PR to address this issue.

          Mark Waite added a comment -

          I tested with my Windows 11 computer, and the instructions work whether the space character is included or not. The output file does include the trailing space, but my agent connects whether that trailing space is in the file or not. https://ss64.com/nt/echo.html says that removing the space characters is necessary to avoid extra spaces, supporting the description of the issue.

          Mark Waite added a comment - I tested with my Windows 11 computer, and the instructions work whether the space character is included or not. The output file does include the trailing space, but my agent connects whether that trailing space is in the file or not. https://ss64.com/nt/echo.html says that removing the space characters is necessary to avoid extra spaces, supporting the description of the issue.

            Unassigned Unassigned
            vilius Vilius
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: