Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop service reports error but succeeds #6

Open
carl-berg opened this issue Sep 10, 2019 · 1 comment
Open

Stop service reports error but succeeds #6

carl-berg opened this issue Sep 10, 2019 · 1 comment

Comments

@carl-berg
Copy link

I'm currently seeing a weird behavior often (but not always) when stopping a service. Output looks like this:

2019-09-10T10:22:27.2951310Z ##[section]Starting: Stop service
2019-09-10T10:22:27.3213685Z ==============================================================================
2019-09-10T10:22:27.3213909Z Task         : Windows Service - Stop
2019-09-10T10:22:27.3214334Z Description  : Stop a windows service
2019-09-10T10:22:27.3214501Z Version      : 1.1.1
2019-09-10T10:22:27.3214642Z Author       : Jungerius IT
2019-09-10T10:22:27.3214781Z Help         : 
2019-09-10T10:22:27.3214927Z ==============================================================================
2019-09-10T10:22:27.3462710Z ##[warning]Task 'StopWindowsService' (1.1.1) is using deprecated task execution handler. The task should use the supported task-lib: https://aka.ms/tasklib
2019-09-10T10:22:27.3486630Z Preparing task execution handler.
2019-09-10T10:22:27.9644224Z Executing the powershell script: C:\azagent\A1\_work\_tasks\StopWindowsService_dce5f7d0-d58a-11e5-9705-6165ece307b2\1.1.1\stopservice.ps1
2019-09-10T10:22:28.2510291Z Stopping MyService...
2019-09-10T10:22:30.3902858Z ##[error]Microsoft.PowerShell.Commands.ServiceCommandException: Service 'MyService (MyService)' stop failed.
2019-09-10T10:22:30.6857689Z Service MyService stopped.
2019-09-10T10:22:30.7231822Z ##[error]PowerShell script completed with 1 errors.
2019-09-10T10:22:30.7245535Z ##[section]Finishing: Stop service
```
@n3wt0n
Copy link

n3wt0n commented Oct 28, 2019

This is 99% caused by the Windows API or the state of your service. I don't think it is related to the task in question.

I'm using this task in a PROD environment succesfully.

Sure thing it would be beneficial having a more detailed log of the error message, but as said I'm pretty confident in saying this is not related to the task but to the service you're trying to stop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants