Error: TFSDeployerConfiguration2 is already mapped in workspace

Apr 22, 2009 at 9:16 PM
Suddenly TFSDeployer doesn't work on my box. This was fine yesterday. This is on my local box in a "run as other user" command prompt.

I can't figure out what it's complaining about. I've tried removing the two temp folders. I've done "tf workspaces" and see no workspaces defined for the account I'm running the deployer under.

Any ideas?

Thank you.

Hit Enter to stop the service
tfsdeployer Information: 0 : Build Status Changed: Team Project Users  Team Build Version: 04229.3 From  : Development
tfsdeployer Information: 0 : Reading Configuration for Team Projet:Users Team Build:ClickOnceTest
tfsdeployer Information: 0 : Getting files from $/Users/TeamBuildTypes/ClickOnceTest/Deployment to C:\Users\svcTFSDeploy
er\AppData\Local\Temp\TFSDeployerConfiguration2
tfsdeployer Information: 0 : Getting files from Source code control. RootFolder:$/Users/TeamBuildTypes/ClickOnceTest/Dep
loyment, Workspace Directory:C:\Users\svcTFSDeployer\AppData\Local\Temp\TFSDeployerConfiguration2
tfsdeployer Information: 0 : Getting Workspace:3d0f2681-597a-4d09-a4ce-75553ea4b78f RootFolder:$/Users/TeamBuildTypes/Cl
ickOnceTest/Deployment
tfsdeployer Information: 0 : Build Status Changed: Team Project Users  Team Build Version: 04229.3 From Development : De
velopment
tfsdeployer Information: 0 : Reading Configuration for Team Projet:Users Team Build:ClickOnceTest
tfsdeployer Information: 0 : Getting files from $/Users/TeamBuildTypes/ClickOnceTest/Deployment to C:\Users\svcTFSDeploy
er\AppData\Local\Temp\TFSDeployerConfiguration2
tfsdeployer Information: 0 : Getting files from Source code control. RootFolder:$/Users/TeamBuildTypes/ClickOnceTest/Dep
loyment, Workspace Directory:C:\Users\svcTFSDeployer\AppData\Local\Temp\TFSDeployerConfiguration2
tfsdeployer Information: 0 : Build Status Changed: Team Project Users  Team Build Version: 04229.3 From Development : De
velopment
tfsdeployer Information: 0 : Getting Workspace:1233f893-26bd-42c2-8985-61ad74f24a21 RootFolder:$/Users/TeamBuildTypes/Cl
ickOnceTest/Deployment
tfsdeployer Information: 0 : Reading Configuration for Team Projet:Users Team Build:ClickOnceTest
tfsdeployer Information: 0 : Removing Workspace1233f893-26bd-42c2-8985-61ad74f24a21
tfsdeployer Information: 0 : Getting files from $/Users/TeamBuildTypes/ClickOnceTest/Deployment to C:\Users\svcTFSDeploy
er\AppData\Local\Temp\TFSDeployerConfiguration2
tfsdeployer Information: 0 : Getting files from Source code control. RootFolder:$/Users/TeamBuildTypes/ClickOnceTest/Dep
loyment, Workspace Directory:C:\Users\svcTFSDeployer\AppData\Local\Temp\TFSDeployerConfiguration2
tfsdeployer Information: 0 : Getting Workspace:37d70088-b412-4430-9c4b-539fc94e315f RootFolder:$/Users/TeamBuildTypes/Cl
ickOnceTest/Deployment
tfsdeployer Information: 0 : Removing Workspace37d70088-b412-4430-9c4b-539fc94e315f
tfsdeployer Information: 0 : Build Status Changed: Team Project Users  Team Build Version: 04229.3 From Development : De
velopment
tfsdeployer Error: 0 : Microsoft.TeamFoundation.VersionControl.Client.MappingConflictException: The path C:\Users\svcTFS
Deployer\AppData\Local\Temp\TFSDeployerConfiguration2 is already mapped in workspace 3d0f2681-597a-4d09-a4ce-75553ea4b78
f.
   at Microsoft.TeamFoundation.VersionControl.Client.InternalCache.CheckForMappingConflicts(WorkspaceInfo workspace)
Apr 23, 2009 at 2:41 PM
Anyone? Anyone? ...

Bueller?
May 27, 2009 at 4:55 PM

I have run into this problem as well.  While I don't have a permanent fix, there is a blog posting I found that might be of some use, http://blogs.msdn.com/buckh/comments/750598.aspx.  It seems the problem is caused by the VersionControl cache not getting cleared out on the build server.  TFS stores a local cache in a file "...\Documents and settings\{user}\LocalSettings\Application Data\Microsoft\Team Foundation\2.0\Cache\VersionControl.config".  If you look at that file on your build server, you will likely see an entry for the workspace that is "already mapped" in your TFSDeployer output.  Deleting this file will clear the cache and should solve the problem temporarily, but that doesn't keep it from happening again.  If anyone has any ideas for an update to the TFSDeployer code to handle this permanently, please post it.  This blog mentions a couple of command line options that will clear out this cache, one possible solution to this problem would be to script those commands and schedule them to run periodically in the task scheduler.  You could maybe do this with the "tf workspaces /remove:*"  command which should clear out all of the workspaces in the cache.  This is not an ideal solution, but it might keep things running for now. 

Jeremy

May 28, 2009 at 12:54 PM

Thanks, Jeremy.

We struggled with this for about an hour and then just gave up for the day. This was a month ago, so I forget exactly what we tried, but I know clearing the cache was one of them. Of course, it simply "fixed itself" the next morning. :(

Nov 30, 2011 at 6:50 PM

I've had this same issue off and on as well, and I've not had consistent success fixing it. Clearing the cache on it's own didn't seem to fix the problem. Today, however, I tried clearing the cache and then restarting the TFSDeployer service. I then got a different error stating "Microsoft.TeamFoundation.VersionControl.Client.WorkingFolderInUseException: The working folder C:\Documents and Settings\{user}\Local Settings\Temp\TFSDeployerConfiguration2 is already in use by the workspace {guid}". I then delete the workspace and everything seemed to work fine. To delete the workspace, I just ran visual studio as same user that TFSDeployer runs under and deleted it through Source Control Explorer, however, you could do this through the command line as well.

If anyone else has this same problem, please reply and let the rest of the world know if this fixed the issue or if there were additional steps that needed to be done.

Coordinator
Dec 9, 2011 at 10:20 PM

Which version of TFS Deployer is exhibiting this behaviour of workspaces not always being cleaned up? Some work was done to the code base a while ago to prevent this situation occurring but if it still happening then any additional information you can provide would be great.

Thanks,

Jason