Skip to content

Elastic Agent non-fleet upgrade between 8.3.x releases is broken  #682

@aleksmaus

Description

@aleksmaus

Elastic Agent non-fleet upgrade between 8.3.x released is broken.
The upgrade via fleet works.

The original discussion thread is here:
Update to 8.3.1 from 8.3.0 has broken Fleet - please help!

This is effectively not an upgrade, but install of the different version of the agent without upgrade handling code invoked.

The root cause of the issue is the agent secret is not properly migrated if the new version of the agent is installed on top of the existing agent:

  1. the fleet.enc file is in the top directory of the agent
  2. the vault directory (the encrypted agent secret on linux/windows) is under the hashed data path data/elastic-agent-7a475d
  3. when the new version of the agent is installed with apt it’s installed side by side into it’s own directory something like `data/elastic-agent-3bf26a
  4. the vault is only copied over if upgrade is done via fleet (upgrade handler in the agent) (!!!)
  5. when the new version of the agent starts from the new location it doesn’t find the vault and creates the new agent key.
  6. the new version of the agent can’t decrypt existing fleet.enc

For confirmed bugs, please report:

Possible solution:
In the next release 8.3.3 or 8.4.0 invoke migration code scanning for the existing agent data directories and perform the agent secret migration only if the secret is not found. The migration should probably move up the vault dir to the top agent directory, near fleet.enc file so it can be shared between future installations and would not have to be migrated if the newer version of the agent is installed on top of the existing agent directory from .deb/.rpm for example.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions