Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Hudson » GIT - clean checkout fails
GIT - clean checkout fails [message #1058291] Mon, 13 May 2013 13:28 Go to next message
k z is currently offline k z
Messages: 71
Registered: October 2012
Member
Hi,

Hudson: 3.0.1-b2
Hudson GIT plugin: 2.2.1-h-1
GIT: 1.8.2

Im building GIT project on slave. When a job workspace dir is empty (either I clean it manually via workspace wipe out button or use Git plugin configuration option "Wipe out workspace before build")the build crashes on checkout. After that, on the filesystem I have only one folder .git. It contains standard git folders (but empty) and two files HEAD and config. HEAD contains
ref: refs/heads/master


However, if I run the build again on that folder, the files will be checked out successfully. The problem occures only when the workspace is empty. HEAD content after successfull checkout

b9f5b15f0760d26543ba208d536a2f0c75b94237


Log after 1st attempt (empty workspace - build failed)
Started by user <MyUser>
Building remotely on punt
Checkout:test_git / /hudson/workspace/test_git - hudson.remoting.Channel@3e8eae1e:punt
Using strategy: Default
Last Built Revision: Revision b9f5b15f0760d26543ba208d536a2f0c75b94237 (origin/master)
Checkout:test_git / /hudson/workspace/test_git - hudson.remoting.LocalChannel@1a254ec
Cloning the remote Git repository
Cloning repository origin
ERROR: Error cloning remote repo 'origin' : Could not clone <MyGitRepo>
ERROR: Cause: Exception caught during execution of fetch command
Trying next repository
ERROR: Could not clone repository
FATAL: Could not clone
hudson.plugins.git.GitException: Could not clone
	at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:957)
	at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:889)
	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2052)
	at hudson.remoting.UserRequest.perform(UserRequest.java:107)
	at hudson.remoting.UserRequest.perform(UserRequest.java:41)
	at hudson.remoting.Request$2.run(Request.java:276)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
	at java.lang.Thread.run(Thread.java:680)


Log after 2nd attempt (workspace remains after 1st attempt - build successful)


Started by user <MyUser>
Building remotely on punt
Checkout:test_git / /hudson/workspace/test_git - hudson.remoting.Channel@3e8eae1e:punt
Using strategy: Default
Last Built Revision: Revision b9f5b15f0760d26543ba208d536a2f0c75b94237 (origin/master)
Checkout:test_git / /hudson/workspace/test_git - hudson.remoting.LocalChannel@1a254ec
Fetching changes from the remote Git repository
Fetching upstream changes from <MyGitRepo>
Commencing build of Revision b9f5b15f0760d26543ba208d536a2f0c75b94237 (origin/master)
Checking out Revision b9f5b15f0760d26543ba208d536a2f0c75b94237 (origin/master)
[DEBUG] Skipping watched dependency update; build not configured with trigger: test_git #138
Finished: SUCCESS


The problem is always reproducible.

[Updated on: Mon, 13 May 2013 13:30]

Report message to a moderator

