# Error: fail to checkin to fleet-server

**URL:** <https://discuss.elastic.co/t/error-fail-to-checkin-to-fleet-server/292453>\
**Category:** Endpoint Security\
**Tags:** elastic-stack-security, fleet\
**Created:** [December 20, 2021, 11:23am UTC](https://discuss.elastic.co/t/error-fail-to-checkin-to-fleet-server/292453 "2021-12-20T11:23:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![IrekOp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/irekop/32/98678_2.png) [@IrekOp](https://discuss.elastic.co/u/IrekOp)\
**Post date:** [December 20, 2021, 11:23am UTC](https://discuss.elastic.co/t/error-fail-to-checkin-to-fleet-server/292453/1 "2021-12-20T11:23:17Z")

</div>

Hi!

- I'm using Elastic Cloud SIEM
- My elastic agent is installed in AWS on EC2
- Elastic agent has policy with integrations: system (send system logs & metrics), fleet server & office 365 Logs (module integration)  
On Friday I've added the office 365 Logs module and the agent stopped working (went offline). This is what logs are currently on agents itself.

```auto
11:59:57.517 elastic_agent
[elastic_agent][error] Could not communicate with fleet-server Checking API will retry, error: fail to checkin to fleet-server: Post "https://ip-17X-XX-X-XX4.eu-central-1.compute.internal:XXXX/api/fleet/agents/21XXXXXX91/checkin?": dial tcp 17X-XX-X-XX4:XXXX: connect: connection refused
12:06:23.837 elastic_agent
[elastic_agent][error] Could not communicate with fleet-server Checking API will retry, error: fail to checkin to fleet-server: Post "https://ip-17X-XX-X-XX4.eu-central-1.compute.internal:XXXX/api/fleet/agents/21XXXXXX91/checkin?": dial tcp 17X-XX-X-XX4:XXXX: connect: connection refused
12:13:02.547 elastic_agent
[elastic_agent][error] Could not communicate with fleet-server Checking API will retry, error: fail to checkin to fleet-server: Post "https://ip-17X-XX-X-XX4.eu-central-1.compute.internal:XXXX/api/fleet/agents/21XXXXXX91/checkin?": dial tcp 17X-XX-X-XX4:XXX: connect: connection refused

```

Before adding office 365 module, agents was online and was sending system logs & metrics.

The agent is stuck on the error since then.

Edit:  
I connected to EC2 instance and run ./elastic-agent  
Output:

```auto
sudo ./elastic-agent
2021-12-20T11:27:10.441Z INFO application/application.go:67 Detecting execution mode
2021-12-20T11:27:10.448Z INFO application/application.go:76 Agent is managed locally
2021-12-20T11:27:10.448Z INFO capabilities/capabilities.go:59 capabilities file not found in /home/ec2-user/elastic-agent-7.15.0-linux-x86_64/capabilities.yml
2021-12-20T11:27:10.874Z INFO [composable.providers.docker] docker/docker.go:43 Docker provider skipped, unable to connect: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
2021-12-20T11:27:10.875Z INFO [api] api/server.go:62 Starting stats endpoint
2021-12-20T11:27:10.878Z INFO application/local_mode.go:168 Agent is starting
2021-12-20T11:27:10.878Z INFO application/local_mode.go:172 Agent is stopped
Error: listen tcp 127.0.0.1:6789: bind: address already in use

```

---

<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:** [January 17, 2022, 11:23am UTC](https://discuss.elastic.co/t/error-fail-to-checkin-to-fleet-server/292453/2 "2022-01-17T11:23:34Z")

</div>

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