Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to create the workspace '' due to a mapping conflict

I am using TFS 2013 Build Server.

Getting the following Error Exception Message: Unable to create the workspace '' 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 F:\GDC\Bin is already mapped in workspace ''. (type MappingConflictException)

I have multiple build Definition which refers to common binary folder

Source Setting for Build definition BD1
  Source Control Folder                  Build Agentfolder
  $/Common                               F:\GDC\Bin
  $/Project1                             $(SourceDir)

Source Setting for Build defination BD2
  Source Control Folder                  Build Agentfolder
  $/Common                               F:\GDC\Bin
  $/Project2                             $(SourceDir)

Source Setting for Build definition BD3
  Source Control Folder                  Build Agentfolder
  $/Common                               F:\GDC\Bin
  $/Project3                             $(SourceDir)
like image 408
NSS Avatar asked Jan 08 '23 05:01

NSS


2 Answers

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

Work-around:

Rename your build definition to something unique.

like image 192
Mark Cooper Avatar answered Apr 26 '23 18:04

Mark Cooper


Here is how I did it:

  1. First, tried to list the workspaces on the server in question. I tried through both Visual Studio UI and command prompt: tf workspaces /computer:. The workspace that is mentioned in the Exception message did not show up in the list.

  2. Downloaded and installed Team Foundation Sidekicks 2015 from http://www.attrice.info/downloads/

  3. When the app installed, opened and connected to tfs server.

    Screenshot1

  4. Selected the computer name from the dropdown, cleared the Owner name (VERY IMPORTANT!) dropdown from the dropdown and changed Last access date to a date few years ago.

    Screenshot2

  5. Clicked Search button. The list of workspaces appeared. This time I could see the workspace that was mentioned in the Exception message.

  6. Selected the workspace that is mentioned in the Exception message and clicked Delete button.

It appears that when I login to the build server and ask for the workspaces list, tfs only shows me the workspaces of which I am the owner. The temporary workspaces that build process creates were not assigned to me and therefore I could not see them. Team Foundation Sidekicks 2015 did show me all of the workspaces.

Note: I used TFS2015 in this exercise.

like image 28
myroslav Avatar answered Apr 26 '23 18:04

myroslav