Project

General

Profile

Bug #4281

ant update produces message about running svn cleanup

Added by Christopher Brooks over 9 years ago. Updated over 3 years ago.

Status:
In Progress
Priority:
Normal
Category:
build system
Target version:
Start date:
08/05/2009
Due date:
% Done:

0%

Estimated time:
Spent time:
Bugzilla-Id:
4281

Description

Under Windows 2003 Server, running "ant update" produces a message
about a file being locked and suggesting running "svn cleanup".

If I do:

svn co https://code.kepler-project.org/code/kepler/trunk/modules/build-area
cd build-area
ant change-to -Dsuite=kepler
ant update

Then I get:

[update-modules] Updating ptolemy-lib...
[update-modules] svn -r head update c:\tmp\cxh\src\kepler\ptolemy-lib
[update-modules] At revision 20190.
[update-modules]
[update-modules] svn -r head update c:\tmp\cxh\src\kepler\build-area
[update-modules] svn: Working copy 'c:\tmp\cxh\src\kepler\build-area' locked
[update-modules] svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
[update-modules]
[update-modules] WARNING: It appears that the command did not execute properly and exited with an exit code of: 1

Running "ant cleanup" does not change the results.

This should probably be addressed before 2.0 as Windows users will find it
confusing.

I believe that the problem is likely that a file in build-area is being
changed and Windows is not able to deal with this.

I think this is a new failure, it may have started only in the last few weeks.

History

#1 Updated by Matt Jones over 9 years ago

This happens on any platform when SVN doesn't complete an operation successfully and leaves the working copy in a locked state. Its not just windows. It is easily fixed by running 'svn cleanup' (not 'ant cleanup as indicated in the earlier comment). It should be rare and easily fixable, so I am lowering priority and retargeting unless it can be demonstrated that this is a common problem. Probably can close this bug.

#2 Updated by David Welker almost 9 years ago

I agree that this bug should be closed. "ant update" is a convenience method which allows one to avoid having to run many individual svn update commands. There is no good way to interrupt it to allow user input to resolve the many issues that could cause the command to not complete. The solution if an error occurs (whether it is a lock or a conflict) when running "ant update" is to resolve the problem with standard svn commands before running "ant update" again.

#3 Updated by Christopher Brooks almost 9 years ago

Actually, running "svn cleanup" does not fix this under Windows Server 2003.

To create a svn repository, what I did was run
cd kepler/ptolemy
svn update &
kill -9 %1

This resulted in the ptolemy svn repository being locked.

Running
cd ../build-area
ant update

produced:

[update-modules] Updating ptolemy...
[update-modules] Using the stable version of ptolemy. Use 'ant update-ptolemy -D
rev=head' to work from the head.
[update-modules] svn -r 56907 update c:\tmp\cxh\src\kepler\ptolemy
[update-modules] svn: Working copy 'c:\tmp\cxh\src\kepler\ptolemy' locked
[update-modules] svn: run 'svn cleanup' to remove locks (type 'svn help cleanup'
for details)
[update-modules]

This is fine. I went back to kepler/ptolemy and ran "svn cleanup".

Then, when I ran "ant update" in build-area, I got:

[update-modules] Updating build-area...
[update-modules] svn -r head update c:\tmp\cxh\src\kepler\build-area
[update-modules] svn: Working copy 'c:\tmp\cxh\src\kepler\build-area' locked
[update-modules] svn: run 'svn cleanup' to remove locks (type 'svn help cleanup'
for details)
[update-modules]

This is odd, why is build-area needing a cleanup.

While in build-area/, I ran "svn cleanup", but still got

[update-modules] Updating build-area...
[update-modules] svn -r head update c:\tmp\cxh\src\kepler\build-area
[update-modules] svn: Working copy 'c:\tmp\cxh\src\kepler\build-area' locked
[update-modules] svn: run 'svn cleanup' to remove locks (type 'svn help cleanup'
for details)
[update-modules]

So, at this point, the I can't update this tree.

Obviously, making the ptII svn repository need "svn cleanup" is a bit contrived,
but it does seem that if there is a repository in need of "svn cleanup", then
there are problems (at least under Windows Server 2003.)

#4 Updated by David Welker almost 9 years ago

Christopher,

I was wondering if you could reproduce this problem still. I just tried to reproduce it using your commands:

cd kepler.modules/ptolemy/src
svn update &
kill -9 %1

As expected, the first time "ant update" failed, telling me that I had to do a clean up. I went ahead and did "svn update" on kepler.modules/ptolemy/src and ran "ant update" again and it worked fine.

It really is bizarre that the actions you took affected the build-area! That is pretty interesting.

Anyway, the "ant update" command has been changed since you ran this test. I was wondering if this problem is still reproducible on Windows? I certainly can't get this error to occur on Mac.

#5 Updated by Christopher Brooks over 8 years ago

It looks like ant update fails under Windows 2003 in a clean tree.

The error is:

[update-modules] At revision 57481.
[update-modules] svn: warning: cannot set LC_CTYPE locale
[update-modules] svn: warning: environment variable LANG is ENU
[update-modules] svn: warning: please check that your locale name is correct
[update-modules]
[update-modules] Updating build-area...
[update-modules] svn -r head update --accept postpone C:\tmp\cxh\src\kepler\build-area
[update-modules] svn: warning: cannot set LC_CTYPE locale
[update-modules] svn: warning: environment variable LANG is ENU
[update-modules] svn: warning: please check that your locale name is correct
[update-modules] svn: Working copy 'C:\tmp\cxh\src\kepler\build-area' locked
[update-modules] svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
[update-modules]

BUILD FAILED
C:\tmp\cxh\src\kepler\build-area\build.xml:165: ERROR: It appears that the command did not execute properly and exited with an exit code of: 1

To reproduce this under Windows, run:

mkdir kepler
cd kepler
svn co https://code.kepler-project.org/code/kepler/trunk/modules/build-area
cd build-area
ant change-to -Dsuite=kepler
ant run
ant update

I suspect the problem is that Windows is braindead about modifying open
files. Probably there is an open file when svn is being run. The problem
does not appear under Mac OS X. Can someone try the above steps under Windows?

#6 Updated by Christopher Brooks over 8 years ago

I was just bitten by this bug again.
The problem is that under Windows, if build-area gets updated by someone
else, then "ant update" fails with:

[update-modules] Updating build-area...
[update-modules] svn -r head update --accept postpone C:\tmp\cxh\src\kepler-2.0\build-area
[update-modules] svn: Working copy 'C:\tmp\cxh\src\kepler-2.0\build-area' locked
[update-modules] svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
[update-modules]

running "svn cleanup" does not do it, one will get the same message again.

One has to run "svn update".

I'm bumping this up from P3 to P2 because Windows users will be bitten
by this bug and it will generate support email.

#7 Updated by Christopher Brooks over 8 years ago

This bug is now affecting me under Mac OS X. I've also seen it under
Windows Server 2003.

svn update yields:

[update-modules] Updating ptolemy...
[update-modules] svn -r head update --accept postpone /Users/cxh/src/kepler/ptolemy
[update-modules] At revision 24512.
[update-modules]
[update-modules] Using the stable version of ptolemy. Use 'ant update-ptolemy -Drev=head' to work from the head.
[update-modules] svn -r 57769 update --accept postpone /Users/cxh/src/kepler/ptolemy/src
[update-modules] svn: Working copy '/Users/cxh/src/kepler/ptolemy/src' locked
[update-modules] svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
[update-modules]

I've tried running "svn cleanup" in both the ptolemy and build-source
directory

What I did was
mkdir kepler
cd kepler
svn co https://code.kepler-project.org/code/kepler/trunk/modules/build-area
cd build-area
ant change-to -Dsuite=kepler

Then, during the download, my connection failed.

I ran
ant change-to -Dsuite=kepler
ant update

and got the cleanup message above.

I then tried
cd ../ptolemy
svn cleanup
cd ../build-area
ant update
svn cleanup
ant update

The workaround was:
rm -rf ../ptolemy
atn change-to -Dsuite=kepler
ant update

The fix would be to have the error message state that "ant cleanup"
is not always sufficient.

I'm moving this up in importance because it affects multiple platforms
and losing a connection during a 10 minute download is somewhat common.

#8 Updated by Jonathan Boright about 8 years ago

I am also experiencing this bug with Windows 7 64-bit

when I run:

ant update

I get the same message:
"[update-modules] Updating build-area...
[update-modules] svn -r head update --accept postpone C:\kepler\svn\build-area
[update-modules] svn: Working copy 'C:\kepler\svn\build-area' locked
[update-modules] svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
[update-modules]"

I've tried:
svn cleanup
svn update
ant clean-cache

I've re-built the build area:
(cd to buid-area
rm -rf *
svn co https://code.kepler-project.org/code/kepler/trunk/modules/build-area .
ant change-to -Dsuite=isciences)

I have not yet found the work-around. Ant update works fine until the build-area... then it fails...

Question: Is the build-area the last to update with ant update? If not, what comes after it?

Jon Boright

#9 Updated by Christopher Brooks almost 8 years ago

The problem with "ant update" failing under Windows continues.

After recent changes to build-area, I ran "svn update" sucessfully.

Then, when I ran "ant update", I got:
--start--
[update-modules] Updating build-area...
[update-modules] svn -r head update --accept postpone C:\tmp\cxh\src\kepler\build-area
[update-modules] svn: Working copy 'C:\tmp\cxh\src\kepler\build-area' locked
[update-modules] svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
[update-modules]

BUILD FAILED
C:\tmp\cxh\src\kepler\build-area\build.xml:168: ERROR: It appears that the command did not execute properly and exited with an exit code of: 1
--end--

Running "svn cleanup" in build-area and then running "ant update" results in the same
error.

What is probably happening here is that the ant process is modifying the build-area
directory, which is causing the svn update to think that the svn update process was interrupted.
My conjecture is that changes to build-area such as updating target/kepler-tasks.jar
will cause this problem under Windows.

One workaround is to remove the build-area directory, do a new checkout and change-to:

cd ..
rm -rf build-area
svn co https://code.kepler-project.org/code/kepler/trunk/modules/build-area
cd build-area
ant change-to -Dsuite=kepler

#10 Updated by Christopher Brooks over 6 years ago

The problem where "ant update" fails under Windows continues to occur.
Under Windows Server 2008 R2, I got

[update-modules] Updating build-area...
[update-modules] svn -r head update --accept postpone C:\Users\Administrator\src\kepler\build-area
[update-modules] svn: Working copy 'C:\Users\Administrator\src\kepler\build-area' locked
[update-modules] svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
[update-modules]

Running svn cleanup does not help, the only thing that works is removing
build-area and starting over.

I changed this target to 2.4.0 for consideration.

#11 Updated by Ilkay Altintas over 6 years ago

This is a bug for developers. A potential fix is a two stage update that copies the file and writes on the copy. Later copies the new file on the old one once they are closed.

#12 Updated by Redmine Admin over 5 years ago

Original Bugzilla ID was 4281

#13 Updated by Daniel Crawl over 3 years ago

  • Assignee changed from Ilkay Altintas to Christopher Brooks

This problem will happen every time "ant update" is run on Windows and build-area/kepler-tasks.jar is updated. What if "ant update" skips build-area/ on Windows, and instead prints a message to run "svn update" manually?

#14 Updated by Christopher Brooks over 3 years ago

Blocked by Bug #6829: ant change-to fails under Windows Server 2012 R2 with Cygwin

#15 Updated by Daniel Crawl over 3 years ago

  • Target version changed from 2.5.0 to 2.X.Y

Also available in: Atom PDF