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

Standalone agent upgrade failed when 8.12.0 agent is installed with --unprivileged flag. #4127

Closed
amolnater-qasource opened this issue Jan 24, 2024 · 7 comments
Labels
bug Something isn't working impact:high Short-term priority; add to current release, or definitely next. QA:Validated Validated by the QA Team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Comments

@amolnater-qasource
Copy link

Kibana Build details:

VERSION: 8.13.0-SNAPSHOT
BUILD: 70749
COMMIT: a0f4897f7c04069faf2a86dbda1dabea78c161c1
Artifact Link: https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-8.12.0-linux-x86_64.tar.gz

Host OS: Linux- SLES15

Preconditions:

  1. 8.13.0 Snapshot should be available.
  2. 8.12.0 standalone agent should be installed using --unprivileged flag.

Steps to reproduce:

  1. Run agent upgrade command: sudo elastic-agent upgrade 8.13.0-SNAPSHOT
  2. Observe standalone agent upgrade failed with error: Error: failed to check if upgrade is already in progress: failed to get agent state: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial unix /run/elastic-agent.sock: connect: no such file or directory"

Note:

  • Issue is reproducible on two different VMs.

Screenshot:
image

What's working fine:

  • Issue is not reproducible on Linux- SLES15 when standalone agent is installed without --unprivileged flag and agent gets successfully upgraded to 8.13.0.

image
image

  • We are successfully able to upgrade 8.12.0 fleet based agent to 8.13.0 SNAPSHOT when installed with --unprivileged flag

Expected Result:
User should be able to upgrade standalone agent to latest version when installed with --unprivileged flag.

Logs:
Agent diagnostics command failed, hence collected logs manually.
logs.zip

Feature:
https://github.com/elastic/ingest-dev/issues/1766

@amolnater-qasource amolnater-qasource added bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team impact:high Short-term priority; add to current release, or definitely next. labels Jan 24, 2024
@elasticmachine
Copy link
Contributor

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

@amolnater-qasource
Copy link
Author

@manishgupta-qasource Please review.

@manishgupta-qasource
Copy link

Secondary review for this ticket is Done

@blakerouse
Copy link
Contributor

8.12 Elastic Agent with unprivileged mode has an issue that will not be fixed as it was experimental in 8.12. Please only do testing with 8.13+ versions for unprivileged mode.

8.13->8.13 upgrade was also recently fixed requiring the older 8.13 to at least have been built after Jan 21 because of #4093. If you using a 2 snapshot versions after Jan 21 then upgrading from snapshot to snapshop works.

@amolnater-qasource
Copy link
Author

Thank you for looking into this @blakerouse

Could you please confirm if we can test it from 8.12.1>8.13.0, once 8.12.1 is available?

Thanks!

@blakerouse
Copy link
Contributor

This will not be fixed in 8.12 at all. You will need to test 8.13 upgrading to 8.13 snapshot or 8.14 snapshot. --unprivileged is completely broken on 8.12 and wasn't fix as its considered experimental.

You should also run the upgrade as non-root. As in you should not call sudo elastic-agent upgrade, it instead should either be sudo -u elastic-agent elastic-agent upgrade or you can add your user to the elastic-agent group and then just run elastic-agent upgrade without sudo.

@amolnater-qasource amolnater-qasource added the QA:Ready For Testing Code is merged and ready for QA to validate label Mar 8, 2024
@amolnater-qasource
Copy link
Author

Hi Team,

We have revalidated this issue on latest 8.14.0 BC4 kibana cloud environment and found it fixed now:

Observations:

  • Standalone agent upgraded successfully to 8.14.0 when 8.13.4 agent is installed with --unprivileged flag.

Screenshot:
image

image

image

Build details:
VERSION: 8.14.0 BC4
BUILD: 73836
COMMIT: 23ed1207772b3ae958cb05bc4cdbe39b83507707

Hence we are closing and marking this issue as QA:Validated.

Thanks!

@amolnater-qasource amolnater-qasource added QA:Validated Validated by the QA Team and removed QA:Ready For Testing Code is merged and ready for QA to validate labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working impact:high Short-term priority; add to current release, or definitely next. QA:Validated Validated by the QA Team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

No branches or pull requests

4 participants