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

Credentialed Git fetch fails on Windows if workspace path contains a space

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.57
      git plugin 3.3.0
    • Similar Issues:

      Description

      Since last update to jenkins 2.57 with git-plugin 3.3.0, jobs are failing fetching git repositories when job name contains space. Trace is :

      Building remotely on Platform-BDXWEB037 (platform2) in workspace E:\Jenkins\workspace\Projet Platform Environment Deployment (ANY)
      > git.exe rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from the remote Git repository
      > git.exe config remote.origin.url http://git.intraxiti.com/deployment/PlatformPublisherV2.git # timeout=10
      Cleaning workspace
      > git.exe rev-parse --verify HEAD # timeout=10
      Resetting working tree
      > git.exe reset --hard # timeout=10
      > git.exe clean -fdx # timeout=10
      Fetching upstream changes from http://git.intraxiti.com/deployment/PlatformPublisherV2.git
      > git.exe --version # timeout=10
      using GIT_ASKPASS to set credentials Jenkins User for GitLab
      > git.exe fetch --tags --progress http://git.intraxiti.com/deployment/PlatformPublisherV2.git +refs/heads/:refs/remotes/origin/
      ERROR: Timeout after 10 minutes
      ERROR: Error fetching remote repo 'origin'
      hudson.plugins.git.GitException: Failed to fetch from http://git.intraxiti.com/deployment/PlatformPublisherV2.git
      at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:809)
      at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1076)
      at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1107)
      at hudson.scm.SCM.checkout(SCM.java:495)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1281)
      at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
      at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
      at hudson.model.Run.execute(Run.java:1735)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:405)
      Caused by: hudson.plugins.git.GitException: Command "git.exe fetch --tags --progress http://git.intraxiti.com/deployment/PlatformPublisherV2.git +refs/heads/:refs/remotes/origin/" returned status code -1:
      stdout:
      *stderr: 'E:\Jenkins\workspace\Projet' is not recognized as an internal or external command,
      operable program or batch file.*

      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1866)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1585)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:71)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:348)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
      at hudson.remoting.UserRequest.perform(UserRequest.java:121)
      at hudson.remoting.UserRequest.perform(UserRequest.java:49)
      at hudson.remoting.Request$2.run(Request.java:325)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at hudson.remoting.Engine$1$1.run(Engine.java:69)
      at java.lang.Thread.run(Unknown Source)
      at ......remote call to Channel to /172.18.1.9(Native Method)
      at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545)
      at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
      at hudson.remoting.Channel.call(Channel.java:830)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
      at sun.reflect.GeneratedMethodAccessor486.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
      at com.sun.proxy.$Proxy122.execute(Unknown Source)
      at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:807)
      ... 11 more
      ERROR: null

      Renaming the job is a workaround but implies to update all scripts and mechanisms linked to this job (script that trigger the job build for instance). This is really annoying.

        Attachments

          Issue Links

            Activity

            Hide
            paulofgp Paulo Pires added a comment -

            I'm really using username and password.

            I tested your snapshot build and it worked.

            Tks for your help.

            Show
            paulofgp Paulo Pires added a comment - I'm really using username and password. I tested your snapshot build and it worked. Tks for your help.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Mark Waite
            Path:
            src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
            http://jenkins-ci.org/commit/git-client-plugin/4f27a7010ea9d2aa8516edd44791561f99792d41
            Log:
            JENKINS-43931 Allow username/password workspaces with space in path

            Prior fix only handled ssh passphrase protected private keys

            Note that the issue is only visible on Windows and only with workspaces
            whose full path includes a space.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java http://jenkins-ci.org/commit/git-client-plugin/4f27a7010ea9d2aa8516edd44791561f99792d41 Log: JENKINS-43931 Allow username/password workspaces with space in path Prior fix only handled ssh passphrase protected private keys Note that the issue is only visible on Windows and only with workspaces whose full path includes a space.
            Hide
            hinton Ryan Hinton added a comment -

            Hi Mark, I just updated with your SNAPSHOT and it worked.  Thank you.

            Show
            hinton Ryan Hinton added a comment - Hi Mark, I just updated with your SNAPSHOT and it worked.  Thank you.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Mark Waite
            Path:
            src/test/java/org/jenkinsci/plugins/gitclient/CredentialsTest.java
            http://jenkins-ci.org/commit/git-client-plugin/5c74414a6ef50488e9006d83f127a69b6a7b8da0
            Log:
            Test special characters in credentials workspace path

            JENKINS-44041 - Windows authenticated git checkout fails if '(' or ')' in path to workspace
            JENKINS-43931 - Windows authenticated git checkout fails if ' ' in path to workspace
            JENKINS-44127 - Authenticated git checkout fails if '%' in path to workspace (Windows & Linux)

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: src/test/java/org/jenkinsci/plugins/gitclient/CredentialsTest.java http://jenkins-ci.org/commit/git-client-plugin/5c74414a6ef50488e9006d83f127a69b6a7b8da0 Log: Test special characters in credentials workspace path JENKINS-44041 - Windows authenticated git checkout fails if '(' or ')' in path to workspace JENKINS-43931 - Windows authenticated git checkout fails if ' ' in path to workspace JENKINS-44127 - Authenticated git checkout fails if '%' in path to workspace (Windows & Linux)
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Mark Waite
            Path:
            src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
            http://jenkins-ci.org/commit/git-client-plugin/8a2ddf222f4463e2458e387121bf8d4c7840c37a
            Log:
            Fix special characters bugs in credentials workspace path

            JENKINS-44041 - Windows authenticated git checkout fails if '(' or ')' in path to workspace
            JENKINS-43931 - Windows authenticated git checkout fails if ' ' in path to workspace
            JENKINS-44127 - Authenticated git checkout fails if '%' in path to workspace (Windows & Linux)

            Also safeguards against use for "`" (grave) in a workspace path.
            Jenkins already guards against that, but the added safety check is low
            cost and passes the credentials tests.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java http://jenkins-ci.org/commit/git-client-plugin/8a2ddf222f4463e2458e387121bf8d4c7840c37a Log: Fix special characters bugs in credentials workspace path JENKINS-44041 - Windows authenticated git checkout fails if '(' or ')' in path to workspace JENKINS-43931 - Windows authenticated git checkout fails if ' ' in path to workspace JENKINS-44127 - Authenticated git checkout fails if '%' in path to workspace (Windows & Linux) Also safeguards against use for "`" (grave) in a workspace path. Jenkins already guards against that, but the added safety check is low cost and passes the credentials tests.

              People

              • Assignee:
                markewaite Mark Waite
                Reporter:
                splashnenen Alexandre Aubert
              • Votes:
                1 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: