-
Notifications
You must be signed in to change notification settings - Fork 154
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
Agent .deb install: state.enc not copied during Elastic Agent upgrade from 8.13 and above #5101
Comments
Likely issue is at elastic-agent/dev-tools/packaging/templates/linux/postrm.sh.tmpl Lines 12 to 26 in ca5a07c
short term fix would be to not remove the symlink during an upgrade, but long term I think we need to seriously evaluate if a symlink left on the system after a package has been removed is the best way to determine where configuration information is in a package manager environment. |
Confirmed the following change is sufficient for the upgrade to work.
|
Hi @leehinman, Confirmed - works for me, thanks :) |
@leehinman - An unrelated question: is there any reason the agent is shut down after an upgrade? We have our automation restart the service after an upgrade so it's not a major issue for us, but I'd expect it to be restarted rather than stopped. |
Confirmed that this is still an issue on 8.16.0. Install 8.14.3, enrolled into Fleet, and then upgraded to 8.16.0. Had to manually restart the
|
I have identified the issue and determined that upgrading of DEB (I haven't done any testing of the RPM yet) has never worked properly if the Elastic Agent is enrolled into Fleet. The order of which debian runs the maintainer scripts is not in the order that they Elastic Agent built the maintainer scripts to run. The current implementation makes the assumption that It is possible to fix the issue in 8.16+ and then all upgrades from 8.16+ to a later version work correctly. This is not a great way of fixing this issue, because it causes already installed pre-8.16 versions to not be upgradable. I am working on a solution where a |
Description
When upgrading Elastic Agent from version 8.13 or above (e.g., 8.14.1 to 8.14.2), the
state.enc
file is not copied to the new install directory. This causes the agent to remain in a(STARTING) Waiting for initial configuration and composable variables
state.Steps to Reproduce
Observations Post Upgrade
Issue
The
postinst
script fails to correctly follow the symlink to the old agent directory, leading to the failure to copystate.enc
. This leaves the agent in a broken state where it believes it is enrolled in Fleet but lacks the necessary state information.Additional Notes
Upgrading from versions prior to 8.13 (e.g., from 8.12.2 to 8.14.2) successfully copies the
state.enc
file, indicating the issue is likely related to changes introduced in version 8.13.The text was updated successfully, but these errors were encountered: