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

Controller path altered in mixed OS environment

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None

      We have an issue when running pipelines in a mixed environment with a Linux controller and Windows agents.
      When using a pipeline job that uses either the node or label parameters, if the node defined by the param value is a windows node then the pipeline checkout stage fails.

      Checking out git https://xxxxxxxxx.git into /xxx/xxxx/workspace@script to read resources/pipelines/playground/git-clone.groovy
      The recommended git tool is: /usr/bin/git
      using credential xxxxxxxxx
       > /usr/bin/git rev-parse --resolve-git-dir /xxx/xxxx/workspace@script/.git # timeout=10
      Fetching changes from the remote Git repository
       > /usr/bin/git config remote.origin.url https://xxxxxxxx.git # timeout=10
      Fetching upstream changes from https://xxxxxxxxxx.git
       > /usr/bin/git --version # timeout=10
       > git --version # 'git version 2.24.4'
      using GIT_ASKPASS to set credentials Bitbucket Server (xxxxxxx)
       > /usr/bin/git fetch --tags --force --progress -- https://xxxxxxxx.git +refs/heads/*:refs/remotes/origin/* # timeout=10
      ERROR: Error fetching remote repo 'origin'
      hudson.plugins.git.GitException: Failed to fetch from https://xxxxxxxxxx.git
      	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:1001)
      	at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1242)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1302)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129)
      	at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:154)
      	at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:68)
      	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:311)
      	at hudson.model.ResourceController.execute(ResourceController.java:101)
      	at hudson.model.Executor.run(Executor.java:442)
      Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --force --progress -- https://xxxxxxxxxxx.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
      stdout: 
      stderr: /xxx/xxxx/workspace@script@tmp/jenkins-gitclient-pass14582565555892846354.sh: line 3: cat: command not found
      error: unable to read askpass response from '/xxx/xxxx/workspace@script@tmp/jenkins-gitclient-pass14582565555892846354.sh'
      fatal: could not read Username for 'https://xxxxxxx.com': terminal prompts disabled
      
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2671)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2096)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:618)
      	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:999)
      	... 8 more
      

      The path of the controller is perfectly fine and any pipeline that doesn't use the node or label parameter types is correctly checked out from the same scm system with the same credentials.

      It appears that the path on the controller is being overwritten by the path of the node resolved by the param.
      When we change the label param to a simple string param and resolve the nodes explicitly in the pipeline everything works correctly.

      Its not clear is this is an issue in the node and label parameter plugin or the gitscm plugin or a combination of both.

            Unassigned Unassigned
            ffsetit Pete Barnes
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: