1

When we do team builds using tfs 2013 we occasionally get the following error:

Exception Message: Unable to create the workspace '41_9_UKBOLTFS6' due to a mapping conflict. You may need to manually delete an old workspace. You can get a list of workspaces on a computer with the command 'tf workspaces /computer:%COMPUTERNAME%'. 
Details: The path C:\xxx\xxx\xxx is already mapped in workspace 41_9_UKBOLTFS6. (type MappingConflictException)

If we kick off a new build it may succeed, if not we try again and eventually it works without any changes.

I have seen very similar questions posted on stackoverflow about this but non where the workspaces it is complaining about are the same '41_9_UKBOLTFS6'.

We migrated most of our builds from TFS2010 but not all and we never had this issue before.

Does anyone know what is going on?

CeejeeB
  • 3,034
  • 4
  • 25
  • 32
  • Did you do the thing that the error message suggested? – Daniel Mann Apr 30 '14 at 13:22
  • @DanielMann Yes and it solved the issue temporarily but it just comes back after a few more builds. – CeejeeB May 14 '14 at 10:51
  • possible duplicate of [Team Build Error: The Path ... is already mapped to workspace](http://stackoverflow.com/questions/226288/team-build-error-the-path-is-already-mapped-to-workspace) – Daniel Mann Aug 12 '15 at 13:35

3 Answers3

3

This occurs (as the error suggests) when you have a workspace clash on the build server. Workspaces are saved as configuration values in the TFS database so clashes are possibly caused by:

  • you have created a new build definition with the same name as a previous build definition.
  • some part of your workspace name (or an artifact within your project) is over 260 chars
  • build definition is not using $(sourcedir) macro in System Settings tab

More details are explained in this article

Possible work-around:

Rename your build definition to something unique.

Mark Cooper
  • 6,738
  • 5
  • 54
  • 92
  • 1
    I had this problem due to creating a new build definition that replaced an older one and I used the same name. – Jazaret Sep 17 '15 at 14:40
  • This should be marked as an answer! I created build with name of removed build and get this error as well. – RredCat Nov 18 '15 at 11:40
0

Looks like you have multiple team builds mapped to the same local directory. Make sure that the Working Directory in all your agents are unique and there is no absolute path in workspace settings of your build definitions

Hamid Shahid
  • 4,486
  • 3
  • 32
  • 41
  • All our agents have a unique working directory and non of our builds have absolutes paths. – CeejeeB Apr 30 '14 at 15:02
  • And do you have $(BuildDefinitionId) in Agent's Working Directory path? The only reason I can think of it failing intermittently is that there is some other build activity taking place. Also, is this a gated build, in which case you need to see if the build prior to failing build failed for some reason – Hamid Shahid Apr 30 '14 at 15:17
-1

I've run to this issues and blogged about my solution without renaming the build definition. Check it out here: https://christiaanmolendijk.nl/2016/05/23/before-stressing-out-tfs-cache-folder-on-build-server/

Summary of the link:

  1. Go to cache folder: {userprofile}\AppData\Local\Microsoft\Team Foundation\{version}\Cache
  2. Edit file VersionControl.config in Volatile folder
  3. Then go back to the cache folder at {userprofile}\AppData\Local\Microsoft\Team Foundation\{version}\Cache and delete the folders with a GUID as name.
Tunaki
  • 132,869
  • 46
  • 340
  • 423
C. Molendijk
  • 2,614
  • 3
  • 26
  • 35