Re: GIT - clean checkout fails [message #1058328 is a reply to message #1058291] Mon, 13 May 2013 14:53 Go to previous messageGo to next message
Winston Prakash is currently offline Winston Prakash
Messages: 426
Registered: August 2011
Location: Fremont, CA USA
Senior Member
Hi I saw this couple of times. I will investigate this. Are you cloning from Github. This happens when I clone from Github using HTTPS protocol.

Winston Prakash
Eclipse Hudson team
Re: GIT - clean checkout fails [message #1058443 is a reply to message #1058328] Tue, 14 May 2013 06:55 Go to previous messageGo to next message
k z is currently offline k z
Messages: 71
Registered: October 2012
Member
Yes, I'm using HTTPS protocol as well but I'm not cloning from Github but from our internal corporate Git server.
Re: GIT - clean checkout fails [message #1058516 is a reply to message #1058443] Tue, 14 May 2013 11:46 Go to previous messageGo to next message
Reinhard Nägele is currently offline Reinhard Nägele
Messages: 23
Registered: January 2013
Junior Member
We had this issue a lot. We use Git with SSH. I've seen this with Github projects as well as internal Gerrit projects. As a result we do not clean the workspace but use "Clean after checkout" until this is fixed.
Re: GIT - clean checkout fails [message #1058698 is a reply to message #1058516] Tue, 14 May 2013 17:55 Go to previous messageGo to next message
Winston Prakash is currently offline Winston Prakash
Messages: 426
Registered: August 2011
Location: Fremont, CA USA
Senior Member
Hi K.Z & Reinhard, please read the comments in this issue https://bugs.eclipse.org/bugs/show_bug.cgi?id=407887. Henrik, mention he sees the same issue, but could be fixed with some permission settings. However, the plugin should give proper error message.

Winston Prakash
Eclipse Hudson team

[Updated on: Tue, 14 May 2013 17:56]

Report message to a moderator

Re: GIT - clean checkout fails [message #1058788 is a reply to message #1058698] Wed, 15 May 2013 06:30 Go to previous messageGo to next message
Reinhard Nägele is currently offline Reinhard Nägele
Messages: 23
Registered: January 2013
Junior Member
Thanks or referring to the bug. I made a comment there because I don't think it is a permissions issue in our case.
Re: GIT - clean checkout fails [message #1058817 is a reply to message #1058788] Wed, 15 May 2013 08:54 Go to previous messageGo to next message
k z is currently offline k z
Messages: 71
Registered: October 2012
Member
Henrik provided solution to the configuration issue he created first and it does not apply to the scenario where you checkout from a different machine.

[Updated on: Wed, 15 May 2013 08:55]

Report message to a moderator

Re: GIT - clean checkout fails [message #1058898 is a reply to message #1058817] Wed, 15 May 2013 15:27 Go to previous messageGo to next message
Winston Prakash is currently offline Winston Prakash
Messages: 426
Registered: August 2011
Location: Fremont, CA USA
Senior Member
Ok, appears the issue is different from that mentioned in the bug. I'll try to fix it ASAP.

Winston Prakash
Eclipse Hudson team
Re: GIT - clean checkout fails [message #1058970 is a reply to message #1058898] Thu, 16 May 2013 05:21 Go to previous messageGo to next message
Winston Prakash is currently offline Winston Prakash
Messages: 426
Registered: August 2011
Location: Fremont, CA USA
Senior Member
Unfortunately I'm not able to reproduce it. I made sure the workspace was clean. The build was successful

Started by user anonymous
Building remotely on Fedora-slave
Checkout:Test / /home/wjprakash/hudson-slave/workspace/Test - hudson.remoting.Channel@5507d9e4:Fedora-slave
Using strategy: Default
Last Built Revision: Revision ec69988ea1db2f064e818e8c81cd9afb8eb48bde (origin/master)
Checkout:Test / /home/wjprakash/hudson-slave/workspace/Test - hudson.remoting.LocalChannel@6de1bddb
Cloning the remote Git repository
Cloning repository origin

Fetching upstream changes from git://github.com/hudson3-plugins/htmlpublisher-plugin.git

Commencing build of Revision ec69988ea1db2f064e818e8c81cd9afb8eb48bde (origin/master)
Checking out Revision ec69988ea1db2f064e818e8c81cd9afb8eb48bde (origin/master)
Finished: SUCCESS



Winston Prakash
Eclipse Hudson team
Re: GIT - clean checkout fails [message #1058971 is a reply to message #1058970] Thu, 16 May 2013 05:25 Go to previous messageGo to next message
Winston Prakash is currently offline Winston Prakash
Messages: 426
Registered: August 2011
Location: Fremont, CA USA
Senior Member
Could you try with this git plugin. The only difference is, I have added full stack print when the exception happens, for me to identify the error.

https://dl.dropboxusercontent.com/u/13144273/git.hpi

Also the git on the slave
[wjprakash@riverview ~]$ git --version
git version 1.7.11.7


And the global git config set as

[wjprakash@riverview ~]$ cat .gitconfig 
[user]
	email = winston.prakash@gmail.com
	name = Winston Prakash






Winston Prakash
Eclipse Hudson team
Re: GIT - clean checkout fails [message #1059036 is a reply to message #1058971] Thu, 16 May 2013 11:15 Go to previous messageGo to next message
k z is currently offline k z
Messages: 71
Registered: October 2012
Member
Great! Thank to the full stack trace we can identify the problem, btw why it is not always enabled? It looks like there is a problem with authorization on the first attemp. I keep repo credentials in .netrc file. So what is the problem?

Clean checkout
Started by user zapalak
Building remotely on punt
Checkout:test-git / /hudson2/workspace/test-git - hudson.remoting.Channel@37dd0b4c:punt
Using strategy: Default
Last Built Revision: Revision 27964cc90aad85d37cc6379c89cc4eb6467ceb1e (origin/master)
Checkout:test-git / /hudson2/workspace/test-git - hudson.remoting.LocalChannel@32b6481e
Cloning the remote Git repository
Cloning repository origin
ERROR: Error cloning remote repo 'origin' : Could not clone https://<MyGitRepo>/SeeingAssistant/SeeingAssistant-Routes
hudson.plugins.git.GitException: Could not clone https://<MyGitRepo>/SeeingAssistant/SeeingAssistant-Routes
	at hudson.plugins.git.GitAPI.clone(GitAPI.java:234)
	at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:942)
	at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:889)
	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2052)
	at hudson.remoting.UserRequest.perform(UserRequest.java:107)
	at hudson.remoting.UserRequest.perform(UserRequest.java:41)
	at hudson.remoting.Request$2.run(Request.java:276)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
	at java.lang.Thread.run(Thread.java:680)
Caused by: org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during execution of fetch command
	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:145)
	at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:174)
	at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:118)
	at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:224)
	at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:218)
	at hudson.FilePath.act(FilePath.java:791)
	at hudson.FilePath.act(FilePath.java:773)
	at hudson.plugins.git.GitAPI.clone(GitAPI.java:218)
	... 12 more
Caused by: org.eclipse.jgit.errors.TransportException: https://<MyGitRepo>/SeeingAssistant/SeeingAssistant-Routes: not authorized
	at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:446)
	at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:276)
	at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:127)
	at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:113)
	at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1062)
	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:136)
	... 19 more
ERROR: Cause: Exception caught during execution of fetch command
Trying next repository
ERROR: Could not clone repository
FATAL: Could not clone
hudson.plugins.git.GitException: Could not clone
	at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:958)
	at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:889)
	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2052)
	at hudson.remoting.UserRequest.perform(UserRequest.java:107)
	at hudson.remoting.UserRequest.perform(UserRequest.java:41)
	at hudson.remoting.Request$2.run(Request.java:276)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
	at java.lang.Thread.run(Thread.java:680)



2nd attempt
Started by user zapalak
Building remotely on punt
Checkout:test-git / /hudson2/workspace/test-git - hudson.remoting.Channel@37dd0b4c:punt
Using strategy: Default
Last Built Revision: Revision 27964cc90aad85d37cc6379c89cc4eb6467ceb1e (origin/master)
Checkout:test-git / /hudson2/workspace/test-git - hudson.remoting.LocalChannel@32b6481e
Fetching changes from the remote Git repository
Fetching upstream changes from https://<MyGitRepo>/SeeingAssistant/SeeingAssistant-Routes
Commencing build of Revision 27964cc90aad85d37cc6379c89cc4eb6467ceb1e (origin/master)
Checking out Revision 27964cc90aad85d37cc6379c89cc4eb6467ceb1e (origin/master)
Notifying upstream projects of job completion
[DEBUG] Skipping watched dependency update; build not configured with trigger: test-git #8
Finished: SUCCESS


git version
punt:~ builder$ git --version
git version 1.8.2

global config
punt:~ builder$ cat .gitconfig
[user]
      email=ttbuildserver@gmail.com
      name=builder

[Updated on: Thu, 16 May 2013 11:16]

Report message to a moderator

Re: GIT - clean checkout fails [message #1059041 is a reply to message #1059036] Thu, 16 May 2013 12:02 Go to previous messageGo to next message
Reinhard Nägele is currently offline Reinhard Nägele
Messages: 23
Registered: January 2013
Junior Member
I tried it and responded directly on the bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=407887#c6
Re: GIT - clean checkout fails [message #1059115 is a reply to message #1059041] Thu, 16 May 2013 20:01 Go to previous messageGo to next message
Winston Prakash is currently offline Winston Prakash
Messages: 426
Registered: August 2011
Location: Fremont, CA USA
Senior Member
KZ, Reinhard, I've added new comment to the issue

https://bugs.eclipse.org/bugs/show_bug.cgi?id=407887#c7


Winston Prakash
Eclipse Hudson team
Re: GIT - clean checkout fails [message #1065500 is a reply to message #1059115] Wed, 26 June 2013 07:39 Go to previous messageGo to next message
k z is currently offline k z
Messages: 71
Registered: October 2012
Member
Hi,

The problem is obviously connected with authorization process. First checkout is successful when I clone from public repository. I tried both .netrc and credential.helper (osxkeychain in my case - MACOS) to store credentials and they works fine from command line but not from Hudson.


1) .netrc
1st checkout (clone?) fails (Caused by: hudson.plugins.git.GitException: org.eclipse.jgit.api.errors.TransportException: https://<URL>/test/test: not authorized)
2nd and next checkouts (fetch?) are successful

2) osxkeychain
1st checkout (clone?) fails (Caused by: hudson.plugins.git.GitException: org.eclipse.jgit.api.errors.TransportException: https://<URL>/test/test: not authorized)
2nd and next checkouts (fetch) are failure(Command "git fetch -t https://<URL>/test/test +refs/heads/*:refs/remotes/origin/*" returned status code 128: fatal: could not read Username for 'https://<URL>': Device not configured
Similar issue is described here https://github.com/kemayo/sublime-text-2-git/issues/176

How do you cache your GIT credentials for HTTPS connections ? It seems as if Hudson Git plugin (v2.2.3) cannot take advantege of it now.

Regards!

Re: GIT - clean checkout fails [message #1170077 is a reply to message #1065500] Mon, 04 November 2013 11:45 Go to previous messageGo to next message
Lukasz Jader is currently offline Lukasz Jader
Messages: 35
Registered: October 2013
Member
Hi, I've added new comment to the issue
https://bugs.eclipse.org/bugs/show_bug.cgi?id=407887#c7
icon10.gif  Re: GIT - clean checkout fails [message #1171685 is a reply to message #1170077] Tue, 05 November 2013 12:09 Go to previous message
Lukasz Jader is currently offline Lukasz Jader
Messages: 35
Registered: October 2013
Member
Hi, I've managed to resolve my clean SSH clone issue - I've added resolution as comment to the issue:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=407887#c14
Previous Topic:Hudson disk-plugin half-broken after update from 3.0.1 to 3.1.0
Next Topic:Hudson plugin update for subversion 1.8 compatibility
Goto Forum:
  


Current Time: Thu Oct 23 17:25:09 GMT 2014

Powered by FUDForum. Page generated in 0.08456 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software