# Elastic agent goes offline & healthy every 5 minutes

**URL:** https://discuss.elastic.co/t/elastic-agent-goes-offline-healthy-every-5-minutes/367215
**Category:** Elastic Agent
**Tags:** fleet
**Created:** [September 27, 2024, 7:07am UTC](https://discuss.elastic.co/t/elastic-agent-goes-offline-healthy-every-5-minutes/367215 "2024-09-27T07:07:01Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![harshpanchal](https://avatars.discourse-cdn.com/v4/letter/h/df788c/32.png) [@harshpanchal](https://discuss.elastic.co/u/harshpanchal)
#### Post date: [September 27, 2024, 7:07am UTC](https://discuss.elastic.co/t/elastic-agent-goes-offline-healthy-every-5-minutes/367215/1 "2024-09-27T07:07:01Z")

</div>

I have an Elastic Stack setup managed by the ECK operator on Kubernetes. I deployed a Fleet Server on Kubernetes and an Elastic Agent on a separate Alpine Linux VM for log shipping. The installation was successful, and the Elastic Agent shows as healthy. I have also configured the output to Kafka, and the data is successfully reaching Kafka. However, it's strange that every 5 minutes, the agent goes offline in Kibana, but then it automatically returns to a healthy state. Even when the agent shows as offline in Kibana, it is still running on the VM. I found only one error in the logs, which is as follows: (I used elastic stack version of 8.15.1)

{  
"log.level": "error",  
"@timestamp": "2024-09-27T06:29:24.871Z",  
"log.origin": {  
"function": "[github.com/elastic/elastic-agent/internal/pkg/agent/application/gateway/fleet.](http://github.com/elastic/elastic-agent/internal/pkg/agent/application/gateway/fleet.)(_FleetGateway).doExecute",  
"file.name": "fleet/fleet\_gateway.go",  
"file.line": 195  
},  
"message": "Cannot checkin in with fleet-server, retrying",  
"log": {  
"source": "elastic-agent"  
},  
"error": {  
"message": "fail to checkin to fleet-server: all hosts failed: 1 error occurred:\n\t_ requester 0/1 to host \<URL\_FOR\_FLEETSERVER\> errored: Post "URL\_FOR\_FLEETSERVER/api/fleet/agents/\<AGENT\_ID\>/checkin?": EOF\n\n"  
},  
"request\_duration\_ns": 30008744594,  
"failed\_checkins": 8,  
"retry\_after\_ns": 702760145637,  
"ecs.version": "1.6.0"  
}

---

<div class="post-metadata">

### Author: ![harshpanchal](https://avatars.discourse-cdn.com/v4/letter/h/df788c/32.png) [@harshpanchal](https://discuss.elastic.co/u/harshpanchal)
#### Post date: [September 27, 2024, 7:09am UTC](https://discuss.elastic.co/t/elastic-agent-goes-offline-healthy-every-5-minutes/367215/2 "2024-09-27T07:09:29Z")

</div>

From #Elasticsearch to #Elastic Agent

---

<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: [October 14, 2024, 7:49am UTC](https://discuss.elastic.co/t/elastic-agent-goes-offline-healthy-every-5-minutes/367215/3 "2024-10-14T07:49:21Z")

</div>

The agents go offline if there wasn't a successful checkin in the last 5 minutes. If they come back online it seems to be a temporary issue. Does the agent host have access to fleet-server?

---

<div class="post-metadata">

### Author: ![harshpanchal](https://avatars.discourse-cdn.com/v4/letter/h/df788c/32.png) [@harshpanchal](https://discuss.elastic.co/u/harshpanchal)
#### Post date: [October 14, 2024, 8:38am UTC](https://discuss.elastic.co/t/elastic-agent-goes-offline-healthy-every-5-minutes/367215/4 "2024-10-14T08:38:43Z")

</div>

Yes the agent installed on a VM has access to fleet server, so far I change the parameter checkin\_long\_poll to 30s which is 5m by default & now it is working but when I try to increase it from 30s again agent gets into offline-heathy loop there is a load-balancer in between I have also configured the timeouts for 5min but still it didn't work

---

<div class="post-metadata">

### Author: ![harshpanchal](https://avatars.discourse-cdn.com/v4/letter/h/df788c/32.png) [@harshpanchal](https://discuss.elastic.co/u/harshpanchal)
#### Post date: [October 16, 2024, 12:45pm UTC](https://discuss.elastic.co/t/elastic-agent-goes-offline-healthy-every-5-minutes/367215/5 "2024-10-16T12:45:24Z")

</div>

As the elastic agent makes a long polling request to fleet server for the configuration check so it opens a connection to server for 5 min, as in my case configuring the timeouts at loadbalancer to required time solves the issue.
