# Error when installing/enrolling Fleet Server

**URL:** https://discuss.elastic.co/t/error-when-installing-enrolling-fleet-server/332294
**Category:** Elastic Agent
**Tags:** fleet
**Created:** [May 2, 2023, 2:07pm UTC](https://discuss.elastic.co/t/error-when-installing-enrolling-fleet-server/332294 "2023-05-02T14:07:05Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Miguel\_Azorin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miguel_azorin/32/99030_2.png) [@Miguel\_Azorin](https://discuss.elastic.co/u/Miguel_Azorin)
#### Post date: [May 2, 2023, 2:07pm UTC](https://discuss.elastic.co/t/error-when-installing-enrolling-fleet-server/332294/1 "2023-05-02T14:07:05Z")

</div>

Hi,

I've been trying to deploy a Fleet Server (ELK stack 7.17.6), but I'm running into a problem I cannot solve, and the logs don't give enough info for me to figure it out (also, there is nothing about this in the elasticsearch logs).

I've tried running the Fleet Server (elastic agent) both inside and outside of a container, but in both cases I get the following logs when trying to deploy:

```auto
tstrap process.
2023-05-02T15:17:44.005+0200 INFO application/application.go:67 Detecting execution mode
2023-05-02T15:17:44.006+0200 INFO application/application.go:88 Agent is in Fleet Server bootstrap mode
2023-05-02T15:17:44.223+0200 INFO [api] api/server.go:62 Starting stats endpoint
2023-05-02T15:17:44.223+0200 INFO application/fleet_server_bootstrap.go:130 Agent is starting
2023-05-02T15:17:44.224+0200 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)
2023-05-02T15:17:44.225+0200 INFO application/fleet_server_bootstrap.go:140 Agent is stopped
2023-05-02T15:17:44.233+0200 INFO stateresolver/stateresolver.go:48 New State ID is oZZvjHbN
2023-05-02T15:17:44.233+0200 INFO stateresolver/stateresolver.go:49 Converging state requires execution of 1 step(s)
2023-05-02T15:17:44.269+0200 INFO operation/operator.go:284 operation 'operation-install' skipped for fleet-server.7.17.6
2023-05-02T15:17:44.414+0200 INFO log/reporter.go:40 2023-05-02T15:17:44+02:00 - message: Application: fleet-server--7.17.6[]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'
2023-05-02T15:17:44.415+0200 INFO stateresolver/stateresolver.go:66 Updating internal state
2023-05-02T15:17:44.833+0200 INFO cmd/enroll_cmd.go:776 Fleet Server - Starting
2023-05-02T15:17:45.503+0200 ERROR status/reporter.go:236 Elastic Agent status changed to: 'error'
2023-05-02T15:17:45.503+0200 ERROR log/reporter.go:36 2023-05-02T15:17:45+02:00 - message: Application: fleet-server--7.17.6[]: State changed to FAILED: Error - Forbidden - type: 'ERROR' - sub_type: 'FAILED'
2023-05-02T15:17:46.837+0200 INFO cmd/enroll_cmd.go:776 Fleet Server - Error - Forbidden
2023-05-02T15:17:51.534+0200 INFO status/reporter.go:236 Elastic Agent status changed to: 'online'
2023-05-02T15:17:51.534+0200 INFO log/reporter.go:40 2023-05-02T15:17:51+02:00 - message: Application: fleet-server--7.17.6[]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'
2023-05-02T15:17:52.044+0200 ERROR status/reporter.go:236 Elastic Agent status changed to: 'error'
2023-05-02T15:17:52.045+0200 ERROR log/reporter.go:36 2023-05-02T15:17:52+02:00 - message: Application: fleet-server--7.17.6[]: State changed to FAILED: Error - Forbidden - type: 'ERROR' - sub_type: 'FAILED'

```

I've tried using service tokens, username/password, custom certs, the self-signed certs that come with the "quick start" option... etc.

The only interesting thing about the command I'm running is that I'm using "enroll" instead of "install", as I've seen people pointing out that that's how it should be done in .rpm installations. Just in case it's useful, the full command is here:

```auto
elastic-agent enroll --url=https://[KIBANA_AND_FLEET_HOSTNAME]:8220 \
  --fleet-server-es=https://[ELASTIC_NODE_1]:9200 \
  --fleet-server-service-token=AAEAAWVsYXN0a[REDACTED] \
  --fleet-server-policy=[POLICY_ID] \
  --certificate-authorities=[ROUTE_TO_CA] \
  --fleet-server-es-ca=[ROUTE_TO_CA] \
  --fleet-server-cert=[FLEET_SERVER_CERT] \
  --fleet-server-cert-key=[FLEET_SERVER_KEY]

```

Even just a hint to point me into the right direction or a way to get more information about the error would be appreciated. You are also more than welcome to tell me if I'm missing any important info.

Best regards,

Miguel

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [May 2, 2023, 10:55pm UTC](https://discuss.elastic.co/t/error-when-installing-enrolling-fleet-server/332294/2 "2023-05-02T22:55:30Z")

</div>

Hi @Miguel_Azorin

> [@Miguel\_Azorin](#):
>
> `tstrap`

We would need to see the actual agent logs.. not sure (apologies) what tstrap is but those logs don't really look like the raw agent logs ...

I would probably get this all running with tar.gz install and then convert over to .rpm / .dev

When you install with the tar.gz I think you will see the logs in the foreground.

Just my suggestion

---

<div class="post-metadata">

### Author: ![Miguel\_Azorin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miguel_azorin/32/99030_2.png) [@Miguel\_Azorin](https://discuss.elastic.co/u/Miguel_Azorin)
#### Post date: [May 3, 2023, 8:45am UTC](https://discuss.elastic.co/t/error-when-installing-enrolling-fleet-server/332294/3 "2023-05-03T08:45:17Z")

</div>

I apologize, I truncated the first log line accidentally, leaving only `strap`. The lines I truncated are:

```auto
This will replace your current settings. Do you want to continue? [Y/n]:y
2023-05-03T10:25:11.392+0200 INFO cmd/enroll_cmd.go:571 Spawning Elastic Agent daemon as a subprocess to complete bootstrap process.

```

These logs are printed in the foreground when I execute `elastic-agent enroll [PARAMETERS]`. Aren't these the raw agent logs? If not, I will just install the tar.gz version, just as you suggested.

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [May 3, 2023, 2:05pm UTC](https://discuss.elastic.co/t/error-when-installing-enrolling-fleet-server/332294/4 "2023-05-03T14:05:41Z")

</div>

I would install with tar.gz

---

<div class="post-metadata">

### Author: ![Miguel\_Azorin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miguel_azorin/32/99030_2.png) [@Miguel\_Azorin](https://discuss.elastic.co/u/Miguel_Azorin)
#### Post date: [May 4, 2023, 9:58am UTC](https://discuss.elastic.co/t/error-when-installing-enrolling-fleet-server/332294/5 "2023-05-04T09:58:38Z")

</div>

And you would be right.

It is now working, using the same parameters, with the only difference that I've installed it using the tar.gz

Thanks for the help, this would have been pretty hard to figure out for me!

---

<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: [June 1, 2023, 9:59am UTC](https://discuss.elastic.co/t/error-when-installing-enrolling-fleet-server/332294/6 "2023-06-01T09:59:30Z")

</div>

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