-
Notifications
You must be signed in to change notification settings - Fork 204
Closed
Labels
Team:Elastic-Agent-Control-PlaneLabel for the Agent Control Plane teamLabel for the Agent Control Plane teamgood first issueGood for newcomersGood for newcomers
Description
When trying to communicate with Fleet-Server (e.g: during enrol), Elastic-Agent might log the error
Remote server failed to handle the request, will retry in a moment
However this can be the result of 3 different HTTP status codes:
elastic-agent/internal/pkg/fleetapi/enroll_cmd.go
Lines 35 to 40 in 54932dc
| // temporaryServerErrorCodes defines status codes that allow clients to retry their request. | |
| var temporaryServerErrorCodes = map[int]struct{}{ | |
| http.StatusBadGateway: {}, | |
| http.StatusServiceUnavailable: {}, | |
| http.StatusGatewayTimeout: {}, | |
| } |
Bad Gateway and Gateway Timeout are likely connectivity problems, however Service Unavailable can be a real problem with Fleet-Server.
We need to be more clear in the logs which error has happened and likely better handle them individually. E.g: Bad Gateway might be a configuration issue, while Gateway Timeout is a connectivity issue. It might not make sense to retry Bad Gateway, while Gateway Timeout should be retried with an exponential backoff.
Metadata
Metadata
Assignees
Labels
Team:Elastic-Agent-Control-PlaneLabel for the Agent Control Plane teamLabel for the Agent Control Plane teamgood first issueGood for newcomersGood for newcomers