Jenkins with Git: Status code 128

10,451

Solution 1

The problem was the corporate proxy. When I remove the proxy in "Manage Jenkins -> Manage Plugins -> Advanced Settings" Jenkins can successfully clone the Git repository. Although when I do this I cannot download plugins anymore. But that's another story.

Solution 2

This error comes (Error code 128) when there is an update in the Git version.

And also, Node server SSH key path will be invalid, by default it will be referencing to some other location SSH key location.

What you need to do is:

  1. You have to mention the correct path of the SSH key in the Environment variables of master template.

  2. Go to the Master template/server.

  3. Open the Environment Variables window after taking the admin rights.

  4. In The environment variables windows for "USERID":

  • Add the new variable key = HOME, value = Path of the SSH key where it has to reference in the Sub node (ex: C:\Users\"your userid").

Issue will be resolved.

Share:
10,451
FarwoodHill
Author by

FarwoodHill

Updated on December 05, 2022

Comments

  • FarwoodHill
    FarwoodHill over 1 year

    I installed Jenkins on Windows 7 and I installed the Git plug-in. When I create a new project and enter the Git Repository URL I get the following error displayed in red on the configuration page:

    Failed to connect to repository : Command "C:\Program Files\Git\bin\git.exe ls-remote -h http://path-to-repository/repository.git HEAD" returned status code 128: stdout: stderr: fatal: unable to access 'http://path-to-repository/repository.git/': The requested URL returned error: 503

    The same command works both on the Git bash and the Windows console on the same computer. The jenkins.err.log shows nothing useful. What could be the problem or what tools can I use to track it down?

    • Tim Biegeleisen
      Tim Biegeleisen about 6 years
      You should make sure that Jenkins has permissions to read all the credential/config Git files which it needs to talk to the remote. I have seen a similar problem to this, and files access rights were the issue.
    • FarwoodHill
      FarwoodHill about 6 years
      Thanks for your suggestion. Jenkins is running as a Windows service as local system. I tried a differnent user for the service (a local administrator) and verified the checkboxes for access privileges are correct. Still getting the same error.
    • Tim Biegeleisen
      Tim Biegeleisen about 6 years
      Did you configure your Jenkins to use the Git credential store, or is it using a hard coded username/password? What I'm saying is, if you're using a credential file, make sure that Jenkins can in fact read it. This is the only explanation which comes to mind for why your local Git works but the same local Jenkins cannot use it.
    • FarwoodHill
      FarwoodHill about 6 years
      I use Jenkins Credentials Provides with Global Access Data (these are the only selection I have). Kind is user and password.
  • sadati boina
    sadati boina over 2 years
    Thanks for the solution. Did you know how to get the both (corporate proxy and git )