# Multiple fleet entries cleanup

**URL:** https://discuss.elastic.co/t/multiple-fleet-entries-cleanup/341141
**Category:** Kibana
**Tags:** fleet
**Created:** [August 19, 2023, 5:03am UTC](https://discuss.elastic.co/t/multiple-fleet-entries-cleanup/341141 "2023-08-19T05:03:26Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)
#### Post date: [August 19, 2023, 5:03am UTC](https://discuss.elastic.co/t/multiple-fleet-entries-cleanup/341141/1 "2023-08-19T05:03:26Z")

</div>

Hello,

in my fleet management there's 3 entries for the agent on one machine. Two of them are obsolete.  
I wonder what is happening if i uninstall with the one fleet server i need for management?

Is it somehow possible to remove this entries without destroying the working fleet server?

Thx G.

---

<div class="post-metadata">

### Author: ![Julia\_Bardi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julia_bardi/32/79463_2.png) [@Julia\_Bardi](https://discuss.elastic.co/u/Julia_Bardi)
#### Post date: [August 21, 2023, 12:01pm UTC](https://discuss.elastic.co/t/multiple-fleet-entries-cleanup/341141/2 "2023-08-21T12:01:38Z")

</div>

Hi,

You can safely unenroll the agents you don't need as described here: [Unenroll Elastic Agents | Fleet and Elastic Agent Guide [8.9] | Elastic](https://www.elastic.co/guide/en/fleet/8.9/unenroll-elastic-agent.html)

---

<div class="post-metadata">

### Author: ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)
#### Post date: [August 22, 2023, 9:06am UTC](https://discuss.elastic.co/t/multiple-fleet-entries-cleanup/341141/3 "2023-08-22T09:06:29Z")

</div>

Hello Julia,

unfortunately this did not work.

There had been 3 entries in the list on the same machine.

After i removed the 2 obsolete ones - they had no activity - the remaining one came into a strange situation.

If i ask for the agent state i get this:

State: HEALTHY  
Message: Running  
Fleet State: STARTING  
Fleet Message: (no message)  
Components:

- fleet-server (HEALTHY)  
Healthy: communicating with pid '1299'
- udp (HEALTHY)  
Healthy: communicating with pid '1306'
- filestream (HEALTHY)  
Healthy: communicating with pid '1313'
- beat/metrics (HEALTHY)  
Healthy: communicating with pid '1314'
- http/metrics (HEALTHY)  
Healthy: communicating with pid '1329'

In GUI the fleet server is not available.

Well - this is a test environment and i will no "go hunting" for a solution...

---

<div class="post-metadata">

### Author: ![Julia\_Bardi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julia_bardi/32/79463_2.png) [@Julia\_Bardi](https://discuss.elastic.co/u/Julia_Bardi)
#### Post date: [August 22, 2023, 9:24am UTC](https://discuss.elastic.co/t/multiple-fleet-entries-cleanup/341141/4 "2023-08-22T09:24:51Z")

</div>

Can you check in agent logs if you see any error messages? You can request the diagnostics bundle with this command: `elastic-agent diagnostics collect`

---

<div class="post-metadata">

### Author: ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)
#### Post date: [August 22, 2023, 10:26am UTC](https://discuss.elastic.co/t/multiple-fleet-entries-cleanup/341141/5 "2023-08-22T10:26:27Z")

</div>

it's currently running. I am getting some warning but this seems to be a known issue:

[WARNING] Could not redact state.yaml due to unmarshalling error: yaml: invalid map key: map[interface {}]interface {}{"unitid":"fleet-server-default-fleet-server-fleet\_server-bad6ee92-babd-4f47-a612-eb78cb0f27ea", "unittype":0}

I wonder if it really takes so much time but i will be patient ...

---

<div class="post-metadata">

### Author: ![Julia\_Bardi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julia_bardi/32/79463_2.png) [@Julia\_Bardi](https://discuss.elastic.co/u/Julia_Bardi)
#### Post date: [August 22, 2023, 10:56am UTC](https://discuss.elastic.co/t/multiple-fleet-entries-cleanup/341141/6 "2023-08-22T10:56:29Z")

</div>

Yeah that warning is not relevant, anything else in the logs that explains why the agent is stuck in starting state?

---

<div class="post-metadata">

### Author: ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)
#### Post date: [August 22, 2023, 11:13am UTC](https://discuss.elastic.co/t/multiple-fleet-entries-cleanup/341141/7 "2023-08-22T11:13:43Z")

</div>

well - the command is still running? guess there's a problem and the diag will not be collected ...  
I can check in the agent log directly...

---

<div class="post-metadata">

### Author: ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)
#### Post date: [August 22, 2023, 3:47pm UTC](https://discuss.elastic.co/t/multiple-fleet-entries-cleanup/341141/8 "2023-08-22T15:47:12Z")

</div>

i am a bit confused now. After hours, the fleet error went away. The agent still did not communicate. I guess i will need to investigate further and check the log in detail.  
As far as it kooks to me now - deleting the obsolete agent entries in the fleet management somehow had negative impact on the agent running on the server.

---

<div class="post-metadata">

### Author: ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)
#### Post date: [August 22, 2023, 7:18pm UTC](https://discuss.elastic.co/t/multiple-fleet-entries-cleanup/341141/9 "2023-08-22T19:18:50Z")

</div>

Hello Julia,

after some testing i found out, that this might be a kind of "reboot" and "timing" issue.  
I made an upgrade of the operating system and rebooted the machine.  
After some while the fleet server was still not available. All i needed to do was stoping and starting the "elastic-agent" and the fleet Server came back.

This seems to be reproducable on my test machine.

So i was on the wrong path - the main issue is the agent and not the "remove obsolete ....". Sorry for this.

Next issue i will try to solve is an agent that is up to date but still showing "updating" in the fleet. For this there's some info available and i will check if it works for me also.

Have a good time and thank you for supporting me.

---

<div class="post-metadata">

### Author: ![Julia\_Bardi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julia_bardi/32/79463_2.png) [@Julia\_Bardi](https://discuss.elastic.co/u/Julia_Bardi)
#### Post date: [August 23, 2023, 8:05am UTC](https://discuss.elastic.co/t/multiple-fleet-entries-cleanup/341141/10 "2023-08-23T08:05:42Z")

</div>

Which version of agent are you using? The issue with agent not starting up after reboot sounds similar to this that we fixed in 8.9: [[SLES15]: Fleet-server Agent gets into offline state on machine reboot. · Issue #2431 · elastic/fleet-server · GitHub](https://github.com/elastic/fleet-server/issues/2431)  
"updating" status can happen if the agent hasn't checked in yet, or an upgrade has started that is in progress.  
We have this support article about agents stuck in updating: [Elastic Support Hub](https://support.elastic.co/knowledge/92a0dafc)

---

<div class="post-metadata">

### Author: ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)
#### Post date: [August 23, 2023, 11:57am UTC](https://discuss.elastic.co/t/multiple-fleet-entries-cleanup/341141/11 "2023-08-23T11:57:50Z")

</div>

> [@Julia\_Bardi](#):
>
> we fixed in 8.9

i am at 8.8.2 and now i am updating to 8.9.1. Thx for the hint...  
Regarding the "stuck updating" agent - i wil manually upgrade to 8.9.1 to see if the problem i going away.

---

<div class="post-metadata">

### Author: ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)
#### Post date: [August 23, 2023, 1:16pm UTC](https://discuss.elastic.co/t/multiple-fleet-entries-cleanup/341141/12 "2023-08-23T13:16:22Z")

</div>

funny - agent updated to 8.9.1 an the version changed but the state still is wrong. Guess i will read your support documents now...

---

<div class="post-metadata">

### Author: ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)
#### Post date: [August 24, 2023, 6:28am UTC](https://discuss.elastic.co/t/multiple-fleet-entries-cleanup/341141/13 "2023-08-24T06:28:24Z")

</div>

so - i found my own solution as the supposed ones seemed to be "not easy" Finding out the "superuser" credentials nand handling the commandy - well, cost a lot of time.

My way was to unenroll the agent, remove it form the system manually and re-install it.

Worked fine 😉

Now there's a new question but i will put it into a new thread.

Thanks for any help provided. i learned a lot.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 21, 2023, 6:28am UTC](https://discuss.elastic.co/t/multiple-fleet-entries-cleanup/341141/14 "2023-09-21T06:28:53Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
