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

Git client plugin doesn't quote file locations in askpass wrappers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • git-client-plugin
    • None
    • git-client-plugin 3.0.0
    • git-client-3.1.0

      We have a project which uses blank spaces and other characters for its name.

      This name is used to create a temporary folder for files containing username and password consumed by a script generated by CliGitAPIImpl class. Because these names of these files are not quoted in the generated shell script, a script has a syntax errors and we run into following problem:

      using GIT_ASKPASS to set credentials token to authenticate with github for XXX
       > git fetch --no-tags --force --progress -- https://github.com/corda/XXX.git +refs/heads/master:refs/remotes/origin/master # timeout=10
      ERROR: Error fetching remote repo 'origin'
      hudson.plugins.git.GitException: Failed to fetch from https://github.com/corda/XXX.git
      	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:899)
      	at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1114)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1145)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:124)
      	at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.lambda$doRetrieve$1(SCMSourceRetriever.java:154)
      	at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrySCMOperation(SCMSourceRetriever.java:104)
      	at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.doRetrieve(SCMSourceRetriever.java:153)
      	at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:93)
      	at org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:157)
      	at org.jenkinsci.plugins.workflow.libs.LibraryAdder.add(LibraryAdder.java:138)
      	at org.jenkinsci.plugins.workflow.libs.LibraryDecorator$1.call(LibraryDecorator.java:125)
      	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065)
      	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
      	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
      	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
      	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
      	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
      	at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
      	at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
      	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:142)
      	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
      	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:561)
      	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:522)
      	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:327)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:429)
      Caused by: hudson.plugins.git.GitException: Command "git fetch --no-tags --force --progress -- https://github.com/corda/XXX.git +refs/heads/master:refs/remotes/origin/master" returned status code 128:
      stdout: 
      stderr: /var/jenkins_home/jobs/XXX's Test Job (Allure testing)/jobs/XXX/branches/PR-2859/workspace@libs/existing-build-control@tmp/jenkins-gitclient-pass679764427837957513.sh: line 3: syntax error: unexpected "(" (expecting ";;")
      error: unable to read askpass response from '/var/jenkins_home/jobs/XXX's Test Job (Allure testing)/jobs/XXX/branches/PR-2859/workspace@libs/existing-build-control@tmp/jenkins-gitclient-pass679764427837957513.sh'
      

      A workaround is either to change the project name or to fix the name of the workspace, so it is not a critical problem as such.

      Waldemar

            Unassigned Unassigned
            waldemarzurowski Waldemar Zurowski
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: