Hudson + Git Clone Error

We had Hudson with Git + OpenSSH on Windows Server 2003 Enterprise, and it worked fine for a while. Then, all of a sudden, he started to hang at the time of cloning by 12% always, we suspected that the files might have become too large. (It still works on all other machines, Windows Server 2003, Windows 7 Enterprise), only one server.

So, we switched to Putty instead of OpenSSH, and it worked with gitBash and gitExtensions, but it still fails with Hudson. Since I read that there are some problems regarding loading the ssh key for plink correctly, I set GIT_SSH to a script that will put putty with the key and works fine with gitBASH, but it still does not work with Hudson.

Here is the result of the failure using PUTTY:

Started by user anonymous Checkout:workspace / <http://WINDOWS2003SERVER:8080/job/PROJECT/ws/> - hudson.remoting.LocalChannel@1c57a92 Using strategy: Default Last Built Revision: Revision 2a56d9738e7c0af810e70e2e2051c41bd44f4252 (origin/master) Checkout:workspace / <http://WINDOWS2003SERVER:8080/job/PROJECT/ws/> - hudson.remoting.LocalChannel@1c57a92 GitAPI created Cloning the remote Git repository Cloning repository origin $ C:\bin\Git\bin\git clone -o origin git@GITSERVER :project.git <http://WINDOWS2003SERVER:8080/job/PROJECT/ws/> ERROR: Error cloning remote repo 'origin' : Could not clone git@GITSERVER :project.git ERROR: Cause: Error performing C:\bin\Git\bin\git clone -o origin git@GITSERVER :project.git <http://WINDOWS2003SERVER:8080/job/PROJECT/ws/> Command returned status code 128: Cloning into <http://WINDOWS2003SERVER:8080/job/PROJECT/ws/...> fatal: The remote end hung up unexpectedly Trying next repository ERROR: Could not clone repository FATAL: Could not clone hudson.plugins.git.GitException: Could not clone at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:809) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:740) at hudson.FilePath.act(FilePath.java:756) at hudson.FilePath.act(FilePath.java:738) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:740) at hudson.model.AbstractProject.checkout(AbstractProject.java:1171) at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:480) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:412) at hudson.model.Run.run(Run.java:1362) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:145) 

We do not strictly adhere to our SSH protocol as long as it works. If someone can tell me why with openSSH it fails, or why Hudson fails with putty and any solutions, I would really appreciate it !!

+4
source share
4 answers

I could never understand why openSSH did not work, but I finally got everything that works with PuTTY.

My solution was this: I created a batch file called myplink.bat that would perform a putty with a private key and would not require it to run. Inside this file was the following:

 @echo off c:\pathto\plink.exe -ic:\pathto\id_rsa.pub 

Opening a gitbash prompt and changing GIT_SSH to this path will work only for this instance, so that it is permanently installed for gitbash I, modified by c: \ pathto \ git \ etc \ profile and added at the end:

 export GIT_SSH=c:\pathto\myplink.bat 

I also changed c: \ pathto \ git \ cmd \ git.cmd and added:

 @set GIT_SSH=c:\pathto\myplink.bat 

This fixed git bash, but hudson will fail anyway, leaving me to believe that the hudson environment is changing for git somehow. Then in hudson, I went to manage the settings of hudson -> configure -> environment. I made sure it was checked and added: name: GIT_SSH Value: c: \ pathto \ myplink.bat

I restarted the hudson service and it finally worked.

Please note that if you have spaces on any of your paths, this can also ruin the material, so try to keep your paths clear.

Hope this helps others who have problems with hudson + git + putty.

+1
source

You do not have a public key on the git server. Do this from the hudson server at login as "git".

 ssh -v gitserver 

Learn the way out. You should not ask for a password.

If you do this or have other problems, you do not have ssh settings.

hope this helps

0
source

You need to check the following:

  • You are using the ssh keys of the user who started the hudson daemon. For example, if user = hudson, then you should log in as hudson and generate ssh keys
  • You uploaded your public key to your server (github, assembly) from the correct .ssh / id_rsa.pub file, i.e. for the same user who launched hudson daemon
  • You have added the RSA fingerprint of your server to the .ssh / known_hosts file.
0
source

I have the same problem as on a Linux server (Ubuntu). This link (http://adhockery.blogspot.com/2009/11/ git -and-hudson.html) fixed my problem.

The text below is copied from a link.

It turns out that Git requires a username to be installed, and the hudson user who creates the Debian package when installing Hudson does not have it. Easily fixed using sudo nano / etc / passwd to add Hudson ,, to your hudson user entry (if you look at your entry you should see where it needs to go).

0
source

Source: https://habr.com/ru/post/1336014/


All Articles