1 Jul
2009

Vault and CruiseControl.NET Error: Working Folder State Problem

Category:UncategorizedTag: , , , :

This is one of those problems that teaches humility.  I’m posting this here because the solution is a) trivially obvious, any fool could see it and b) I completely overlooked the obvious solution and maybe a google “hint” would have saved me some time.

At Blackfin, we use SourceGear Vault and CruiseControl.net. (We’re moving to Subversion and TeamCity, but that’s a different post.)  One of our projects on one of our CC.NET servers was failing with this exception:

“The working folder state information for C:\CruiseControl.NET\Build\MyProject\working is incompatible with this version of Vault.  Please choose a different working folder path.  The specific compatibility exception was: Could not detect the file type in the supplied stream.”

Vault likes to litter your system with lots of little state files, and on rare occasion these files get corrupted.  To fix, you just delete the local cache directories, re-get repositories, and you’re on your way again.  Piece of cake. 

I deleted all the cache files on this server, from C:\Documents and Settings\{username}\Local Settings\Application Data\SourceGear.  To be thorough, I delete all the cache files I can find for all users.  BUT, the exceptions continue.

Thinking to myself, “well obviously I’ve not deleted the right directory” I run a search for all directories named “Vault_1”, which turns up…nothing.

What follows next is a bunch of flailing about, checking for cc.net bugs, and to sum up: grasping at straws.  What *should* have happened is that I re-read the exception and think carefully about what causes it: a corrupted state file that I haven’t deleted yet.

I run CruiseControl.Net as a service, under the local NetworkService account.  Therefore, I [failed to] reason, the cache files must be in C:\Documents and Settings\NetworkService\Local Settings\Application Data\SourceGear.  But I couldn’t find this directory on the system.  Except that the NetworkService directory is marked as a “protected Operating System file”.  Remember that Folder option “Hide protected operating system files (recommended)” that you always switch off and ignore the dialog box that pops up?  It was still checked…

Uncheck that dumb setting, go into the directory, delete the cache, and now the build works again. 

Lesson: sometimes exceptions tell you exactly what’s wrong.  Don’t be so quick to search for exotic solutions when the obvious one is staring you in the face.