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

Can't clone git repository on windows agents if jenkins folder contains cyrillic symbols

    Details

    • Type: Bug
    • Status: In Progress (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Component/s: git-client-plugin
    • Labels:
      None
    • Environment:
      git client plugin 3.0.0
      git plugin 4.2.2
      jenkins 2.204.2
    • Similar Issues:

      Description

      It looks like we got problems after updating the plugins:
      git client plugin 2.8.6 -> 3.0.0
      git plugin 3.12.1 -> 4.2.2
       
      When starting the freestyle job on the Windows agent it is not possible to clone the git repository (doesn't matter ssh or https) if the folder name in Jenkins is written in Cyrillic.
       
      ERROR: Error cloning remote repo 'origin'
      hudson.plugins.git.GitException: Command "git fetch --tags --progress – https://repo_url/repo.git +refs/heads/:refs/remotes/origin/" returned status code 128:
      stdout:
      stderr: The system cannot find the path specified.
      The system cannot find the path specified.
      error: unable to read askpass response from 'D:\jenkins_slave\workspace\Тест\windows_https_clone@tmp\jenkins-gitclient-pass0123456789123456789.bat'
      fatal: could not read Password for 'https://repo_url/repo.git': terminal prompts disabled
       
      With English folder names everything goes fine.
       
      On Linux agents, there are no problems with cloning repositories using Cyrillic names
       
      Java arguments on windows and linux agents are same: 'Dfile.encoding = "UTF-8" -Dsun.jnu.encoding = "UTF-8"'

        Attachments

          Issue Links

            Activity

            Hide
            markewaite Mark Waite added a comment -

            Thanks for the report. I can see the same behavior when I create a Freestyle or a Pipeline job based on a test branch named "JENKINS-62579-Владислав-Ненашев".

            The likely cause of the problem is the choice made in git client plugin 3.x to prefer placing temporary directories adjacent to the workspace directory instead of using the system temporary directory. There is logic in the createTempFile method that guards against specific other characters in temporary directory names. It could be extended to use the system temporary directory on windows when it detects a character outside the single byte character range. Might be something like this stackoverflow answer.

            Does the Windows system temporary directory include Cyrillic characters in its path?

            Show
            markewaite Mark Waite added a comment - Thanks for the report. I can see the same behavior when I create a Freestyle or a Pipeline job based on a test branch named "JENKINS-62579-Владислав-Ненашев" . The likely cause of the problem is the choice made in git client plugin 3.x to prefer placing temporary directories adjacent to the workspace directory instead of using the system temporary directory. There is logic in the createTempFile method that guards against specific other characters in temporary directory names. It could be extended to use the system temporary directory on windows when it detects a character outside the single byte character range. Might be something like this stackoverflow answer . Does the Windows system temporary directory include Cyrillic characters in its path?
            Hide
            markewaite Mark Waite added a comment -

            Draft pull request proposes to use the system temporary directory on Windows if any character in the path is not a valid ISO 8859-1 character.

            The changes is more aggressive than purely Cyrillic characters because it seems likely that other characters will have the same issue.

            Show
            markewaite Mark Waite added a comment - Draft pull request proposes to use the system temporary directory on Windows if any character in the path is not a valid ISO 8859-1 character. The changes is more aggressive than purely Cyrillic characters because it seems likely that other characters will have the same issue.
            Hide
            markewaite Mark Waite added a comment -

            Владислав Ненашев if you could check the pull request build interactively in your environment, that would be a very helpful test. I don't know when I'll have time to complete the automated test creation, but an interactive test would certainly be helpful.

            Show
            markewaite Mark Waite added a comment - Владислав Ненашев if you could check the pull request build interactively in your environment, that would be a very helpful test. I don't know when I'll have time to complete the automated test creation, but an interactive test would certainly be helpful.

              People

              • Assignee:
                Unassigned
                Reporter:
                vnenashev Владислав Ненашев
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: