@kpollich suggested to transfer the issue from [Fleet] Agents erroneously showing "Agent not upgradeable: agent has been unenrolled" · Issue #202440 · elastic/kibana · GitHub to GitHub - elastic/elastic-agent: Elastic Agent - single, unified way to add monitoring for logs, metrics, and other types of data to a host. .
According to Sign in to GitHub · GitHub I should post the issue here first:
During upgrade 8.15.4 -> 8.16.0 and 8.16.0 -> 8.16.1 some agents apparently experience problems because they populate the field "unenrolled_at" with a timestamp of the hosts next reboot. This renders the agent "not upgradeable". Interestingly they appear "healthy" and "unenrolled" at the same time and ship data as expected by their policies.
Manual re-installation of elastic-agent on the affected hosts (uninstall locally then enroll via Kibana->Fleet with newest version) show the same issue after the next reboot. (See [Fleet] Agents erroneously showing "Agent not upgradeable: agent has been unenrolled" · Issue #202440 · elastic/kibana · GitHub )
Index .fleet-agents shows affected agents without "unenrollment_stared_at" and timestamp of reboot in "unenrolled_at" (upgrade was on Nov. 25th - reboot on Nov. 30th):
I'll upload an agent's log from the day of upgrade (Nov. 25th) on GitHub - elastic/elastic-agent: Elastic Agent - single, unified way to add monitoring for logs, metrics, and other types of data to a host. and put a reference to that here.