From bd088decbb35bea71b3ffa65603d35ea3500c89c Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Tue, 6 Oct 2026 23:36:00 +0200 Subject: [PATCH] fix(up): preserve the actionable dependency-timeout message without --wait Copilot review finding (low) on #14290: with --wait-timeout supplied but not --wait, a dependency timeout in upDetached returned the raw "context deadline exceeded" instead of the actionable "timeout waiting for dependencies" the legacy start()+waitDependencies path already reports for the exact same failure. The --wait-specific "application not healthy after %s" translation only ever covered the Wait=true case, leaving the Wait=false, WaitTimeout>0 case (a legal CLI combination -- --wait-timeout alone is a hang guard) with no translation at all. Signed-off-by: Nicolas De Loof --- pkg/compose/up.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkg/compose/up.go b/pkg/compose/up.go index bad84b285..93f2286e3 100644 --- a/pkg/compose/up.go +++ b/pkg/compose/up.go @@ -111,8 +111,17 @@ func (s *composeService) upDetached(ctx context.Context, project *types.Project, // independent deadline expire during exec.run -- that DeadlineExceeded // didn't come from any OpWaitCondition node's own derived timeout // either, so it isn't a health-readiness failure. - if options.Start.Wait && options.Start.WaitTimeout > 0 && ctx.Err() == nil && errors.Is(err, context.DeadlineExceeded) { - return fmt.Errorf("application not healthy after %s", options.Start.WaitTimeout) + if options.Start.WaitTimeout > 0 && ctx.Err() == nil && errors.Is(err, context.DeadlineExceeded) { + if options.Start.Wait { + return fmt.Errorf("application not healthy after %s", options.Start.WaitTimeout) + } + // No --wait: this is exactly the dependency-timeout failure + // start()'s own waitDependencies already reports as "timeout + // waiting for dependencies" (service_containers.go) -- matching + // that established, actionable message instead of leaking the + // raw "context deadline exceeded" a user never configured in + // those terms. + return errors.New("timeout waiting for dependencies") } return err }