# Elastic-Agent unexpectedly gets unenrolled (Version 8.16.x)

**URL:** <https://discuss.elastic.co/t/elastic-agent-unexpectedly-gets-unenrolled-version-8-16-x/371463>\
**Category:** Beats\
**Tags:** fleet\
**Created:** [December 4, 2024, 11:54am UTC](https://discuss.elastic.co/t/elastic-agent-unexpectedly-gets-unenrolled-version-8-16-x/371463 "2024-12-04T11:54:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![syk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/syk/32/141533_2.png) [@syk](https://discuss.elastic.co/u/syk)\
**Post date:** [December 4, 2024, 11:54am UTC](https://discuss.elastic.co/t/elastic-agent-unexpectedly-gets-unenrolled-version-8-16-x/371463/1 "2024-12-04T11:54:02Z")

</div>

@kpollich suggested to transfer the issue from [[Fleet] Agents erroneously showing "Agent not upgradeable: agent has been unenrolled" · Issue #202440 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/202440) to [GitHub - elastic/elastic-agent: Elastic Agent - single, unified way to add monitoring for logs, metrics, and other types of data to a host.](https://github.com/elastic/elastic-agent) .  
According to [Sign in to GitHub · GitHub](http://github.com/elastic/elastic-agent/issues/new?template=bug-report.md) 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.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/b/3b0a6c1b087926fb1b944c7982244ed1cbcf3be8.png)

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](https://github.com/elastic/kibana/issues/202440#issuecomment-2511759812) )

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):  
 ![Screenshot 2024-12-04 105122](https://us1.discourse-cdn.com/elastic/optimized/3X/f/5/f58904228bbc27af529f17263d68d32d1a3bdc77_2_690x61.png)

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.](https://github.com/elastic/elastic-agent) and put a reference to that here.

---

<div class="post-metadata">

**Author:** ![syk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/syk/32/141533_2.png) [@syk](https://discuss.elastic.co/u/syk)\
**Post date:** [December 5, 2024, 9:55am UTC](https://discuss.elastic.co/t/elastic-agent-unexpectedly-gets-unenrolled-version-8-16-x/371463/2 "2024-12-05T09:55:21Z")

</div>

reference to agent's log: [Elastic-Agents unexpectedly unenrolled after update to 8.16.x · Issue #6213 · elastic/elastic-agent · GitHub](https://github.com/elastic/elastic-agent/issues/6213#issuecomment-2519769627)
