Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker watcher should back off on authentication errors #113

Open
swiatekm opened this issue Feb 5, 2025 · 0 comments
Open

Docker watcher should back off on authentication errors #113

swiatekm opened this issue Feb 5, 2025 · 0 comments
Labels
bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Comments

@swiatekm
Copy link
Contributor

swiatekm commented Feb 5, 2025

Currently, the docker watcher will check if the docker socket is accessible by calling the /info endpoint, and will then proceed to consume a stream of events from the /events endpoint. The latter is restarted every second whenever it ends, no matter the reason.

In effect, if the /events endpoint is protected by an authorization plugin, the watcher will continue trying to access it, even if no useful progress can be made, and will continue logging error messages about it. This is far from ideal and should be fixed.

The simplest fix would be to check /events at watcher creation, but the call is unfortunately asynchronous and we'd have to take care to wrap the check in a timeout. In general, we should do an exponential backoff on calls to the watch function, as well as actually checking the error it encountered.

This was raised as an issue for the add_docker_metadata processor in beats and the docker provider in elastic-agent.

@swiatekm swiatekm added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team bug Something isn't working labels Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

No branches or pull requests

1 participant