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

Git fails to fetch origin repository

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Not A Defect
    • Component/s: git-plugin
    • Labels:
      None
    • Similar Issues:

      Description

      Hello,

      When I try to do a build of my project, jenkins doesn't work and poses a problem to fetch my repo. I checked at the network level that there was no communication problem with my repo and I didn't see anything.

      An example of an error:

      15:49:17 Triggered by Gerrit: https://gerrit.domain.com/c/project/+/17965
      15:49:17 Running as SYSTEM
      15:49:18 [CustomTools] - Yarn: Starting installation
      15:49:18 [CustomTools] - Yarn: Tool is installed at /var/lib/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/Yarn/yarn-v1.22.4
      15:49:18 [CustomTools] - Yarn: Setting Yarn_HOME=/var/lib/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/Yarn/yarn-v1.22.4
      15:49:18 Building on master in workspace /var/lib/jenkins/workspace/project-gerrit_master
      15:49:18 using credential jenkins-user-ssh-private-key
      15:49:18 Warning: JENKINS-30600: special launcher com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper$2@19b1396a; decorates hudson.Launcher$LocalLauncher@4e1c05d8 will be ignored (a typical symptom is the Git executable not being run inside a designated container)
      15:49:18  > git rev-parse --is-inside-work-tree # timeout=10
      15:49:18 Fetching changes from the remote Git repository
      15:49:18  > git config remote.origin.url ssh://jenkins@gerrit.domain.com:29418/project # timeout=10
      15:49:18 Cleaning workspace
      15:49:18  > git rev-parse --verify HEAD # timeout=10
      15:49:18 Resetting working tree
      15:49:18  > git reset --hard # timeout=10
      15:49:19  > git clean -fdx # timeout=10
      15:49:19 Fetching upstream changes from ssh://jenkins@gerrit.domain.com:29418/project
      15:49:19  > git --version # timeout=10
      15:49:19 using GIT_SSH to set credentials The Jenkins user ssh private key
      15:49:19  > git fetch --tags --progress -- ssh://jenkins@gerrit.domain.com:29418/project refs/changes/65/17965/3 # timeout=10
      15:59:19 ERROR: Timeout after 10 minutes
      15:59:24 ERROR: Error fetching remote repo 'origin'
      15:59:24 hudson.plugins.git.GitException: Failed to fetch from ssh://jenkins@gerrit.domain.com:29418/project
      15:59:24 	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:909)
      15:59:24 	at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1131)
      15:59:24 	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1167)
      15:59:24 	at hudson.scm.SCM.checkout(SCM.java:505)
      15:59:24 	at hudson.model.AbstractProject.checkout(AbstractProject.java:1206)
      15:59:24 	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
      15:59:24 	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      15:59:24 	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
      15:59:24 	at hudson.model.Run.execute(Run.java:1856)
      15:59:24 	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
      15:59:24 	at hudson.model.ResourceController.execute(ResourceController.java:97)
      15:59:24 	at hudson.model.Executor.run(Executor.java:428)
      15:59:24 Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress -- ssh://jenkins@gerrit.domain.com:29418/project refs/changes/65/17965/3" returned status code 143:
      15:59:24 stdout: 
      15:59:24 stderr: 
      15:59:24 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2430)
      15:59:24 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2044)
      15:59:24 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:81)
      15:59:24 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:569)
      15:59:24 	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:907)
      15:59:24 	... 11 more
      15:59:24 ERROR: Error fetching remote repo 'origin'
      15:59:24 Retrying after 10 seconds
      

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment - - edited

          That message usually means that the private key you provided as the Jenkins credential named "The Jenkins user ssh private key" is not being accepted by the git repository at ssh://jenkins@gerrit.domain.com:29418/project. Command line git invokes ssh using the ssh private key from that credential. If ssh authentication does not succeed, then ssh defaults to prompting the user to enter username and password. After 10 minutes, that prompting times out.

          It is rare that these types of issues are bugs. They are most often configuration errors because a public key was not registered on the remote repository server or because a private key type (ED25519, or others) is not supported by the remote repository server (some older CentOS machines did not support the same ssh authentication schemes as newer operating systems), or because the key is passphrase protected and the wrong passphrase was provided, or because the git version being used on the agent is so old that it is not supported by the Jenkins git plugin (for example, CentOS 6 defaults to deliver CLI git 1.7 and that is too old for official support by the Jenkins git plugin).

          Please use the mailing lists and the chat system for this type of configuration question. That allows many more people to assist with the issue instead of the very few people who monitor the plugin bug reports. If a discussion on the mailing list or in the chat systems decides that it is a bug, you can reopen this bug report or create a new bug report.

          Show
          markewaite Mark Waite added a comment - - edited That message usually means that the private key you provided as the Jenkins credential named "The Jenkins user ssh private key" is not being accepted by the git repository at ssh://jenkins@gerrit.domain.com:29418/project . Command line git invokes ssh using the ssh private key from that credential. If ssh authentication does not succeed, then ssh defaults to prompting the user to enter username and password. After 10 minutes, that prompting times out. It is rare that these types of issues are bugs. They are most often configuration errors because a public key was not registered on the remote repository server or because a private key type (ED25519, or others) is not supported by the remote repository server (some older CentOS machines did not support the same ssh authentication schemes as newer operating systems), or because the key is passphrase protected and the wrong passphrase was provided, or because the git version being used on the agent is so old that it is not supported by the Jenkins git plugin (for example, CentOS 6 defaults to deliver CLI git 1.7 and that is too old for official support by the Jenkins git plugin). Please use the mailing lists and the chat system for this type of configuration question. That allows many more people to assist with the issue instead of the very few people who monitor the plugin bug reports. If a discussion on the mailing list or in the chat systems decides that it is a bug, you can reopen this bug report or create a new bug report.

            People

            • Assignee:
              Unassigned
              Reporter:
              florianb Florian Bellencontre
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: