Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 377670 - can not delete workspace from windows7tests slave machine
Summary: can not delete workspace from windows7tests slave machine
Status: RESOLVED NOT_ECLIPSE
Alias: None
Product: Community
Classification: Eclipse Foundation
Component: CI-Jenkins (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eclipse Webmaster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 377365
  Show dependency tree
 
Reported: 2012-04-25 13:14 EDT by David Williams CLA
Modified: 2012-05-11 01:40 EDT (History)
0 users

See Also:


Attachments
reponse from trying to wipe workspace (11.08 KB, text/html)
2012-04-25 13:14 EDT, David Williams CLA
no flags Details
response (11.63 KB, text/html)
2012-04-30 20:54 EDT, David Williams CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Williams CLA 2012-04-25 13:14:01 EDT
Created attachment 214549 [details]
reponse from trying to wipe workspace

This is using the Hudson interface itself, nothing fancy. 

There's an option under our job specific page to see the workspace: 

https://hudson.eclipse.org/hudson/view/Eclipse%20and%20Equinox/job/JUnit-win2/ 

and if you expand that, there is an option to "wipe it". 

If I try that, I get an error, which I'll attach. 

I can make a little progress with the "junk" there, but will need it cleaned up soon.
Comment 1 Denis Roy CLA 2012-04-25 16:00:40 EDT
This has happened before.  The .git folder receives the Read-Only bit for some reason. Perhaps it's a git client setting or something....  I've cleared the bit -- can you try wiping the workspace now?
Comment 2 David Williams CLA 2012-04-27 05:24:40 EDT
I just tried again (didn't read your reply until now) and it failed again ... though, I've used git a number of times on it, so it it'd not be surprising that git would "reset" the bit to be readonly. 


java.io.IOException: Unable to delete c:\hb\workspace\JUnit-win2\org.eclipse.releng.eclipsebuilder\.git\objects\pack\pack-e1219dba877f48edd90fb0bd92e4348dbc591be8.pack
Comment 3 David Williams CLA 2012-04-27 11:14:11 EDT
Now when I try to start a job, (tried 3 or 4 times) I always get the error similar to that reported in bug 377433 (though, it was on a linux box). 



Started by user anonymous
Building remotely on windows7tests
Checkout:JUnit-win2 / c:\hb\workspace\JUnit-win2 - hudson.remoting.Channel@55e0740e:windows7tests
Using strategy: Default
Last Built Revision: Revision 1338d3ccc49f9cccc83d3c53d8aa9201e9b737e6 (origin/master)
Checkout:org.eclipse.releng.eclipsebuilder / c:\hb\workspace\JUnit-win2\org.eclipse.releng.eclipsebuilder - hudson.remoting.LocalChannel@ab64e3
FATAL: One of setGitDir or setWorkTree must be called.
java.lang.IllegalArgumentException: One of setGitDir or setWorkTree must be called.
	at org.eclipse.jgit.lib.BaseRepositoryBuilder.requireGitDirOrWorkTree(BaseRepositoryBuilder.java:538)
	at org.eclipse.jgit.lib.BaseRepositoryBuilder.setup(BaseRepositoryBuilder.java:506)
	at org.eclipse.jgit.storage.file.FileRepositoryBuilder.build(FileRepositoryBuilder.java:89)
	at hudson.plugins.git.GitAPI.<init>(GitAPI.java:92)
	at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:853)
	at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:845)
	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:1960)
	at hudson.remoting.UserRequest.perform(UserRequest.java:114)
	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
	at hudson.remoting.Request$2.run(Request.java:283)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at hudson.remoting.Engine$1$1.run(Engine.java:60)
	at java.lang.Thread.run(Unknown Source)
Comment 4 David Williams CLA 2012-04-27 11:16:04 EDT
So ... you can try read bit again if you'd like and I'll pay attention and try to remove myself .... or, if you wouldn't mind ... you could just delete everything under 
c:\hb\workspace\JUnit-win2\
and I'll start fresh .. and while we'll still have the long term problem, that might hold us through milestone week?
Comment 5 Eclipse Webmaster CLA 2012-04-27 11:37:12 EDT
I had to restart the client as windows kept reporting that a pack file was in use by the JVM when I tried to delete the directory.  Everything should be 'back to normal' now.

-M.
Comment 6 David Williams CLA 2012-04-27 12:43:58 EDT
I am able to build again and have a shiny new workspace. 

Should we leave this open until we know the "long term" fix for deleting the workspace? Or ... think this was a one-time problem and in future I should be able to remove workspace myself? (I'm a little afraid to try now :)
Comment 7 Eclipse Webmaster CLA 2012-04-27 14:01:47 EDT
These issues have the 'appearance' of a Hudson bug(or bugs).  But you should be able to delete the workspace(well, Hudson should be able to at least).

I'll close this and we can re-open(or create a new one) if something goes wrong again.

-M.
Comment 8 David Williams CLA 2012-04-30 20:54:06 EDT
Created attachment 214845 [details]
response

same problem again.
Comment 9 David Williams CLA 2012-05-01 09:45:09 EDT
And now seeing same problem with our other "windows test job" (which is to test our 3.8.0 builds). 


FATAL: remote file operation failed: c:\hb\workspace\JUnit-win at hudson.remoting.Channel@4ad5b395:windows7tests
hudson.util.IOException2: remote file operation failed: c:\hb\workspace\JUnit-win at hudson.remoting.Channel@4ad5b395:windows7tests
	at hudson.FilePath.act(FilePath.java:754)
	at hudson.FilePath.act(FilePath.java:740)
	at hudson.FilePath.deleteRecursive(FilePath.java:824)
	at hudson.model.AbstractProject.cleanWorkspace(AbstractProject.java:1774)
	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:419)
	at hudson.model.Run.run(Run.java:1367)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
	at hudson.model.ResourceController.execute(ResourceController.java:88)
	at hudson.model.Executor.run(Executor.java:145)
Caused by: java.io.IOException: Unable to delete c:\hb\workspace\JUnit-win\org.eclipse.releng.eclipsebuilder\.git\objects\pack\pack-145b4abe4589cf58a806d2c3d48df23fd901c197.pack
	at hudson.Util.deleteFile(Util.java:263)
	at hudson.Util.deleteRecursive(Util.java:305)
	at hudson.Util.deleteContentsRecursive(Util.java:224)
	at hudson.Util.deleteRecursive(Util.java:304)
	at hudson.Util.deleteContentsRecursive(Util.java:224)
	at hudson.Util.deleteRecursive(Util.java:304)
	at hudson.Util.deleteContentsRecursive(Util.java:224)
	at hudson.Util.deleteRecursive(Util.java:304)
	at hudson.Util.deleteContentsRecursive(Util.java:224)
	at hudson.Util.deleteRecursive(Util.java:304)
	at hudson.Util.deleteContentsRecursive(Util.java:224)
	at hudson.Util.deleteRecursive(Util.java:304)
	at hudson.FilePath$9.invoke(FilePath.java:826)
	at hudson.FilePath$9.invoke(FilePath.java:824)
	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:1960)
	at hudson.remoting.UserRequest.perform(UserRequest.java:114)
	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
	at hudson.remoting.Request$2.run(Request.java:283)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at hudson.remoting.Engine$1$1.run(Engine.java:60)
	at java.lang.Thread.run(Unknown Source)



So, this is not a blocking problem for us. 
I'm fairly sure we have to "clean" the workspace before each build, so we won't be able to make any progress testing on windows with this problem. 

