Sunday, July 18, 2010

CVS, CruiseControl.NET and mysterious errors

After many days of head scratching and trying to come up with the correct google phrase to find a solution to the infamous:
cvs checkout: move away xxx; it is in the way
I finally determined the cause and was then able to identify a post with a solution:

Switching CVS servers easily

It turns out that this error has two likely causes:

  • If you're on Windows then someone might have the same file named with different case. Our CVS server is hosted on a linux platform so that it is possible to store ThisFile.txt and THISFILE.TXT in the same directory. Upon cvs update, windows will try to overwrite the file and complain that the file is already there. This can be more evil if it was at the directory level!
  • The second cause, and the one that I wasn't aware of, is that the value contained in the hidden CVS\Root file must be the same as the CVSROOT value of your client (or environment variable if your client is aware of the %CVSROOT% variable.)


Our problem was that we routinely use multiple clients to access CVS (command line, TortoiseCVS, WinCVS and finally CC.NET as well). Whenever I saw this problem, I would usually log in to the build server and delete the offending directory. That usually works. However, since we had a different CVSROOT value specified in the TortoiseCVS than the one in the CC.NET configuration file, it was possible that the value stored in CVS\Root would be different.

The key is either to make sure that you're CVSROOT file is always the same one, or alternatively, if you suspect this is the issue, then check the CVS\Root file to make sure that it matches up to the one your client is using.

UPDATE

After several attempts I was able to identify yet another cause for the 'cvs checkout: move away xxx; it is in the way' message. Check to make sure that any 'Entries.log' files were removed by your build scripts. In our case we use NAnt and we had a clean target which removed all *.log files and in addition we had specifically ignored the default excludes. The default excludes has a pattern to exclude the hidden CVS directory and any contents of that directory.

So to sum it up, just keep in mind that the single 'cvs checkout: move away xxx; it is in the way' can occur for any of the following reasons:
  1. $CVSROOT (or %CVSROOT%) is different than the value found in the CVS/Root directory. This could also be an issue if you supply the -d {cvsroot} option to the cvs executable.
  2. If your CVS server is located on a case sensitive O/S (Linux for example) and your client is on a case insensitive O/S (Windows), then make sure some has not committed a similarly named directory or file.
  3. Check the Entries and Entries.log files in the hidden CVS directory to make sure that it matches what files are in the corresponding directory. If they don't then it's possible some other process has removed the Entries.log file!

No comments:

Post a Comment