Error when trying to install fleet server (self-managed)

I'm having this error when trying to install the fleet server on a machine, I didn't find anything about the forums and troubleshooting guide, could someone help me?
error:
'missing enrolllment api key'

root@xxxx:/home/elastic-agent-7.14.0-linux-x86_64# elastic-agent enroll  -f --fleet-server-es=https://10.xx.xxx.xxx:8220 --fleet-server-service-token=AAEAAWVsYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX  --fleet-server-es-ca=ca.crt --fleet-server-policy=fc2498e0-e3fd-11eb-XXXXXXXXXXX
2021-08-13T11:11:16.299-0300    INFO    cmd/enroll_cmd.go:354   Generating self-signed certificate for Fleet Server
2021-08-13T11:11:18.599-0300    INFO    cmd/enroll_cmd.go:668   Waiting for Elastic Agent to start Fleet Server
2021-08-13T11:11:21.607-0300    INFO    cmd/enroll_cmd.go:701   Fleet Server - Starting
2021-08-13T11:11:27.621-0300    INFO    cmd/enroll_cmd.go:706   Fleet Server - Starting
2021-08-13T11:11:33.632-0300    INFO    cmd/enroll_cmd.go:706   Fleet Server - Starting
2021-08-13T11:11:39.645-0300    INFO    cmd/enroll_cmd.go:706   Fleet Server - Starting
2021-08-13T11:11:45.657-0300    INFO    cmd/enroll_cmd.go:706   Fleet Server - Starting
2021-08-13T11:11:51.673-0300    INFO    cmd/enroll_cmd.go:706   Fleet Server - Starting
2021-08-13T11:11:57.686-0300    INFO    cmd/enroll_cmd.go:706   Fleet Server - Starting
2021-08-13T11:12:03.702-0300    INFO    cmd/enroll_cmd.go:706   Fleet Server - Starting
2021-08-13T11:12:09.717-0300    INFO    cmd/enroll_cmd.go:706   Fleet Server - Starting
2021-08-13T11:12:15.729-0300    INFO    cmd/enroll_cmd.go:706   Fleet Server - Starting
2021-08-13T11:12:21.746-0300    INFO    cmd/enroll_cmd.go:706   Fleet Server - Starting
2021-08-13T11:12:25.756-0300    INFO    cmd/enroll_cmd.go:682   Fleet Server - Missed last check-in
2021-08-13T11:12:26.193-0300    INFO    cmd/enroll_cmd.go:414   Starting enrollment to URL: https://elastic:8220/
Error: fail to enroll: fail to execute request to fleet-server: 1 error occurred:
        * missing enrollment api key


1 Like

The Fleet Server should only staying in starting for a quick moment, being that it stayed in starting and then missed a check-in means that it is stuck doing something.

Can you provide the logs for the Fleet Server that are located on disk? They should be in the installation folder under data/elastic-agent-${version}/logs/default/fleet-server-*.

here is the last log of the last attempt I made and caused the same error:

{"log.level":"info","@timestamp":"2021-08-26T18:28:20.135Z","log.origin":{"file.name":"application/application.go","file.line":66},"message":"Detecting execution mode","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-08-26T18:28:20.139Z","log.origin":{"file.name":"application/application.go","file.line":87},"message":"Agent is in Fleet Server bootstrap mode","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-08-26T18:28:20.412Z","log.logger":"api","log.origin":{"file.name":"api/server.go","file.line":62},"message":"Starting stats endpoint","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-08-26T18:28:20.412Z","log.origin":{"file.name":"application/fleet_server_bootstrap.go","file.line":124},"message":"Agent is starting","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-08-26T18:28:20.412Z","log.logger":"api","log.origin":{"file.name":"api/server.go","file.line":64},"message":"Metrics endpoint listening on: /opt/Elastic/Agent/data/tmp/elastic-agent.sock (configured: unix:///opt/Elastic/Agent/data/tmp/elastic-agent.sock)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-08-26T18:28:20.414Z","log.origin":{"file.name":"application/fleet_server_bootstrap.go","file.line":134},"message":"Agent is stopped","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-08-26T18:28:20.417Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is 0eii5gE-","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-08-26T18:28:20.418Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 1 step(s)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-08-26T18:28:20.511Z","log.origin":{"file.name":"operation/operator.go","file.line":259},"message":"operation 'operation-install' skipped for fleet-server.7.14.0","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-08-26T18:28:21.039Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-08-26T15:28:21-03:00 - message: Application: fleet-server--7.14.0[]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-08-26T18:28:21.042Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":66},"message":"Updating internal state","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-08-26T18:28:21.601Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-08-26T15:28:21-03:00 - message: Application: fleet-server--7.14.0[]: State changed to RESTARTING: exited with code: 1 - type: 'STATE' - sub_type: 'STARTING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-08-26T18:28:21.602Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-08-26T15:28:21-03:00 - message: Application: fleet-server--7.14.0[]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-08-26T18:28:21.602Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-08-26T15:28:21-03:00 - message: Application: fleet-server--7.14.0[]: State changed to RESTARTING: Restarting - type: 'STATE' - sub_type: 'STARTING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-08-26T18:28:22.162Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-08-26T15:28:22-03:00 - message: Application: fleet-server--7.14.0[]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-08-26T18:29:25.423Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-08-26T15:29:25-03:00 - message: Application: fleet-server--7.14.0[]: State changed to DEGRADED: Missed last check-in - type: 'STATE' - sub_type: 'RUNNING'","ecs.version":"1.6.0"}
{"log.level":"warn","@timestamp":"2021-08-26T18:29:25.423Z","log.origin":{"file.name":"status/reporter.go","file.line":236},"message":"Elastic Agent status changed to: 'degraded'","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-08-26T18:30:25.434Z","log.origin":{"file.name":"status/reporter.go","file.line":236},"message":"Elastic Agent status changed to: 'error'","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-08-26T18:30:25.435Z","log.origin":{"file.name":"log/reporter.go","file.line":36},"message":"2021-08-26T15:30:25-03:00 - message: Application: fleet-server--7.14.0[]: State changed to FAILED: Missed two check-ins - type: 'ERROR' - sub_type: 'FAILED'","ecs.version":"1.6.0"}

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