From a345eb1e61017af97890e8640cd41a8001bcc54a Mon Sep 17 00:00:00 2001 From: Dean Chen <862469039@qq.com> Date: Tue, 11 Aug 2026 23:30:38 +0500 Subject: [PATCH] service/progress: stop truncating task error messages Long swarm task errors were cut off at 75 characters, which often hid the actionable part of the failure (e.g. the full bind mount path). Still collapse newlines so the progress line stays single-line. Fixes #7176 Signed-off-by: Dean Chen <862469039@qq.com> --- cli/command/service/progress/progress.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/cli/command/service/progress/progress.go b/cli/command/service/progress/progress.go index 36f5d19e465a..24ae095009c6 100644 --- a/cli/command/service/progress/progress.go +++ b/cli/command/service/progress/progress.go @@ -268,16 +268,10 @@ func writeOverallProgress(progressOut progress.Output, numerator, denominator in } func truncError(errMsg string) string { - // Remove newlines from the error, which corrupt the output. - errMsg = strings.ReplaceAll(errMsg, "\n", " ") - - // Limit the length to 75 characters, so that even on narrow terminals - // this will not overflow to the next line. - const maxWidth = 75 - if len(errMsg) > maxWidth { - errMsg = errMsg[:maxWidth-1] + "…" - } - return errMsg + // Remove newlines from the error, which corrupt the single-line progress UI. + // Keep the full message otherwise — truncating to a fixed width (e.g. 75 + // runes) hid the useful part of long swarm task errors (issue #7176). + return strings.ReplaceAll(errMsg, "\n", " ") } type replicatedProgressUpdater struct {