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

Endpoint security tests can fail with Fleet resource already exists exception #3244

Closed
cmacknz opened this issue Aug 15, 2023 · 4 comments
Closed
Labels
Team:Elastic-Agent Label for the Agent team

Comments

@cmacknz
Copy link
Member

cmacknz commented Aug 15, 2023

Flaky Test

Stack Trace

=== RUN   TestInstallAndCLIUninstallWithEndpointSecurity
    endpoint_security_test.go:68: Enrolling the agent in Fleet
    endpoint_security_test.go:79: Creating enrollment API key...
    endpoint_security_test.go:79: Unpacking and installing Elastic Agent
    fetcher.go:88: Using existing artifact elastic-agent-8.9.1-SNAPSHOT-linux-arm64.tar.gz
    fixture.go:211: Extracting artifact elastic-agent-8.9.1-SNAPSHOT-linux-arm64.tar.gz to /tmp/TestInstallAndCLIUninstallWithEndpointSecurity3653345831/001
    fixture.go:224: Completed extraction of artifact elastic-agent-8.9.1-SNAPSHOT-linux-arm64.tar.gz to /tmp/TestInstallAndCLIUninstallWithEndpointSecurity3653345831/001
    fixture.go:432: Components were not modified from the fetched artifact
    fixture.go:358: >> running agent with: [/tmp/TestInstallAndCLIUninstallWithEndpointSecurity3653345831/001/elastic-agent-8.9.1-SNAPSHOT-linux-arm64/elastic-agent install --force --non-interactive --url https://4f5bd79f886a46c48131adbbd570e673.fleet.us-central1.gcp.qa.cld.elstc.co:443 --enrollment-token RmY3QTk0a0JjSklxdnJJeHFxNXU6enUxcm1udlJTX1MteC1MQXNUNkpuZw==]
    endpoint_security_test.go:79: >>> Ran Enroll. Output: Installing in non-interactive mode.{"log.level":"info","@timestamp":"2023-08-15T05:52:55.407Z","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":478},"message":"Starting enrollment to URL: https://4f5bd79f886a46c48131adbbd570e673.fleet.us-central1.gcp.qa.cld.elstc.co:443/","ecs.version":"1.6.0"}
        {"log.level":"info","@timestamp":"2023-08-15T05:52:56.735Z","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":276},"message":"Successfully triggered restart on running Elastic Agent.","ecs.version":"1.6.0"}
        Successfully enrolled the Elastic Agent.
        Elastic Agent has been successfully installed.
    tools.go:34: Agent status: enrolling
    endpoint_security_test.go:81: Installing Elastic Defend
    endpoint_security_test.go:82: Templating endpoint package policy request
    endpoint_security_test.go:82: POST /api/fleet/package_policies
    endpoint_security_test.go:82: 
        	Error Trace:	/home/ubuntu/agent/testing/integration/endpoint_security_test.go:246
        	            				/home/ubuntu/agent/testing/integration/endpoint_security_test.go:82
        	Error:      	Received unexpected error:
        	            	http error response with code 400: {StatusCode:400 Error:Bad Request Message:Error installing endpoint 8.9.0: resource_already_exists_exception
        	            		Root causes:
        	            			resource_already_exists_exception: index [.fleet-files-endpoint-000001/CSX60CW_T1eSp2iBUnND-A] already exists}
        	Test:       	TestInstallAndCLIUninstallWithEndpointSecurity
    fixture_install.go:116: collecting diagnostics; test failed
    fixture.go:358: >> running agent with: [/opt/Elastic/Agent/elastic-agent diagnostics -f /home/ubuntu/agent/build/diagnostics/TestInstallAndCLIUninstallWithEndpointSecurity-diagnostics-2023-08-15T05:53:43Z.zip]
    fixture.go:358: >> running agent with: [/opt/Elastic/Agent/elastic-agent uninstall --force]
--- FAIL: TestInstallAndCLIUninstallWithEndpointSecurity (83.76s)
@cmacknz cmacknz added the Team:Elastic-Agent Label for the Agent team label Aug 15, 2023
@cmacknz
Copy link
Member Author

cmacknz commented Aug 15, 2023

If this doesn't happen on main we can likely close it, there were fixes on the Fleet side for problems like this.

@cmacknz
Copy link
Member Author

cmacknz commented Aug 15, 2023

The fix I was thinking of should be in 8.9 elastic/kibana#162724

@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

@pierrehilbert
Copy link
Contributor

Seems to not happening anymore. Will close for now.

@pierrehilbert pierrehilbert closed this as not planned Won't fix, can't repro, duplicate, stale Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

No branches or pull requests

3 participants