Elastic Agent broken

Thank you for providing such an wonderful tool to monitor and logs.

But unfortunately recent times Elastic agent corrupted frequently.

Elastic Agent is installed but currently broken: service exists but installation path is missing
Continuing will uninstall the broken Elastic Agent at /opt/Elastic/Agent. Do you want to continue? [Y/n]:
This will happens after restart the agent. Please help us to fix this issue.

Thanks

can you share command which you are executing for installing elastic agent?

I realized it actually depends on whether you already installed Elastic Agent using *.deb or *.rpm. If this is the case, you need to use elastic-agent enroll... instead of elastic-agent installed...
If you used the Elastic Agent TAR file, extract it, then navigate to the archive folder, from there you can now use elastic-agent install... command

Read More here.