Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (29.3k points)

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

The MASTER system has http_proxy=mycom.domain.com:80

and in the SLAVE system, there is no http_proxy defined.

Whenever I am doing git clone locally in the SLAVE machine it works perfectly, however from Jenkins I haven't been successful.

It is throwing the 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 https://github.domain.com/Project-Digital/Project-eCommerce.git # timeout=10

Fetching upstream changes from https://github.domain.com/Project-Digital/Project-eCommerce.git

 > /usr/bin/git --version # timeout=10

using GIT_ASKPASS to set credentials 

Setting http proxy: mycom.domain.com:80

 > /usr/bin/git fetch --tags --progress https://github.domain.com/Project-Digital/Project-eCommerce.git +refs/heads/*:refs/remotes/origin/*

ERROR: Error fetching remote repo 'origin'

hudson.plugins.git.GitException: Failed to fetch from https://github.domain.com/Project-Digital/Project-eCommerce.git

    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:803)

    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1063)

    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1094)

    at hudson.scm.SCM.checkout(SCM.java:495)

    at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)

    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)

    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)

    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)

    at hudson.model.Run.execute(Run.java:1728)

    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)

    at hudson.model.ResourceController.execute(ResourceController.java:98)

    at hudson.model.Executor.run(Executor.java:404)

Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --progress https://github.domain.com/Project-Digital/Project-eCommerce.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:

stdout: 

stderr: error: Failed connect to github.build.ge.com:80; Operation now in progress while accessing https://github.domain.com/Project-Digital/Project-eCommerce.git/info/refs

Is it because the MASTER system trying to set HTTP proxy which is not present in the SLAVE system?

If yes, how to prevent it?

Or, is there something else I am missing?

1 Answer

0 votes
by (50.2k points)

This type of error occurs due to the issue with proxy this can be resolved by adding

Git URL to the No Proxy Host section this can be achieved by following these steps

Manage Jenkins -> Manage Plugins -> Advanced -> HTTP Proxy Configuration -> Added GIT URL in No Proxy Host field.

we need to do this because while pulling the code from git. Using Jenkins it was set by a proxy so to remove this we will add git url to no host proxy.

Try after adding this it will work fine.

Browse Categories

...