Home » Archived » Hudson » Poll git via gitolite works, clone and fetch fail(Error cloning remote repo 'origin' although repository polling triggers builds)
|
Re: Poll git via gitolite works, clone and fetch fail [message #1077570 is a reply to message #1075822] |
Thu, 01 August 2013 22:25 |
Bruce AtEconz Messages: 6 Registered: July 2013 |
Junior Member |
|
|
Fetch seems to work fine. After setting the hudson logs to a level of FINE:
Aug 2, 2013 10:06:41 AM hudson.Proc
FINE: Running: git rev-parse origin/master
Aug 2, 2013 10:06:41 AM hudson.Proc
FINE: Running: git tag -l master
Aug 2, 2013 10:06:41 AM hudson.Proc
FINE: Running: git fetch -t ssh://git@reposerver/myrepo +refs/heads/*:refs/remotes/origin/*
Aug 2, 2013 10:06:41 AM hudson.model.AbstractProject
FINE: Polling SCM changes of myrepo
Aug 2, 2013 10:06:41 AM hudson.slaves.WorkspaceList
FINE: SCM polling for FreeStyleProject[myrepo] acquired /var/lib/hudson/jobs/myrepo/workspace
Aug 2, 2013 10:06:41 AM hudson.triggers.SCMTrigger
FINE: scheduling the trigger to (asynchronously) run
Aug 2, 2013 10:06:41 AM hudson.triggers.SCMTrigger
FINE: Scheduling a polling for FreeStyleProject[myrepo]
Aug 2, 2013 10:06:41 AM hudson.triggers.Trigger
CONFIG: cron triggered myrepo
Aug 2, 2013 10:06:41 AM hudson.triggers.Trigger
FINE: cron checking myrepo
Aug 2, 2013 10:06:41 AM hudson.triggers.Trigger
FINE: cron checking Aug 2, 2013 10:06:17 AM
|
|
| | | |
Re: Poll git via gitolite works, clone and fetch fail [message #1080600 is a reply to message #1080325] |
Tue, 06 August 2013 06:35 |
Bruce AtEconz Messages: 6 Registered: July 2013 |
Junior Member |
|
|
Hi Winston,
Thanks for your reply. I agree it does look some sort of authentication problem.
I read the page you linked to. This describes how to set up gitolite on the server, but that is already working find for us, and has been for a long time. I don't have any control of the box running gitolite (reposerver) but I showed your comment to the system administrator responsible for reposerver, and he believes it is set up the same as described in the gitolite page.
The page doesn't say anything about configuring hudson as a client to gitolite, except to use ssh-keygen to generate an RSA key pair. I already have the key and know that it works. I have also tried running a terminal as the hudson user ( su - hudson -s /bin/bash ) and using the same public/private key pair. I can clone or fetch from reposerver, so the keys themselves are ok.
Your quote, "I have never setup SSH auth like how you set up. I always use public/private key as explained here.." I am using a public/private key as described on the page. ssh-agent is just the means by which the key pair is made available to hudson. On most linuxes, within a user terminal, ssh-agent Just Works(tm) so most users are not aware of it. The only reason I had to mess around with it was because hudson is running as daemon as opposed to a user session.
I can't actually see any difference between the setup I described above and the page you linked to, with regard to being a client of gitolite and ssh. Are there some specific differences you're seeing that I've missed?
If you have used public/private key authentication with hudson before, how do you normally set it up? Perhaps there is some built-in hudson support, or a simpler environmental setup for this I'm not aware of.
One other interesting thing I noticed in hudson's behaviour is that it appears to be running two builds for every checkin. ANd the log output from each one is different. The first one produces the following output:
Polling log:
Started on Aug 6, 2013 3:22:41 PM
Using strategy: Default
[poll] Last Build : #28
[poll] Last Built Revision: Revision c9b383ba7a454778bed00d76abcdb0b033c46dd3 (origin/master)
Fetching changes from the remote Git repositories
Fetching upstream changes from ssh://git@reposerver/myrepo
Done. Took 0.44 sec
Changes found
Console output:
Started by an SCM change
Checkout:workspace / /var/lib/hudson/jobs/myrepo/workspace - hudson.remoting.LocalChannel@7ad6edc7
Using strategy: Default
Last Built Revision: Revision c9b383ba7a454778bed00d76abcdb0b033c46dd3 (origin/master)
Checkout:workspace / /var/lib/hudson/jobs/myrepo/workspace - hudson.remoting.LocalChannel@7ad6edc7
Fetching changes from the remote Git repository
Fetching upstream changes from ssh://git@reposerver/myrepo
Commencing build of Revision a576d37ea9e5c15423e0cdeb8780cabe8a816f0c (origin/master)
Checking out Revision a576d37ea9e5c15423e0cdeb8780cabe8a816f0c (origin/master)
Deleting project workspace...
done
FATAL: Unable to find build script at /var/lib/hudson/jobs/myrepo/workspace/ant/build.xml
Sending e-mails to: xxx@xxx.xxx yyy@xxx.xxx
[DEBUG] Skipping watched dependency update for build: myrepo #29 due to result: FAILURE
Finished: FAILURE
Note: I would expect the build to find that build file.
The second build gives the following output:
Polling Log:
Started on Aug 6, 2013 3:23:41 PM
No workspace is available, so can't check for updates.
Scheduling a new build to get a workspace.
Done. Took 0 ms
Changes found
Console output:
Started by an SCM change
Checkout:workspace / /var/lib/hudson/jobs/myrepo/workspace - hudson.remoting.LocalChannel@7ad6edc7
Using strategy: Default
Last Built Revision: Revision a576d37ea9e5c15423e0cdeb8780cabe8a816f0c (origin/master)
Checkout:workspace / /var/lib/hudson/jobs/myrepo/workspace - hudson.remoting.LocalChannel@7ad6edc7
Cloning the remote Git repository
Cloning repository origin
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not clone ssh://git@reposerver/myrepo
at hudson.plugins.git.GitAPI.clone(GitAPI.java:241)
at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:972)
...
... etc. as above.
SO the authentication seems to be working find on build #29, but failing for build #30.
Why the difference?
[Updated on: Tue, 06 August 2013 23:12] Report message to a moderator
|
|
|
Re: Poll git via gitolite works, clone and fetch fail [message #1081167 is a reply to message #1080600] |
Tue, 06 August 2013 22:43 |
Bruce AtEconz Messages: 6 Registered: July 2013 |
Junior Member |
|
|
So I have made some progress here. Examining the build configuration, I noticed a checkbox option, "Delete workspace before build starts," which was checked by default. I must admit I boggled a bit at this one. There can't be many people who want to do this, and it certainly wasn't helping me. I unchecked it and things magically started working.
In the spirit of experimentation though, I tried changing another option, "Delete workspace when build is done ." This was unchecked by default and I checked it. This caused all my builds to start failing with the original, "Error cloning remote repo," error message again. When I unchecked it again, the first successive build failed the same way, but the second and all following successive builds started working again.
So long story short, I now have a working Hudson system. But I'm going to go out on a limb here, and say that there is a bug in Hudson, or one or more of it's plugins, if it can fail some of the time but also succeed some of the time fetching from the same repository with the same key.
|
|
|
Re: Poll git via gitolite works, clone and fetch fail [message #1081178 is a reply to message #1081167] |
Tue, 06 August 2013 23:10 |
Bruce AtEconz Messages: 6 Registered: July 2013 |
Junior Member |
|
|
Thinking about it, "Delete workspace before build starts," is probably meant to mean delete the old workspace before checking out the new workspace. In my case thgough, that didn't seem to be happening. See the logs:
Started by user anonymous
Checkout:workspace / /var/lib/hudson/jobs/myrepo/workspace - hudson.remoting.LocalChannel@7ad6edc7
Using strategy: Default
Last Built Revision: Revision a576d37ea9e5c15423e0cdeb8780cabe8a816f0c (origin/master)
Checkout:workspace / /var/lib/hudson/jobs/myrepo/workspace - hudson.remoting.LocalChannel@7ad6edc7
Fetching changes from the remote Git repository
Fetching upstream changes from ssh://git@reposerver/myrepo
Commencing build of Revision a576d37ea9e5c15423e0cdeb8780cabe8a816f0c (origin/master)
Checking out Revision a576d37ea9e5c15423e0cdeb8780cabe8a816f0c (origin/master)
Deleting project workspace...
done
FATAL: Unable to find build script at /var/lib/hudson/jobs/myrepo/workspace/ant/build.xml
Sending e-mails to: xxx@xxx.xxx yyy@xxx.xxx
[DEBUG] Skipping watched dependency update for build: myrepo #34 due to result: FAILURE
Finished: FAILURE
[Updated on: Tue, 06 August 2013 23:13] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Tue Apr 16 16:47:51 GMT 2024
Powered by FUDForum. Page generated in 1.58234 seconds
|