Closed ppf2 closed 3 years ago
Pinging @elastic/fleet (Team:Fleet)
With debugging enabled for fleet server for when it terminates after receiving the agent enrollment request:
{"log.level":"info","service.name":"fleet-server","service.name":"fleet-server","mod":"enroll","agentId":"8129fd31-d998-49c0-b39a-b5934886b6ac","policyId":"dd4cf0f0-fad4-11eb-af6b-5fc91fbedd64","apiKeyId":"6MmDN3sBdnSvIpDNfsz_","http.request.id":"","http.response.body.bytes":1358,"event.duration":763551196,"@timestamp":"2021-08-11T23:19:30.172Z","message":"success enroll"}
{"log.level":"debug","service.name":"fleet-server","service.name":"fleet-server","url.full":"/api/fleet/agents/enroll?","http.version":"1.1","http.request.method":"POST","http.response.status_code":200,"http.request.body.bytes":1021,"http.response.body.bytes":1358,"client.address":"[::1]:62228","client.ip":"::1","client.port":62228,"tls.established":true,"event.duration":763617257,"@timestamp":"2021-08-11T23:19:30.172Z","message":"HTTP handler"}
{"log.level":"debug","service.name":"fleet-server","service.name":"fleet-server","error.message":"context canceled","id":"03a119cd-be98-4069-9f42-1d6bb2d87350","http.response.status_code":503,"http.request.id":"","event.duration":31189251332,"@timestamp":"2021-08-11T23:19:30.312Z","message":"fail checkin"}
{"log.level":"debug","service.name":"fleet-server","service.name":"fleet-server","url.full":"/api/fleet/agents/03a119cd-be98-4069-9f42-1d6bb2d87350/checkin?","http.version":"1.1","http.request.method":"POST","http.response.status_code":503,"http.request.body.bytes":3559,"http.response.body.bytes":78,"client.address":"127.0.0.1:62215","client.ip":"127.0.0.1","client.port":62215,"tls.established":true,"event.duration":31189375755,"@timestamp":"2021-08-11T23:19:30.312Z","message":"HTTP handler"}
{"log.level":"debug","service.name":"fleet-server","service.name":"fleet-server","@timestamp":"2021-08-11T23:19:30.312Z","message":"Revision dispatcher exited"}
{"log.level":"info","service.name":"fleet-server","service.name":"fleet-server","ctx":"policy agent monitor","@timestamp":"2021-08-11T23:19:30.312Z","message":"Exit policy monitor local"}
{"log.level":"debug","service.name":"fleet-server","service.name":"fleet-server","@timestamp":"2021-08-11T23:19:30.312Z","message":"Policy monitor exited"}
{"log.level":"info","service.name":"fleet-server","service.name":"fleet-server","status":"STOPPING","@timestamp":"2021-08-11T23:19:30.312Z","message":"Stopping"}
{"log.level":"info","service.name":"fleet-server","service.name":"fleet-server","index":".fleet-actions","ctx":"index monitor","@timestamp":"2021-08-11T23:19:30.312Z","message":"context closed waiting for global checkpoints advance"}
{"log.level":"info","service.name":"fleet-server","service.name":"fleet-server","index":".fleet-actions","ctx":"index monitor","@timestamp":"2021-08-11T23:19:30.312Z","message":"exited"}
{"log.level":"debug","service.name":"fleet-server","service.name":"fleet-server","@timestamp":"2021-08-11T23:19:30.312Z","message":"Revision monitor exited"}
{"log.level":"debug","service.name":"fleet-server","service.name":"fleet-server","@timestamp":"2021-08-11T23:19:30.312Z","message":"Bulk checkin exited"}
{"log.level":"debug","service.name":"fleet-server","service.name":"fleet-server","@timestamp":"2021-08-11T23:19:30.312Z","message":"force server close on ctx.Done()"}
{"log.level":"info","service.name":"fleet-server","service.name":"fleet-server","index":".fleet-policies","ctx":"index monitor","@timestamp":"2021-08-11T23:19:30.313Z","message":"context closed waiting for global checkpoints advance"}
{"log.level":"info","service.name":"fleet-server","service.name":"fleet-server","index":".fleet-policies","ctx":"index monitor","@timestamp":"2021-08-11T23:19:30.313Z","message":"exited"}
{"log.level":"debug","service.name":"fleet-server","service.name":"fleet-server","@timestamp":"2021-08-11T23:19:30.313Z","message":"Http server exited"}
{"log.level":"debug","service.name":"fleet-server","service.name":"fleet-server","@timestamp":"2021-08-11T23:19:30.313Z","message":"Policy index monitor exited"}
{"log.level":"debug","service.name":"fleet-server","service.name":"fleet-server","@timestamp":"2021-08-11T23:19:30.891Z","message":"Coordinator policy monitor exited"}
{"log.level":"debug","service.name":"fleet-server","service.name":"fleet-server","@timestamp":"2021-08-11T23:19:30.892Z","message":"Bulker exited"}
{"log.level":"info","service.name":"fleet-server","service.name":"fleet-server","@timestamp":"2021-08-11T23:19:30.892Z","message":"Fleet Server exited"}
{"service.name":"fleet-server","service.name":"fleet-server","log.level":"info","log.logger":"fleet-metrics.api","message":"Stats endpoint (/Library/Elastic/Agent/data/tmp/default/fleet-server/fleet-server.sock) finished: accept unix /Library/Elastic/Agent/data/tmp/default/fleet-server/fleet-server.sock: use of closed network connection","@timestamp":"2021-08-11T23:19:30.892Z"}
Pinging @elastic/agent (Team:Agent)
Can you share a bit more about your setup? I assume all stack components are on 7.14. Is any of the components running in Elastic Cloud or ESS? What have you set as the fleet-server url in the Fleet UI?
@ppf2 From what I saw your are running everything locally correct? I do not think it's possible to run two agents on the same host (Agent and Fleet Server for example)
Can you add the agent logs for the agent that is running the fleet server around the time the fleet server is terminated? It appears from the above fleet-server logs that it is being told to shut down.
@ppf2 From what I saw your are running everything locally correct? I do not think it's possible to run two agents on the same host (Agent and Fleet Server for example)
Ah, that must be it then. I am trying to start Fleet Server locally on my laptop and then enroll an agent (also tried doing it from a separate unpacked tar.gz folder) to this Fleet Server.
Can we:
thx!
@ppf2 If you remove the -f
(meaning force) from the enroll
command it would prompt you that it will overwrite the other Elastic Agent. Being that you are using -f
, means that your are forcing the overwrite.
I filed a bug about documentation for this at https://github.com/elastic/observability-docs/issues/982
Install fleet server:
Fleet server installs and starts up fine:
Enroll elastic agent (where
elastic-agent.yml
is the policy copied from Kibana instructions:As soon as the above is run, Elastic agent enrolls successfully:
But Fleet Server exits: