not able to connect to the GIT Repository through Git plugin in Jenkins

0 votes

I am trying to pull the code form GIT using GIT Plugin Jenkins and the job is running on a slave machine. is assigned to master node.

There is no http_proxy defined for slave node.I  have done git clone locally on the slave node and it worked fine but I am unable to clone git through Jenkins.

It's displaying following error:

Building remotely on SLAVE in workspace /data/test
 > /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > /usr/bin/git config remote.origin.url # timeout=10
Fetching upstream changes from
 > /usr/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials 
Setting http proxy:
 > /usr/bin/git fetch --tags --progress +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from
    at hudson.plugins.git.GitSCM.fetchFrom(
    at hudson.plugins.git.GitSCM.retrieveChanges(
    at hudson.plugins.git.GitSCM.checkout(
    at hudson.scm.SCM.checkout(
    at hudson.model.AbstractProject.checkout(
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(
    at jenkins.scm.SCMCheckoutStrategy.checkout(
    at hudson.model.AbstractBuild$
    at hudson.model.Run.execute(
    at hudson.model.ResourceController.execute(
Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --progress +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stderr: error: Failed connect to; Operation now in progress while accessing

Can anyone solve this query?


May 1, 2018 in DevOps Tools by Atul
• 10,240 points

3 answers to this question.

0 votes

Turned out it was a proxy issue.

While pulling the code from GIT using Jenkins it was setting the http_proxy to  and this proxy was not required in the slave node.

So, I have added GIT URL to No Proxy Host section in Jenkins and now it is working fine.

Hope it will help you resolve your query.

answered May 1, 2018 by shubham
• 6,890 points
0 votes
Before pulling the project, try to set the HTTP proxy in global configuration:

$> git config --global http.proxy

If you need to provide a username and a password for your proxy, you can use:

$> git config --global http.proxy\\<yourUsername>:<yourPassword>@<yourProxyServer>:80
answered Aug 2, 2018 by lina
• 8,110 points
0 votes

One of the possibility is that your Jenkins is not connected to git. To connect them follow these steps:

  • Create a new maven job
  • Check the radio button for git. Enter the uri of your git repository
  • Click on save and apply

answered Apr 22 by Ananya

I have done the exact same thing but I ended up with the following error:

Failed to connect to repository : Command "git ls-remote -h git@example.git HEAD" returned status code 128: stdout: stderr: fatal: 'git@example.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly

What do I do?

You might haven't configured your Jenkins right, use the following steps:

1. Go to to the terminal

2.Run this command : sudo visudo

3. Add %jenkins ALL=NOPASSWD: ALL in this file where sudo privilege is defined.and close the file.

4.login as Jenkins user via command : sudo su jenkins

5. Create a .ssh directory in the jenkins home directory.

Related Questions In DevOps Tools

+1 vote
1 answer

i have a pyhton code in my git/git repository how to build that code in jenkins

Follow these steps @Bhaskar: Step 1: Open the Jenkins ...READ MORE

answered Oct 14 in DevOps Tools by Kalgi
• 42,330 points
+4 votes
2 answers

Jenkins not showing Maven Release Plugin

Make your project type Maven Project. This ...READ MORE

answered Oct 11, 2018 in DevOps Tools by Hannah
• 16,300 points
0 votes
1 answer

how to fix the build with maven in bluemix

As per Bluemix Status Page today DevOps Delivery Pipeline ...READ MORE

answered Jul 6, 2018 in DevOps Tools by Kalgi
• 42,330 points
0 votes
1 answer

login popup not working in tomcat9 when I click the server status

Try and install tomcat 8.0.41. It is ...READ MORE

answered Jul 12, 2018 in DevOps Tools by DareDev
• 6,810 points
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
0 votes
1 answer
+4 votes
4 answers

perform Git checkout using Groovy script

To do git commit: def getGitCommit() { ...READ MORE

answered Dec 6, 2018 in DevOps Tools by Vaidya
0 votes
1 answer

Vagrant provision shell : can not run ssh-copy-id

I think I can help you with ...READ MORE

answered Jun 16, 2018 in DevOps Tools by shubham
• 6,890 points

edited Jun 16, 2018 by shubham 242 views