locked
Lab Center Environments stuck in "Preparing" RRS feed

  • Question

  • I have recently upgraded to TFS 2012 and I am trying to re-establish my distributed testing environment.  My environment consists of all physical machines.  I have created 4 new test environments in MTM (configured to run UI tests) and they all have a status of "Preparing".  They all have a warning stating "The operation on this environment did not make any progress for some duration now.  Visual Studio Team Foundation Background Job Agent service might have abruptly stopped.  Contact adminstrator to have the service restarted."

    I have checked my TFS machine and the Background Job Agent is running.

    Each one of my physical machines has the new 2012 agent installed and they are connected to their test controller with a status of Online. 

    If I open any of my test environments in MTM, I see a message stating: "Settings cannot be modified because the environment was not in one of the following states when this wizard was opened: Ready and Not ready."

    I am currently unable to execute any tests thru MTM.

    And I am also currently unable to modify or delete any of the four test environments I have created.

    Any help would be greatly appreciated.

    • Moved by Charles-Li Thursday, August 1, 2013 6:45 AM This thread belongs to MTM
    Wednesday, July 31, 2013 6:02 PM

Answers

  • I deleted the Cache folder, then de-registered and re-registed the controller with TFS with no issues.  The event logs had no error messages.

    There apperas to be an issue when MTM attempts to configure a test agent.  It will install the test agent and configure it, but that is when the environment gets stuck in the "Preparing" state.  I have found that if I manually configure a 2012 test agent, then I can successfully create a lab envrionment and it will achieve the "Ready" state.

    In order to delete the "Preparing" lab environments.  I had to use the SQL server management studio to manually clean up the LabSystem, LabEnvironment and LabObject tables.  Once these tables were scrubbed, I was able to create the approprate lab environments.

    One observation, when MTM configured the test agents, the "Register with Test Controller" field was just the controllerName, not the controllerName:6901 as given by the example text under the text field.  Not sure if this is why when I manually configure a test agent with controllerName:6901 the environments are achieving a "Ready" state, it is just a difference that I noticed.

    Best Regards,

    Tuesday, August 6, 2013 8:06 PM

All replies

  • Thursday, August 1, 2013 3:09 PM
  • Thanks for the reply. 

    I have checked that thread and it doesn't fix my issue.  The tfsconfig lab /delete command the thread references needs SCVMM to be installed on the TFS Server, however, my server is not on a domain and the SCVMM requires a domain account for install. 

    I currently have Lab Environments that are stuck in Preparing, and I cannot delete or edit them.

    I was able to configure one Lab Environment that actually made it to Ready status, but after deleting it and trying to reproduce the steps that allowed for a successful environment creation it is now stuck in the Preparing state.  So, I cannot use that machine for further environment creation tests because creating a new environment fails the verification check for the reason that the test machine is already part of an existing environment (one that is "Preparing" and unable to be deleted).

    Regards,

    Thursday, August 1, 2013 8:55 PM
  • Hi,

    Let's try the following steps to narrow down the root causes your issue:

    1). Delete the local cache on your machine by deleting the folder: C:\Users\visong\AppData\Local\Microsoft\Team Foundation\4.0\Cache

    2). Check whether the Test Controller registers the Team Project Collection correctly. See the
    Installing and configuring a test controller part in this article for further information:  http://msdn.microsoft.com/en-us/library/vstudio/hh546460.aspx

    3). Take a look at the event logs in the event logs in the Event Viewer, if there is any related error message, please post here.

    Thanks.


    Vicky Song
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, August 2, 2013 3:55 PM
  • Hi I Rushing,

    Please remember to mark the replies as answers if they help. If you have any questions, please let us know.

    Thanks

    Best Regards


    Starain Chen
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, August 6, 2013 3:28 PM
  • I deleted the Cache folder, then de-registered and re-registed the controller with TFS with no issues.  The event logs had no error messages.

    There apperas to be an issue when MTM attempts to configure a test agent.  It will install the test agent and configure it, but that is when the environment gets stuck in the "Preparing" state.  I have found that if I manually configure a 2012 test agent, then I can successfully create a lab envrionment and it will achieve the "Ready" state.

    In order to delete the "Preparing" lab environments.  I had to use the SQL server management studio to manually clean up the LabSystem, LabEnvironment and LabObject tables.  Once these tables were scrubbed, I was able to create the approprate lab environments.

    One observation, when MTM configured the test agents, the "Register with Test Controller" field was just the controllerName, not the controllerName:6901 as given by the example text under the text field.  Not sure if this is why when I manually configure a test agent with controllerName:6901 the environments are achieving a "Ready" state, it is just a difference that I noticed.

    Best Regards,

    Tuesday, August 6, 2013 8:06 PM
  • Hi,

    Firstly, I am very glad to hear that you have found a workaround to deal with your issue.

    And as per my experience, it is OK to register the test agent with just the controllerName. Maybe there are many network traffic, or user account permission issue which cause your system just in "Preparing" lab environment state.

    Thanks. 


    Vicky Song
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by Ahetejaz Thursday, September 22, 2016 8:42 AM
    Wednesday, August 7, 2013 7:21 AM
  • I think I'm experiencing the same issue.  Where is the database...? What is its name?

    thx

    ej

    Thursday, November 7, 2013 12:24 AM
  • I also found the same workaround of deleting rows associated with the stuck lab environment out of labenvironment, labsystem, and labobject tables in the TFS database. 

    Each installation of TFS has an underlying SQL Server database installed with it on the server.  Check with the person that installed TFS at your site or your TFS Admin.  Ours is called VS-Team, which may be the default name. 

    You can use Microsoft SQL Server Management Studio to access the TFS database, find your lab environment entries in these tables and delete them.

    Regards.

    Friday, August 5, 2016 3:19 PM
  • Hi Testadora,

    I have done the same things as per this thread. However I am unable to run my automated methods from MTM. Could you please look into the issue and suggest some thing.

    Link for the thread I have for the issue - https://social.msdn.microsoft.com/Forums/en-US/86eadc99-3ee8-42c8-8ff3-19e7994b35ec/tfs-labmanager-2015-update-3-environment-stuck-in-pending-status?forum=vsmantest

    Thanks & Regards,

    Ahetejazahmad Khan.


    Ahetejazahmad Khan.

    Thursday, September 22, 2016 8:44 AM