# Error enroll fleet-server

**URL:** https://discuss.elastic.co/t/error-enroll-fleet-server/306759
**Category:** Elastic Security
**Tags:** elastic-stack-security, fleet, elastic-agent
**Created:** [June 9, 2022, 6:15am UTC](https://discuss.elastic.co/t/error-enroll-fleet-server/306759 "2022-06-09T06:15:53Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![alipujaistopo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alipujaistopo/32/50791_2.png) [@alipujaistopo](https://discuss.elastic.co/u/alipujaistopo)
#### Post date: [June 9, 2022, 6:15am UTC](https://discuss.elastic.co/t/error-enroll-fleet-server/306759/1 "2022-06-09T06:15:53Z")

</div>

hey everyone,

i just try to enroll fleet-agent. but its error. here's my command

```auto
> bin/elastic-agent enroll --url=https://192.168.88.147:8220 \
> --fleet-server-es=http://192.168.88.147:9200 \
> --fleet-server-service-token=AAEAAWVsYXN0aWMvZmxlZXQtc2VydmVyL3Rva2VuLTE2NTQ3Nzg2MjIwNjI6UnJuVlctSFpTbmlzVUxYUGZhMnVMUQ \
> --fleet-server-policy=499b5aa7-d214-5b5d-838b-3cd76469844e \
> --certificate-authorities=/usr/share/elasticsearch/ca/ca.crt \
> --fleet-server-es-ca=/usr/share/elasticsearch/elastic-stack-ca.p12 \
> --fleet-server-cert=/usr/share/elasticsearch/ca/ca.crt \
> --fleet-server-cert-key=/usr/share/elasticsearch/ca/ca.key

```

and here's the error

```auto
2022-06-09T21:11:13.688+0700 INFO cmd/enroll_cmd.go:571 Spawning Elastic Agent daemon as a subprocess to complete bootstrap process.
2022-06-09T21:11:13.823+0700 INFO application/application.go:67 Detecting execution mode
2022-06-09T21:11:13.823+0700 INFO application/application.go:88 Agent is in Fleet Server bootstrap mode
2022-06-09T21:11:13.944+0700 INFO [api] api/server.go:62 Starting stats endpoint
2022-06-09T21:11:13.944+0700 INFO application/fleet_server_bootstrap.go:130 Agent is starting
2022-06-09T21:11:13.944+0700 INFO [api] api/server.go:64 Metrics endpoint listening on: /var/lib/elastic-agent/data/tmp/elastic-agent.sock (configured: unix:///var/lib/elastic-agent/data/tmp/elastic-agent.sock)
2022-06-09T21:11:13.944+0700 INFO application/fleet_server_bootstrap.go:140 Agent is stopped
2022-06-09T21:11:13.946+0700 INFO stateresolver/stateresolver.go:48 New State ID is 8A25iVxA
2022-06-09T21:11:13.946+0700 INFO stateresolver/stateresolver.go:49 Converging state requires execution of 1 step(s)
2022-06-09T21:11:13.977+0700 INFO operation/operator.go:284 operation 'operation-install' skipped for fleet-server.7.17.4
2022-06-09T21:11:14.068+0700 INFO log/reporter.go:40 2022-06-09T21:11:14+07:00 - message: Application: fleet-server--7.17.4[]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'
2022-06-09T21:11:14.068+0700 INFO stateresolver/stateresolver.go:66 Updating internal state
2022-06-09T21:11:14.587+0700 INFO log/reporter.go:40 2022-06-09T21:11:14+07:00 - message: Application: fleet-server--7.17.4[]: State changed to RESTARTING: exited with code: 1 - type: 'STATE' - sub_type: 'STARTING'
2022-06-09T21:11:14.587+0700 INFO log/reporter.go:40 2022-06-09T21:11:14+07:00 - message: Application: fleet-server--7.17.4[]: State changed to RESTARTING: Restarting - type: 'STATE' - sub_type: 'STARTING'
2022-06-09T21:11:14.587+0700 INFO log/reporter.go:40 2022-06-09T21:11:14+07:00 - message: Application: fleet-server--7.17.4[]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'
2022-06-09T21:11:14.689+0700 INFO cmd/enroll_cmd.go:776 Fleet Server - Restarting
2022-06-09T21:11:15.104+0700 INFO log/reporter.go:40 2022-06-09T21:11:15+07:00 - message: Application: fleet-server--7.17.4[]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'
2022-06-09T21:11:16.695+0700 INFO cmd/enroll_cmd.go:776 Fleet Server - Starting
2022-06-09T21:12:18.951+0700 WARN status/reporter.go:236 Elastic Agent status changed to: 'degraded'
2022-06-09T21:12:18.951+0700 INFO log/reporter.go:40 2022-06-09T21:12:18+07:00 - message: Application: fleet-server--7.17.4[]: State changed to DEGRADED: Missed last check-in - type: 'STATE' - sub_type: 'RUNNING'
2022-06-09T21:13:13.689+0700 INFO cmd/run.go:184 Shutting down Elastic Agent and sending last events...
2022-06-09T21:13:13.690+0700 INFO operation/operator.go:216 waiting for installer of pipeline 'default' to finish
2022-06-09T21:13:13.690+0700 INFO process/app.go:176 Signaling application to stop because of shutdown: fleet-server--7.17.4
2022-06-09T21:13:18.956+0700 ERROR status/reporter.go:236 Elastic Agent status changed to: 'error'
2022-06-09T21:13:18.957+0700 ERROR log/reporter.go:36 2022-06-09T21:13:18+07:00 - message: Application: fleet-server--7.17.4[]: State changed to FAILED: Missed two check-ins - type: 'ERROR' - sub_type: 'FAILED'
2022-06-09T21:13:44.723+0700 INFO status/reporter.go:236 Elastic Agent status changed to: 'online'
2022-06-09T21:13:44.723+0700 INFO log/reporter.go:40 2022-06-09T21:13:44+07:00 - message: Application: fleet-server--7.17.4[]: State changed to STOPPED: Stopped - type: 'STATE' - sub_type: 'STOPPED'
2022-06-09T21:13:44.723+0700 INFO cmd/run.go:192 Shutting down completed.
2022-06-09T21:13:44.723+0700 INFO [api] api/server.go:66 Stats endpoint (/var/lib/elastic-agent/data/tmp/elastic-agent.sock) finished: accept unix /var/lib/elastic-agent/data/tmp/elastic-agen

```

---

<div class="post-metadata">

### Author: ![Edoardo\_Tenani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/edoardo_tenani/32/94302_2.png) [@Edoardo\_Tenani](https://discuss.elastic.co/u/Edoardo_Tenani)
#### Post date: [June 9, 2022, 2:27pm UTC](https://discuss.elastic.co/t/error-enroll-fleet-server/306759/2 "2022-06-09T14:27:47Z")

</div>

Hi @alipujaistopo, it seems the Elastic Agent is not able to start some related processes (the state goes to degraded before stopping).  
I suggest to check if there are other errors in other log files related to the agent, as those may provide further insights.

---

<div class="post-metadata">

### Author: ![alipujaistopo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alipujaistopo/32/50791_2.png) [@alipujaistopo](https://discuss.elastic.co/u/alipujaistopo)
#### Post date: [June 10, 2022, 3:23am UTC](https://discuss.elastic.co/t/error-enroll-fleet-server/306759/3 "2022-06-10T03:23:38Z")

</div>

where i should check the log?

---

<div class="post-metadata">

### Author: ![Edoardo\_Tenani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/edoardo_tenani/32/94302_2.png) [@Edoardo\_Tenani](https://discuss.elastic.co/u/Edoardo_Tenani)
#### Post date: [June 15, 2022, 6:50am UTC](https://discuss.elastic.co/t/error-enroll-fleet-server/306759/4 "2022-06-15T06:50:50Z")

</div>

Probably in ` data/elastic-agent-*/logs/elastic-agent-json.log` and `data/elastic-agent-*/logs/default/*-json.log`, or if you have installed the Agent you can look at the [Installation layout](https://www.elastic.co/guide/en/fleet/master/installation-layout.html)

---

<div class="post-metadata">

### Author: ![alipujaistopo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alipujaistopo/32/50791_2.png) [@alipujaistopo](https://discuss.elastic.co/u/alipujaistopo)
#### Post date: [June 15, 2022, 9:18am UTC](https://discuss.elastic.co/t/error-enroll-fleet-server/306759/5 "2022-06-15T09:18:39Z")

</div>

how about this? what's wrong with this?

```auto
2022-06-16T00:17:24.656+0700 INFO cmd/enroll_cmd.go:571 Spawning Elastic Agent daemon as a subprocess to complete bootstrap process.
2022-06-16T00:17:24.791+0700 INFO application/application.go:67 Detecting execution mode
2022-06-16T00:17:24.792+0700 INFO application/application.go:88 Agent is in Fleet Server bootstrap mode
2022-06-16T00:17:24.945+0700 INFO [api] api/server.go:62 Starting stats endpoint
2022-06-16T00:17:24.945+0700 INFO application/fleet_server_bootstrap.go:130 Agent is starting
2022-06-16T00:17:24.945+0700 INFO [api] api/server.go:64 Metrics endpoint listening on: /var/lib/elastic-agent/data/tmp/elastic-agent.sock (configured: unix:///var/lib/elastic-agent/data/tmp/elastic-agent.sock)
2022-06-16T00:17:24.947+0700 INFO application/fleet_server_bootstrap.go:140 Agent is stopped
2022-06-16T00:17:24.948+0700 INFO stateresolver/stateresolver.go:48 New State ID is GOf8afVg
2022-06-16T00:17:24.948+0700 INFO stateresolver/stateresolver.go:49 Converging state requires execution of 1 step(s)
2022-06-16T00:17:24.979+0700 INFO operation/operator.go:284 operation 'operation-install' skipped for fleet-server.7.17.4
2022-06-16T00:17:25.136+0700 INFO log/reporter.go:40 2022-06-16T00:17:25+07:00 - message: Application: fleet-server--7.17.4[]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'
2022-06-16T00:17:25.136+0700 INFO stateresolver/stateresolver.go:66 Updating internal state
2022-06-16T00:17:25.658+0700 INFO cmd/enroll_cmd.go:776 Fleet Server - Starting
2022-06-16T00:17:26.655+0700 WARN status/reporter.go:236 Elastic Agent status changed to: 'degraded'
2022-06-16T00:17:26.655+0700 INFO log/reporter.go:40 2022-06-16T00:17:26+07:00 - message: Application: fleet-server--7.17.4[]: State changed to DEGRADED: Running on policy with Fleet Server integration: 499b5aa7-d214-5b5d-838b-3cd76469844e; missing config fleet.agent.id (expected during bootstrap process) - type: 'STATE' - sub_type: 'RUNNING'
2022-06-16T00:17:27.660+0700 INFO cmd/enroll_cmd.go:757 Fleet Server - Running on policy with Fleet Server integration: 499b5aa7-d214-5b5d-838b-3cd76469844e; missing config fleet.agent.id (expected during bootstrap process)
2022-06-16T00:17:28.511+0700 INFO cmd/enroll_cmd.go:454 Starting enrollment to URL: https://192.168.88.147:8220/
2022-06-16T00:17:29.236+0700 INFO cmd/enroll_cmd.go:258 Elastic Agent has been enrolled; start Elastic Agent
Successfully enrolled the Elastic Agent.
2022-06-16T00:17:29.236+0700 INFO cmd/run.go:184 Shutting down Elastic Agent and sending last events...
2022-06-16T00:17:29.237+0700 INFO operation/operator.go:216 waiting for installer of pipeline 'default' to finish
2022-06-16T00:17:29.237+0700 INFO process/app.go:176 Signaling application to stop because of shutdown: fleet-server--7.17.4
2022-06-16T00:17:30.737+0700 INFO status/reporter.go:236 Elastic Agent status changed to: 'online'
2022-06-16T00:17:30.738+0700 INFO cmd/run.go:192 Shutting down completed.
2022-06-16T00:17:30.738+0700 INFO log/reporter.go:40 2022-06-16T00:17:30+07:00 - message: Application: fleet-server--7.17.4[]: State changed to STOPPED: Stopped - type: 'STATE' - sub_type: 'STOPPED'
2022-06-16T00:17:30.738+0700 INFO [api] api/server.go:66 Stats endpoint (/var/lib/elastic-agent/data/tmp/elastic-agent.sock) finished: accept unix /var/lib/elastic-agent/data/tmp/elastic-agent.sock: use of closed network connection

```

---

<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: [July 13, 2022, 9:19am UTC](https://discuss.elastic.co/t/error-enroll-fleet-server/306759/6 "2022-07-13T09:19:16Z")

</div>

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