Repository navigation
fix(agent): Retry Docker check on non-200 HTTP response - #1754
Merged
Merged
Conversation
The previous behavior only caught some errors including inaccessible hosts, but not others like failed authentication or service unavailability. This largely applies when using a socket proxy and having the retry mitigates some erroneous behavior.
There was a problem hiding this comment.
Pull request overview
This pull request enhances the Docker version check retry logic in the Beszel agent to handle non-200 HTTP responses, not just connection errors. This addresses scenarios where a socket proxy (like wollomatic/socket-proxy) may temporarily reject requests before properly configuring permissions based on Docker labels, particularly when the agent boots up quickly.
Changes:
- Modified retry logic to check both for errors AND non-200 HTTP status codes
- Added differentiated debug logging for connection errors vs. HTTP status code failures
- Added comprehensive unit tests covering all retry scenarios
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| agent/docker.go | Enhanced checkDockerVersion() to retry on non-200 HTTP responses in addition to connection errors, with improved logging |
| agent/docker_test.go | Added comprehensive test suite for checkDockerVersion() covering success, retry, and failure scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Owner
|
Thanks very much! |
ElioDiNino
added a commit
to ElioDiNino/Homelab
that referenced
this pull request
Feb 21, 2026
Reverts #143, as a result of henrygd/beszel#1754
This was referenced Feb 21, 2026
rizkyilhampra
pushed a commit
to rizkyilhampra/beszel
that referenced
this pull request
Apr 14, 2026
The previous behavior only caught some errors including inaccessible hosts, but not others like failed authentication or service unavailability. This largely applies when using a socket proxy and having the retry mitigates some erroneous behavior.
1 task done
xiaoran7
pushed a commit
to xiaoran7/beszel
that referenced
this pull request
Oct 17, 2026
The previous behavior only caught some errors including inaccessible hosts, but not others like failed authentication or service unavailability. This largely applies when using a socket proxy and having the retry mitigates some erroneous behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📃 Description
The current retry behaviour only catches some errors, including inaccessible hosts, but not others, such as failed authentication (401) or service unavailability (503). This largely applies when using a socket proxy, and this change mitigates some erroneous behaviour and increases reliability.
A specific issue I am solving for my use case is wollomatic/socket-proxy#83, where the socket proxy reads Docker labels to assign socket permissions. Since the Beszel agent boots up extremely quickly, the socket proxy blocks the version check request with a 403 before receiving the Docker labels and correctly updating permissions for future requests.
Note that AI was used to help generate the tests, but the cases are my own, and I have also tested locally using the make commands. Additionally, since the retry logic is being tested in three of the test cases, 15 seconds of delay is added to the total test run time. If this is unacceptable, please let me know how you would like the delay to be shortened/skipped just for the tests (a simple change would be an additional dockerManager value, but that solution is not my favourite).
Builds on #1250
🪵 Changelog
🔧 Fixed