by XDK
31. December 2015 09:30
Exception:
Explanation:
This exception may appear when the lab environments exist with no lab systems.
Workaround:
- Open Microsoft SQL Server Management Studio.
- Connect to the TFS collection database where your team project exist.
- Run the following SQL query to identify the lab environments with no lab systems:
Select le.LabEnvironmentId from LabEnvironment le where le.PartitionId = 1 And NOT EXISTS (Select * From LabSystem ls where ls.LabEnvironmentId = le.LabEnvironmentId AND ls.PartitionId = 1)
- Note the Id's of the lab environment with no lab systems.
- Remove all lab environments with no lab systems, by using the following SQL command for each lab environment IDs:
Exec DeleteLabEnvironment @PartitionId = 1, @labEnvironmentId = <Lab Environment ID>, @namespaceGuid = N'9E4894C3-FF9A-4EAC-8A85-CE11CAFDC6F1', @deleteTestMachines = 1, @pendingOperationId = Null