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

[8.10](backport #3415) elastic-agent install: Only uninstall when Agent is installed #3472

Merged
merged 2 commits into from
Oct 12, 2023

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Sep 25, 2023

This is an automatic backport of pull request #3415 done by Mergify.
Cherry-pick of 0c43005 has failed:

On branch mergify/bp/8.10/pr-3415
Your branch is up to date with 'origin/8.10'.

You are currently cherry-picking commit 0c43005695.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   internal/pkg/agent/cmd/install.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   internal/pkg/agent/install/install.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

@mergify mergify bot requested a review from a team as a code owner September 25, 2023 18:14
@mergify mergify bot requested review from michalpristas and pchila and removed request for a team September 25, 2023 18:14
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Sep 25, 2023
@elasticmachine
Copy link
Contributor

elasticmachine commented Sep 25, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-10-12T11:52:26.472+0000

  • Duration: 28 min 46 sec

Test stats 🧪

Test Results
Failed 0
Passed 6317
Skipped 55
Total 6372

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Contributor

elasticmachine commented Sep 25, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 98.765% (80/81) 👍
Files 67.944% (195/287) 👍
Classes 66.234% (357/539) 👍
Methods 53.125% (1122/2112) 👍
Lines 38.605% (12759/33050) 👎 -0.039
Conditionals 100.0% (0/0) 💚

@ycombinator
Copy link
Contributor

Several integration tests failed in Buildkite with errors like this one:

    fixture.go:365: >> running agent with: [/tmp/TestInstallWithEndpointSecurityAndRemoveEndpointIntegrationunprotected3086036477/001/elastic-agent-8.10.2-SNAPSHOT-linux-arm64/elastic-agent install --force --non-interactive --url https://408087213e8b4d0ba301c330386e040e.fleet.eastus2.azure.qa.cld.elstc.co:9243 --enrollment-token WmZ2YnpZb0JHT3NOYTB5bHpvb1o6VWhmV0Jpa0JUUU94N20teEZGTUh5QQ==]
    endpoint_security_test.go:358: Installing in non-interactive mode.
        Error: failed to copy source directory (/tmp/TestInstallWithEndpointSecurityAndRemoveEndpointIntegrationunprotected3086036477/001/elastic-agent-8.10.2-SNAPSHOT-linux-arm64) to destination (/opt/Elastic/Agent): symlink data/elastic-agent-2ee5e9/elastic-agent /opt/Elastic/Agent/elastic-agent: file exists

Maybe some previous test didn't finish cleanup? Re-running the Buildkite build to see if this is a transient error...

@ycombinator
Copy link
Contributor

The build is failing again with the same errors as before: #3472 (comment).

 upgrade_test.go:507: Agent installation output: "Installing in non-interactive mode.\nError: failed to copy source directory (/tmp/TestStandaloneUpgradeToSpecificSnapshotBuild2358091522/001/elastic-agent-8.10.2-SNAPSHOT-linux-arm64) to destination (/opt/Elastic/Agent): symlink data/elastic-agent-896177/elastic-agent /opt/Elastic/Agent/elastic-agent: file exists\nFor help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/8.10/fleet-troubleshooting.html\n"

This makes me think there's some PR fixing the testing framework's fixture uninstallation code that probably hasn't been backported to the 8.10 branch. @cmacknz @pchila can you think of any such PR?

@pchila
Copy link
Member

pchila commented Sep 26, 2023

@ycombinator I can't think of any recent PRs that could have affected this behavior. We still rely on the fixture for uninstalling at the end of a test. I am wondering if in some of our testcases we don't detect the agent as "installed" and with this change we have some stuff that is left over...

@ycombinator
Copy link
Contributor

Thanks @pchila. Just strange that we're only seeing this on 8.10 and not on main. As you said, perhaps there's some cleanup code that's present on main but didn't get backported to 8.10. I'll investigate. Thanks!

@ycombinator ycombinator force-pushed the mergify/bp/8.10/pr-3415 branch from f025104 to f02a34c Compare September 29, 2023 19:08
@mergify
Copy link
Contributor Author

mergify bot commented Oct 2, 2023

This pull request has not been merged yet. Could you please review and merge it @ycombinator? 🙏

@ycombinator
Copy link
Contributor

I'm going to revisit this PR once #3495 is merged.

@pierrehilbert pierrehilbert added the Team:Elastic-Agent Label for the Agent team label Oct 8, 2023
@elasticmachine
Copy link
Contributor

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

@mergify
Copy link
Contributor Author

mergify bot commented Oct 9, 2023

This pull request has not been merged yet. Could you please review and merge it @ycombinator? 🙏

* Only uninstall if --force is present

* Improve help text

* Add missing newline

* Don't pass force

* Fix more conflicts

* Fixing compile error introduced while resolving conflicts

(cherry picked from commit 0c43005)

# Conflicts:
#	internal/pkg/agent/install/install.go
@ycombinator ycombinator force-pushed the mergify/bp/8.10/pr-3415 branch from f02a34c to 0195a27 Compare October 12, 2023 11:52
@ycombinator ycombinator merged commit cd23535 into 8.10 Oct 12, 2023
7 of 10 checks passed
@ycombinator ycombinator deleted the mergify/bp/8.10/pr-3415 branch October 12, 2023 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts There is a conflict in the backported pull request Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants