-
Notifications
You must be signed in to change notification settings - Fork 204
Description
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:
- the fleet.enc file is in the top directory of the agent
- the vault directory (the encrypted agent secret on linux/windows) is under the hashed data path data/elastic-agent-7a475d
- 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
- the vault is only copied over if upgrade is done via fleet (upgrade handler in the agent) (!!!)
- when the new version of the agent starts from the new location it doesn’t find the vault and creates the new agent key.
- the new version of the agent can’t decrypt existing fleet.enc
For confirmed bugs, please report:
- Version: 8.3.x
- Operating System: Linux/Windows (Non-fleet initiated upgrades)
- Discuss Forum URL: Update to 8.3.1 from 8.3.0 has broken Fleet - please help!
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.