elastic/elastic-agent

Uninstall on Windows unprivileged mode can fail to kill watchers

blakerouse opened this issue · 1 comments

When Elastic Agent is installed in unprivileged mode on Windows and uninstall is performed it is possible that uninstall will fail to find/kill any running watchers.

[  ==] Successfully stopped service  [0s] 
                                                

[ ===] Stopping upgrade watcher (4284)  [0s] 
                                                

[ ===] Failed to find and stop watcher processes  [0s] 
                                                       

[ ===] Failed to uninstall current Elastic Agent  [0s] Error uninstalling. Printing logs
        Error: error installing package: failed to uninstall Agent at (C:\Program Files\Elastic): failed trying to kill any running watcher: failed to kill watcher process with pid 4284: DuplicateHandle: Access is denied.
        For help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/8.14/fleet-troubleshooting.html
        
    logs_ingestion_test.go:90: 
        	Error Trace:	C:/Users/windows/agent/testing/integration/logs_ingestion_test.go:90
        	Error:      	Received unexpected error:
        	            	unable to enroll Elastic Agent: error running agent install command: exit status 1
        	Test:       	TestLogIngestionFleetManaged
--- FAIL: TestLogIngestionFleetManaged (11.20s)

This was identified from the PR that adds upgrade testing for Windows in unprivileged mode. #4642

For confirmed bugs, please report:

  • Version: 8.14+
  • Operating System: Windows (unprivileged)

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)