Describe the Bug
See wollomatic/socket-proxy#83 and henrygd/beszel#1754 for the full context and how I fixed this for Beszel, but the TLDR is:
I use https://github.com/wollomatic/socket-proxy in a mode where the socket proxy reads Docker labels to assign socket permissions. Since Tinyauth boots up extremely quickly, the socket proxy occasionally blocks the version check request with a 403 before receiving the Docker labels and correctly updating permissions for future requests. While optimizations were made on the socket proxy side that reduced these occurrences, they are still happening with Tinyauth at times.
I am requesting that the following function (Docker initialization) add a single retry after a few seconds to get rid of this issue:
|
func NewDockerService(i DockerServiceInput) (*DockerService, error) { |
|
client, err := client.NewClientWithOpts(client.FromEnv) |
|
if err != nil { |
|
return nil, err |
|
} |
|
|
|
client.NegotiateAPIVersion(i.Ctx) |
|
|
|
_, err = client.Ping(i.Ctx) |
|
|
|
if err != nil { |
|
i.Log.App.Debug().Err(err).Msg("Docker not connected") |
|
return nil, nil |
|
} |
|
|
|
service := &DockerService{ |
|
log: i.Log, |
|
client: client, |
|
context: i.Ctx, |
|
} |
|
|
|
service.isConnected = true |
|
service.log.App.Debug().Msg("Docker connected successfully") |
|
|
|
i.Ding.Go(service.watchAndClose, ding.RingMajor) |
|
|
|
return service, nil |
|
} |
How to Reproduce
- Deploy https://github.com/wollomatic/socket-proxy in the label-based mode (my setup).
- Start Tinyauth (my setup) and see that sometimes the initial Docker connection is blocked so all Tinyauth label-based configurations don't work. I find this most commonly happens when the underlying OS is restarted.
Expected Behavior
Tinyauth retries the initial Docker connection after a few seconds of delay.
Additional Context
No response
Logs
No response
Operating System
Linux
Browser
N/A
Tinyauth Version
All versions
Docker Version (if applicable)
No response
Human Written Confirmation
Describe the Bug
See wollomatic/socket-proxy#83 and henrygd/beszel#1754 for the full context and how I fixed this for Beszel, but the TLDR is:
I use https://github.com/wollomatic/socket-proxy in a mode where the socket proxy reads Docker labels to assign socket permissions. Since Tinyauth boots up extremely quickly, the socket proxy occasionally blocks the version check request with a 403 before receiving the Docker labels and correctly updating permissions for future requests. While optimizations were made on the socket proxy side that reduced these occurrences, they are still happening with Tinyauth at times.
I am requesting that the following function (Docker initialization) add a single retry after a few seconds to get rid of this issue:
tinyauth/internal/service/docker_service.go
Lines 33 to 60 in 80bc871
How to Reproduce
Expected Behavior
Tinyauth retries the initial Docker connection after a few seconds of delay.
Additional Context
No response
Logs
No response
Operating System
Linux
Browser
N/A
Tinyauth Version
All versions
Docker Version (if applicable)
No response
Human Written Confirmation