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

Failed to connect to repository : Command "C:\Program Files\Git\cmd\git.exe ls-remote -h — my Repository URL HEAD"

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When I I copy my Private project link to Jenkins, I get some error like this:

      Failed to connect to repository : Command "C:\Program Files\Git\cmd\git.exe ls-remote -h -- https://github.sydney.edu.au/SOFT2412-2019S2/WBYWJD_WYWJD_Team15.git HEAD" returned status code 128:
      stdout:
      stderr: Logon failed, use ctrl+c to cancel basic credential prompt.
      error: cannot spawn C:\WINDOWS\TEMP\pass6522988368209337473.bat: No error
      fatal: could not read Username for 'https://github.sydney.edu.au': terminal prompts disabled

      And when I try to build something there, the log of Confirmation failure is like that.

      Started by GitHub push by zzho0631
      Running as SYSTEM
      Building in workspace C:\Program Files (x86)\Jenkins\workspace\Team15
      using credential ec3b9de9-638a-472d-a137-668b7c1744f8
      Cloning the remote Git repository
      Cloning repository https://github.sydney.edu.au/SOFT2412-2019S2/WBYWJD_WYWJD_Team15.git
       > git.exe init C:\Program Files (x86)\Jenkins\workspace\Team15 # timeout=10
      Fetching upstream changes from https://github.sydney.edu.au/SOFT2412-2019S2/WBYWJD_WYWJD_Team15.git
       > git.exe --version # timeout=10
      using GIT_ASKPASS to set credentials 
       > git.exe fetch --tags --force --progress -- https://github.sydney.edu.au/SOFT2412-2019S2/WBYWJD_WYWJD_Team15.git +refs/heads/*:refs/remotes/origin/*
      ERROR: Error cloning remote repo 'origin'
      hudson.plugins.git.GitException: Command "git.exe fetch --tags --force --progress -- https://github.sydney.edu.au/SOFT2412-2019S2/WBYWJD_WYWJD_Team15.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
      stdout: 
      stderr: Logon failed, use ctrl+c to cancel basic credential prompt.
      error: cannot spawn C:\WINDOWS\TEMP\pass2346010482442283795.bat: No error
      fatal: could not read Username for 'https://github.sydney.edu.au': terminal prompts disabled
      
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2172)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1864)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:78)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:545)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:758)
          at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1152)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1192)
          at hudson.scm.SCM.checkout(SCM.java:504)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1206)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
          at hudson.model.Run.execute(Run.java:1815)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)
      ERROR: Error cloning remote repo 'origin'
      Finished: FAILURE
      

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          Philip O'Gorman Please don't create a new issue until you've explored the question on the Jenkins users mailing list or on the chat channel. The stack trace that you've provided is a strong indication that the problem is specific to your environment. Environment specific questions are best handled in the mailing list or in the chat channels where many more people are watching and many more people are helping.

          A bug report only gets the attention of the plugin maintainer. A discussion on the mailing list or in one of the chat channels allows many people that are not maintainers to assist with the question.

          For example, in your case, it could be as simple as your repository having grown so large that it needs a longer timeout to complete the clone. It could also be that the workspace has existed for a long enough time with enough incremental updates that it needs a garbage collection from git gc.

          Show
          markewaite Mark Waite added a comment - Philip O'Gorman Please don't create a new issue until you've explored the question on the Jenkins users mailing list or on the chat channel. The stack trace that you've provided is a strong indication that the problem is specific to your environment. Environment specific questions are best handled in the mailing list or in the chat channels where many more people are watching and many more people are helping. A bug report only gets the attention of the plugin maintainer. A discussion on the mailing list or in one of the chat channels allows many people that are not maintainers to assist with the question. For example, in your case, it could be as simple as your repository having grown so large that it needs a longer timeout to complete the clone. It could also be that the workspace has existed for a long enough time with enough incremental updates that it needs a garbage collection from git gc .
          Hide
          pogorman Philip O'Gorman added a comment -

          Thanks Mark - the work around for us is to use ssh instead of http. I'm not really sure whats happening, all of our builds are done from a clean workspace, requiring a full clone. I can clone on the machine using http when I login as the jenkins user. This issue just came up when I updated the latest jenkins and git-client late last week (2.190.12.8.6).  Either way using ssh has fixed the issue

          Show
          pogorman Philip O'Gorman added a comment - Thanks Mark - the work around for us is to use ssh instead of http. I'm not really sure whats happening, all of our builds are done from a clean workspace, requiring a full clone. I can clone on the machine using http when I login as the jenkins user. This issue just came up when I updated the latest jenkins and git-client late last week ( 2.190.1 &  2.8.6 ).  Either way using ssh has fixed the issue
          Hide
          markewaite Mark Waite added a comment -

          You may want to check the http logs on the git server to see if there is some indication why it is killing the connection from the Jenkins client that is trying to populate the workspace.

          Show
          markewaite Mark Waite added a comment - You may want to check the http logs on the git server to see if there is some indication why it is killing the connection from the Jenkins client that is trying to populate the workspace.
          Hide
          amanga amanga added a comment -

          Hi, i am getting the same issue and i could not solve it, please help:

          1. I am running jenkins from windows Server2012R2 and trying to add a git project and when i type the repository URL, i see the same error as below:  
          2. Failed to connect to repository:Error performing git command: Is -remote -h  – https:myrepo      stdout:   stderr: fatal: Cannot prompt because user interactively has been disabled. fatal:Authentication failed for https:myrepo
          Show
          amanga amanga added a comment - Hi, i am getting the same issue and i could not solve it, please help: I am running jenkins from windows Server2012R2 and trying to add a git project and when i type the repository URL, i see the same error as below:   Failed to connect to repository:Error performing git command: Is -remote -h  – https:myrepo      stdout:   stderr: fatal: Cannot prompt because user interactively has been disabled. fatal:Authentication failed for https:myrepo
          Hide
          markewaite Mark Waite added a comment -

          amanga please don't use Jenkins issues to request help with a configuration problem. Very few people read Jenkins issue reports for the git plugin. Many, many more people are available to assist in the Jenkins user mailing list and in the Jenkins chat channels.

          When we share the load with many people, more work is accomplished.

          Show
          markewaite Mark Waite added a comment - amanga please don't use Jenkins issues to request help with a configuration problem. Very few people read Jenkins issue reports for the git plugin. Many, many more people are available to assist in the Jenkins user mailing list and in the Jenkins chat channels. When we share the load with many people, more work is accomplished.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            soft2412 An Yan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: