Skip to content

Remote server failed to handle the request, will retry in a moment needs to be better handled #6287

@belimawr

Description

@belimawr

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:

// 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

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions