-
Notifications
You must be signed in to change notification settings - Fork 155
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
Missing .installed
file prevents uninstall or upgrade
#4051
Comments
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
EDIT: It seems that it has been introduced by #2500 |
Missing the elastic-agent/internal/pkg/agent/application/upgrade/upgrade.go Lines 62 to 68 in bf513a5
elastic-agent/internal/pkg/agent/application/paths/common.go Lines 301 to 310 in bf513a5
We should consider relaxing the |
For the problem Alex is describing we may be able to improve this by just creating the |
.installed
file, agent reports deceptive error message.installed
file prevents uninstall or upgrade
Hello, Was this backported to 8.12? We are hitting this issue on 8.12.1 where we cannot uninstall an Agent nor force install it again. What is the workaround to be able to uninstall the Agent? Can we just stop/kill the service, remove the folder and try to install it again? |
It was not backported to 8.12 as there isn't a planned 8.12.3 release (at least not yet).
The easiest fix would be to create the
We were unable to identify any mechanism by which this file could be missing besides the installation process being interrupted. If you know how you got into this situation that would be valuable to know.
This would also work, unless you installed Elastic Defend, and then you additionally need to use the |
Hello @cmacknz , We've tried already to add the
We opened a ticket on support asking for the workaround on this issue. We are not using Elastic Defend, so I will try to ask the infra team to remove the service and the folder and then try to install again. I'm not sure what got our agents in this states, but the installation is being done by some automation, a couple of the agents that had this issue had some network problem were they could not enroll with fleet, and then got in this state, the Elastic Agent service is not running and cannot be started as well. In resume, the agents that weren't able to enroll on fleet got stuck on this state where we cannot uninstall nor force install them. |
Hmm, the encrypted vault seems to have gotten into a bad state. I've never seen this happen before. We must have been interrupted while setting it up and the code doesn't handle this situation properly. You could try running |
Hello @cmacknz We tried to use This error also happened during the enroll process when we tried again after removing the Elastic folder and the Elastic Agent service. For some reason we were not able to install the Agent on a couple of servers, it enters in a broken install state. We are automating this installation, the elastic agent installer is executed from a network share, this avoid having to copy the installer to hundreds of machines, unpack it and then have the installer copy itself to the destination path. This worked for almos 50 servers, but for 2 of them both agents entered on a broken install state, as a last resort we tried to install it directly from the host, not using the automation script the uses the network installer and this time it worked. I have an open ticket with support, being able to install from network without issues like that is a requirement, if you want I can provide the logs we saved from our last atempt. |
@aleksmaus do you have any idea how we could recover from this situation where the agent key for the vault is somehow missing? @leandrojmp I see your support ticket has made its way to engineering now as well with another one of our engineers assigned to investigate. |
Manual removal is always an option. I did a quick test:
|
While trying to fix a broken install on a test machine, an attempt at running
elastic-agent install
failed, and a followinguninstall
command failed:There's two problems here:
.installed
file in the root directory is missing.can only be uninstalled by executing the installed Elastic Agent at: /usr/bin/elastic-agent
message is a bit deceptive. It doesn't actually care about what path you're running the binary from, but instead it's checking the validity of the install:We should print a message that more accurately describes why we bailed out of the uninstall process.
The text was updated successfully, but these errors were encountered: