Containerized Fleet Server failing

Hello. I am trying to run a containerized fleet server. I am running a docker container pulled using this command:

docker pull docker.elastic.co/beats/elastic-agent:8.6.2

But when I run the container I get a number of errors in the logs. Here is a sample of those error messages:

{"log.level":"error","@timestamp":"2023-03-16T19:00:15.591Z","message":"Fleet Server failed","component":{"binary":"fleet-server","dataset":"elastic_agent.fleet_server","id":"fleet-server-default","type":"fleet-server"},"log":{"source":"fleet-server-default"},"ecs.version":"1.6.0","service.name":"fleet-server","error.message":"EOF","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2023-03-16T19:00:15.591Z","log.origin":{"file.name":"coordinator/coordinator.go","file.line":857},"message":"Unit state changed fleet-server-default-fleet-server (STARTING->FAILED): Error - EOF","log":{"source":"elastic-agent"},"component":{"id":"fleet-server-default","state":"HEALTHY"},"unit":{"id":"fleet-server-default-fleet-server","type":"input","state":"FAILED","old_state":"STARTING"},"ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2023-03-16T19:00:15.591Z","log.origin":{"file.name":"coordinator/coordinator.go","file.line":857},"message":"Unit state changed fleet-server-default (STARTING->FAILED): Error - EOF","log":{"source":"elastic-agent"},"component":{"id":"fleet-server-default","state":"HEALTHY"},"unit":{"id":"fleet-server-default","type":"output","state":"FAILED","old_state":"STARTING"},"ecs.version":"1.6.0"}

Here is the command I am running to start up the container:

docker run -e FLEET_SERVER_ENABLE=1 -e FLEET_SERVER_INSECURE_HTTP=true -e FLEET_SERVER_HOST=0.0.0.0 -e FLEET_SERVER_POLICY_ID=fleet-server-policy -e KIBANA_FLEET_SETUP=1 -e ELASTICSEARCH_USERNAME=elastic -e ELASTICSEARCH_PASSWORD=elastic -e KIBANA_HOST=http://ac8500af373d:5601 -e ELASTICSEARCH_HOST=http://facdb24c8cdd:9200 --net elastic --rm docker.elastic.co/beats/elastic-agent:8.6.2

When I run the command, Kibana outputs the following log messages:

[2023-03-16T19:06:59.846+00:00][INFO ][plugins.fleet] Beginning fleet setup
[2023-03-16T19:07:00.149+00:00][INFO ][plugins.fleet] Fleet setup completed
[2023-03-16T19:07:00.163+00:00][INFO ][plugins.fleet] Beginning fleet setup
[2023-03-16T19:07:00.400+00:00][INFO ][plugins.fleet] Fleet setup completed

And Elasticsearch outputs the following log messages:

{"@timestamp":"2023-03-16T19:08:09.708Z", "log.level": "WARN", "message":"received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/172.24.0.2:9200, remoteAddress=/172.24.0.4:59480}", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"elasticsearch[facdb24c8cdd][transport_worker][T#4]","log.logger":"org.elasticsearch.xpack.security.transport.netty4.SecurityNetty4HttpServerTransport","elasticsearch.cluster.uuid":"YJPezNz-Qs2IeF5WaMieJA","elasticsearch.node.id":"vNvEouvlSIqFVYTixzwEBA","elasticsearch.node.name":"facdb24c8cdd","elasticsearch.cluster.name":"docker-cluster"}

Any help trying to understand these errors and why my containerized fleet server is failing would be greatly appreciated.

Your elasticsearch is configured to use https, but you have something sending data using http, so it is rejecting the connection.

I think that this may be the issue, try to use https:// instead of http://

Hello. Okay, I changed it to https, but now I am receiving the following error when trying to run the fleet server container:

{"log.level":"error","@timestamp":"2023-03-17T12:49:34.128Z","log.origin":{"file.name":"coordinator/coordinator.go","file.line":857},"message":"Unit state changed fleet-server-default (STARTING->FAILED): Error - x509: certificate signed by unknown authority","log":{"source":"elastic-agent"},"component":{"id":"fleet-server-default","state":"HEALTHY"},"unit":{"id":"fleet-server-default","type":"output","state":"FAILED","old_state":"STARTING"},"ecs.version":"1.6.0"}

Any idea about what I can do to fix this error?

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