From 5d5f7e8e44ac9cc7a82aadd81646933b8d1bd017 Mon Sep 17 00:00:00 2001 From: OpenClaw Team Date: Thu, 16 Apr 2026 18:27:06 +0800 Subject: [PATCH] Fail fast when Docker daemon is unreachable --- docker.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docker.go b/docker.go index c1e7eff4..1698d2e1 100644 --- a/docker.go +++ b/docker.go @@ -142,6 +142,13 @@ func (p Plugin) Exec() error { if maxRetries <= 0 { maxRetries = 15 // default value } + // If the daemon still isn't reachable after max retries, fail fast. + // + // Historically this code only printed an error and continued, which led to + // confusing follow-up failures like: + // "Cannot connect to the Docker daemon at unix:///var/run/docker.sock" + // + // See: https://github.com/drone-plugins/drone-docker/issues/414 for i := 0; ; i++ { cmd := commandInfo() err := cmd.Run() @@ -149,8 +156,7 @@ func (p Plugin) Exec() error { break } if i == maxRetries { - fmt.Printf("Unable to reach Docker Daemon after %d attempts.\n", maxRetries) - break + return fmt.Errorf("unable to reach Docker Daemon after %d attempts", maxRetries) } time.Sleep(time.Second * 1) }