locked
Release Manager for VS 2013 - failure with stopping Windows service RRS feed

  • Question

  • Hi All,

    Please could anyone help with the following.

    Release failed to stop Windows service (see details below).

    Permissions look OK.

    The RM service account is a local admin on the target host.

    I can perform other release operations like copying to this host, so connectivity or Network speed is not an issue.

    I tested connecting to the host and restarting the service under the service account credentials. Had no problem with this.

    The service's "log on as" property is using a different account, which I'm not sure is an issue as the RM service account can stop and start the service.

    Error details:

    The log content is:

    Microsoft Release Management ManageWindowsServices PowerShell Script v12.0
    Copyright (c) 2013 Microsoft. All rights reserved.

    Executing with the following parameters:
      Action: Stop
      Server Name: 
      Service Name: MyService
      Binary Path: 

    The error screenshot:


      User: 
      Password: Is not specified
      Start Mode: 
      Display Name: 
      Description: 


    Andrei


    • Edited by Andreyni Thursday, March 9, 2017 12:47 PM
    Thursday, March 9, 2017 12:01 PM

Answers

  • Hi Andreyni,

    Sorry for the delay. It is not a bug, but you could still submit your uservoice to the following link about this issue, TFS Product Team is listening to your voice there:

    https://visualstudio.uservoice.com/forums/330519-team-services

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Andreyni Monday, March 20, 2017 8:36 AM
    Sunday, March 19, 2017 8:13 AM
    Moderator

All replies

  • Hi Andreyni,

    Thank you for posting here.

    According to the error message, it seems that the stop service operations exceed the default timeout 5 minutes. But we could not change the timeout setting, so I suggest that you could create a new component to use the  Windows Services Manager tool, select the timeout minute more than 5 minutes like 10 minutes. Then add the new component to your release and check the result again.

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 10, 2017 7:04 AM
    Moderator
  • Hi Limitxiao Gao,

    Thank you for your response.

    I created a component with timeout set to 20 minutes, but I got the same error.

    I tried to create a local template that only stops a local service but in that case I got a different error: file not found.

    So to summarize: remotely - I got timeout, locally - file not found.

    I'm not sure if those errors are part of the same issue or not though.

    Could there be something wrong with the "Stop Service" Action, underlying PowerShell environment etc.?

    Some more details:

    The "Stop Service" Action is in the Inventory section:

    Stop Service Stop a Windows Service Windows Services Windows Services Manager Microsoft Active

    TFS connection is OK, Build definition can be selected for the template, but never used as no files are required to stop the service.

    I tried to simulate an extra step that uses the build so I can specify the latest version in the release, but the release failed anyway at the stop service step.


    Andrei




    • Edited by Andreyni Friday, March 10, 2017 3:44 PM
    Friday, March 10, 2017 12:43 PM
  • Hi Andreyni,

    Please check if you could find some error log about this issue in event viewer from Release Management server machine and TFS server machine. It is really hard to trouble-shooting this problem without any other error log.:)

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 13, 2017 7:22 AM
    Moderator
  • Hi Limitxiao Gao,

    The Event Viewer on my local machine (RM error:  file not found) reads the following:

    Timestamp: 10/03/2017 12:37:30
    Message: The system cannot find the file specified: \r\n\r\n   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
       at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.ComponentProcessor.ExecuteProcess(ProcessStartInfo startInfo, String argumentsWithStarsForPassword, Int32 timeoutInMilliseconds)
       at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.ComponentProcessor.InstallComponentForDeployerImplementation(String application, String arguments, String argumentsWithStarsForPassword, Func`3 accountForPowerShellBug, Func`2 verifySecurityRestriction, Func`2 fileExists, Func`4 executeProcess, Action writeProcessOutputLog, Action readCustomLog, Action readAutoLog)
       at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.ComponentProcessor.InstallComponentForDeployer(String application, String arguments, String argumentsWithStarsForPassword)
       at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.ComponentProcessor.DeployComponent()
    Category: General
    Priority: -1
    EventId: 0
    Severity: Error
    Title:
    Machine: XXXXXXXXX
    Application Domain: DeploymentAgent.exe
    Process Id: 14124
    Process Name: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Release Management\bin\DeploymentAgent.exe
    Win32 Thread Id: 6052
    Thread Name: 
    Extended Properties: 

    I'm requested the content of the event viewer from the remote host (where I had timeout error). Will paste it when I get it.

    Incidentally, I bumped into this blog: RM Agent access denied - UAC

    Not sure if it's relevant, will try to arrange switching it off and test.

    Thank you again for your support.


    Andrei

    Monday, March 13, 2017 9:30 AM
  • Hi Andreim

    After you switch it off, what is the result? Is there any update? Please feel free to come back.

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, March 14, 2017 9:46 AM
    Moderator
  • Hi Limitxiao Gao,

    The UNC was already switched off.
    I decided to try a different service and chose a spooler system service instead of the app service I was using for my test.

    The RM stopped the spooler service without any issues.
    So now I need to figure out why it can't stop the app service and the main problem is that I see absolutely nothing in the Event Viewer and the RM fails with the timeout error.

    I will try to arrange to run the deployment agent in verbose mode followign suggestions from this site.

    Hopefully after that I will have more information captured in the log.

    Do you happen to know how I can filter the events related to the deployment agent?
    For example when I stopped the spooler service I could see in the Event Viewer that the service was stopped but I could not find any mentioning of the deployment agent (including the login in the security log, where I was expecting to see the service account I use for the RM server).

    Thanks

    Andrei

    Thursday, March 16, 2017 11:32 AM
  • Looks like I figured out what the problem was.

    The service has 2 names: service name and display name.

    If the service name is used all works fine, but the display name for some reason causes the time out error.

    It's relevant to mention that a dummy name will produce "Service not exist" error, so it's the display name that :

    a. Does not produce the invalid name error

    b. Hangs the operation until timeout.

    Could it be a bug or a feature? Is it worth mentioning this behavior to Microsoft for them to look into it?



    Andrei

    Thursday, March 16, 2017 12:26 PM
  • Hi Andreyni,

    Sorry for the delay. It is not a bug, but you could still submit your uservoice to the following link about this issue, TFS Product Team is listening to your voice there:

    https://visualstudio.uservoice.com/forums/330519-team-services

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Andreyni Monday, March 20, 2017 8:36 AM
    Sunday, March 19, 2017 8:13 AM
    Moderator
  • Hi Limitxiao Gao,

    Thank you for advising and interesting URL. I did not know you can vote for the features.

    I marked the queation as answered.

    Thank you again.

    Andrei

    Monday, March 20, 2017 8:38 AM
  • Hi Andreyni,

    You are welcome. Please feel free to come back if you have any other problem in the future.:)

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 20, 2017 8:40 AM
    Moderator