i have download the .tar.gz elastic agent version 9.1
after extract it, i got error when running the installation
sudo ./elastic-agent install \
--fleet-server-es=https://redacted \
--fleet-server-service-token=redacted \
--fleet-server-policy=fleet-server-policy \
--fleet-server-es-ca-trusted-fingerprint=redacted \
--fleet-server-port=8220 \
--install-servers
Installed as a system package, installation will not be altered.
[ ] Failed to Enroll [0s] Error uninstalling. Printing logs
Error: failed to execute enroll command: fork/exec /usr/bin/elastic-agent: no such file or directory
For help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/9.1/fleet-troubleshooting.html
i forgot to give another info, i miss download and install the arm64 linux one instead of x86_64
when i install it, the log shows like this
./elastic-agent: 1: ELF�@8: not found
./elastic-agent: 2: @%$@@@0pppL0LMNN
�
0�0�0�0P�dLMLLMLLML� not found
./elastic-agent: 2: � not found
./elastic-agent: 2: Q�dMNR�dMNN� not found
./elastic-agent: 3: � not found
./elastic-agent: 4: /lib/ld-linux-aarch64.so.1GNUSGoHpK7IeWlq96IQeXsoVj3/i3ea7Cb9xdzmNLjFQhKz/pxjP8ciBVSxEwhYjCIds/YpyI2LPTNrPr8-9zAnxZGNUAkDe[� not found
./elastic-agent: 1: Syntax error: Unterminated quoted string
My VM is Ubuntu with x86_64 architecture
I wrongly install the arm64 one, then i download the x86_64 and do the install fleet server. The logs shows like this
Installed as a system package, installation will not be altered.
[ ] Failed to Enroll [0s] Error uninstalling. Printing logs
Error: failed to execute enroll command: fork/exec /usr/bin/elastic-agent: no such file or directory
For help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/9.1/fleet-troubleshooting.html
I can't do sudo /opt/Elastic/Agent/elastic-agent uninstall because the /opt/Elastic/Agent is empty
I would try to install the correct package... Again
Then whether it installs correctly or not. I would then try to uninstall it using the correct command...
Let us know if that works or not. I might have a couple other hack suggestions at this point, but trying to install the wrong architecture is bad and we should probably warn you about that but at this point we need to get you fixed.
I suspect you have a package installed with the architecture wrong and trying to uninstall it with the different architecture isn't working but we need to give it a try.
I have been do that, install and uninstall again and got frustated because nothing works with .tar.gz installation. So i decided to use the deb package installation to make it work but i know i can't easily upgrade version when available via fleet.
However, The tar.gz on Ubuntu x86 works fine... it has been installed 1000s of times, I have installed it many times myself.
The problem is that the initial installation was installed with the wrong architecture, which unpacked the files but would not install / uninstall because the binaries were unexecutable... == bad state.
Then the installation directories were manually removed.... == bad state
Just recapping...
So your system is in a broken/inconsistent state... Badly
So what I would probably do is the following... as an extreme / hack / workaround
Go to another Uhbutu x86 and install the agent as a standalone, it probably does not really matter if it fully connects etc, just that the install uppacks etc.
Then I would tar up the /opt/Elastic/Agent directory...
Copy that to your broken machine
Untar It into /opt/Elasti/Agent
Make sure the permissions and executables are correct
Make sure the directory and files look the same as on the other / correct machine
Also, copy the /usr/bin/elastic-agent over to the broken system NOTE this is a script do not just copy the one from the /opt directory they are different
Then run the
sudo /opt/Elastic/Agent/elastic-agent uninstall
Command
See what happens
Then try to reinstall correctly
Then I would probably uninstall one more time to make sure everything is programmatically cleaned up.
Then I would think you should be in a clean state ...
Then install again...
NO this is not expected but, the system is in a really bad state...
but for now, i successfully install the deb version and use it smoothly. I should remove it first via apt then would it have any issue like this again?
Yes first uninstall the deb package using the appropriate apt command if you want to clean up the other.
To be clear I am not sure my steps will work because I have never had a system in the same state as yours... But its worth a try... I have used similar to clean up other errors I have made.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.