Naturally, if you have some suggestions on things we could do differently on our end, let me know.
Comment 10 David Williams CLA 2012-05-01 09:47:10 EDT
(In reply to comment #9)

> So, this is not a blocking problem for us. 

So, this is NOW a blocking problem for us.
Comment 11 Denis Roy CLA 2012-05-01 09:49:33 EDT
We could/should perhaps try updating git on the windows slave, in case this is a git bug.
Comment 12 David Williams CLA 2012-05-01 10:13:34 EDT
(In reply to comment #11)
> We could/should perhaps try updating git on the windows slave, in case this is
> a git bug.

Wouldn't hurt, but, the other thing I'll try is to put my actual tests in a subddirectory named "workarea" and that will be the only directory I'll be sure to clean each time. 

That's still a hacky workaround, since a) should be able to clean workspace, b) if can't delete the file due to dangling process, then than dangling process is likely to interfere with tests and/or slow them down if they "build up". 

So, maybe we'll do these things in parallel and one or both will help?
Comment 13 Eclipse Webmaster CLA 2012-05-01 10:36:19 EDT
I've installed Git 1.7.10.

A quick look at the workspace permissions shows that both directories were marked 'read-only' and when I removed that wiping out the Junit-win workspace failed with the 'pack file in use by Java' error.

I've removed the workspace contents, and if this happens again I think we should strongly consider filing this as a bug against Hudson(although perhaps the upgrade due this summer will resolve the issue).

-M.
Comment 14 David Williams CLA 2012-05-01 11:47:42 EDT
And, I've added a "workarea" subdirectory to delete. There is less reason to delete the git repo we check out. 

So, I don't think this is "blocking" any longer. 

But, will leave open until we actually test cleaning the whole workspace and then we'll know if still a problem or not. 

From a little searching on the internet, seemed like this was a problem on windows, hudson or not, so may be something "deeper" ... perhaps something about git needs "special permissions" from windows, or perhaps there is some combination of problems.
Comment 15 Denis Roy CLA 2012-05-01 11:49:16 EDT
When is Windows NOT part of the problem?
Comment 16 David Williams CLA 2012-05-06 19:14:54 EDT
Getting this error again. 

To make matters worse, I've decided for us (platform) to reliably run our junit tests, we do need to wipe the workspace before checking out (cloning) git repo each time (the 'workarea' I tried wasn't enough)  ... so ... if we can't do that ... we're sort of hosed on testing with hudson, on windows. works find on linux and the mac. 

Right now, I get the following error when trying to start a job, but this followed a run where I tried to wipe the workspace first (its an option under the "advanced" Git button) and that run produced the typical " can't delete some .git... pack file "

Current error:

Checkout:org.eclipse.releng.eclipsebuilder / c:\hb\workspace\JUnit-win\org.eclipse.releng.eclipsebuilder - hudson.remoting.LocalChannel@118a2e9
FATAL: One of setGitDir or setWorkTree must be called.
java.lang.IllegalArgumentException: One of setGitDir or setWorkTree must be called.
	at org.eclipse.jgit.lib.BaseRepositoryBuilder.requireGitDirOrWorkTree(BaseRepositoryBuilder.java:538)
	at org.eclipse.jgit.lib.BaseRepositoryBuilder.setup(BaseRepositoryBuilder.java:506)
 

Suggestions?
Comment 17 Eclipse Webmaster CLA 2012-05-07 16:41:41 EDT
I checked and the 'parent' directory also had the read only bit set, so I cleared it.

I did some digging and I see what David was referring to(this being some kind of issue in Windows), but I didn't see anyone with an 'actual' fix.  Everyone basically recommended what we're already doing.

-M.
Comment 18 Denis Roy CLA 2012-05-07 16:53:35 EDT
Would using the chattr command work?  My DOS is a bit far away...
Comment 19 David Williams CLA 2012-05-07 17:22:38 EDT
(In reply to comment #18)
> Would using the chattr command work?  My DOS is a bit far away...

Don't know, but I have what may be a better solution. 
I don't really want a repo, I just want the files! 

(want to hear the long story?) 

I spent the weekend trying to find some way just to "export" the files, like cvs (or svn) can do, but apparently git does not do that (directly), but found one site that recommended using git archive --format=tar and apparently, that might work if working directly on build machine (using file paths) 

http://aniefer.blogspot.com/2011/01/building-from-git.html

But that doesn't help with Hudson slaves, and even using SSH I could not get it to work remotely: 

git archive ... ssh://david_williams@git.eclipse.org/gitroot/platform/eclipse.platform.releng.eclipsebuilder.git
Not allowed to do git command '/usr/local/bin/git-upload-archive' at /usr/local/bin/committer_shell line 125.
fatal: The remote end hung up unexpectedly

(in case your interested in who's been cause weird security logs on your end :) 

Was about to open a bug "to allow it", 

BUT THEN, found bug 329841 !! 

It appears I can get the code I need using ant or wget with a simple 

wget git.eclipse.org/c/platform/eclipse.platform.releng.eclipsebuilder.git/snapshot/master.zip

and that avoids all that nasty .git directory stuff.

So ... that's the direction I'm going to head down. I should be able to delete _those_ files very easily, and re-fetch when ever needed. For tests, who needs a repo! :) 

[I might have more questions, when I need to retrieve a specific "tagged" version ... but assume that'll be obvious.]

P.S. to be able to use git archive would be kind of nice, but does seem like its done much, so maybe its old school? Or a security risk? I was trying 

git archive --format=tar --output=eb.tar --remote="ssh://david_williams@git.eclipse.org/gitroot/platform/eclipse.platform.releng.eclipsebuilder.git" --exec="/usr/local/bin/git-upload-archive"

I'm guessing the "snapshot" function is doing that ... just with the right authority and/or location. 

If that 'snapshot' function is documented somewhere, that should be highlighted. (Might be? ... you know ... I'm a newbie).
Comment 20 David Williams CLA 2012-05-07 18:36:49 EDT
I couldn't help myself, I was so excited I made a few notes in 

http://wiki.eclipse.org/Git#You_don.27t_need_Git_to_get_code_from_repository

(please correct if I've misstated, but think this is possible because "we" use cGit?) 

I'll give this no-repo method a try soon, and suspect we'll end up closing this bug as "won't fix" (since no real fix) and if/when happens I, or others, can just ask intervention.
Comment 21 David Williams CLA 2012-05-11 01:40:47 EDT
I think "not eclipse" is proper resolution for this bug?

I'm sure there's some way to fix it with some sort of windows setting, or some way to open a "git bug" ... but, doesn't sound like hudson or much to do about it (other than the "manual" intervention). 

The chattr approach might work but a) I don't know anything about it either, and b) my guess is the "hudsonbuild" user might need to be given some special "admin" privileges or something less than desirable. Don't know. 

But, the solution of not using git at all, and simply "getting the files" is actually the right solution, in this case, for many reasons (IMHO), so I am happy with that ... and can be thankful that Windows has once again led me to learning so much about the best way to use computers. :)