mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
fix(swarm): print every task row when a stack fails to converge
report_tasks filtered with awk '!/error=$/', keeping only rows whose ERROR
column is non-empty. That discards exactly the states a converge timeout
needs reported -- Pending, Assigned, Preparing, Starting, and any
unhealthy-kill whose image STOPSIGNAL yields exit 0 -- and keeps only the
states that already explain themselves.
Friendica hit precisely that hole: all six task rows sat in Starting or
Shutdown/Complete with a blank ERROR (its apache image uses SIGWINCH, so a
health-kill exits 0 and swarm records Complete, not Failed). Every row was
dropped, the `[ -n "${rows}" ] || return 0` guard returned silently, and the
operator saw a bare "not converged: friendica_friendica" with no diagnosis.
Decidim's rows printed only because Failed carries an error string.
Drop the filter. report_tasks runs per non-converged service, and
docker service ps lists each slot's current task before its history, so the
head -10 cap still shows the rows that matter. Strictly additive: more rows,
never fewer.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
91c519d8f2
commit
3ebd6e9507
1 file changed
+1
-1
@@ -25,7 +25,7 @@ report_tasks() {
|
||||
printf ' %s: docker service ps failed: %s\n' "$1" "$ps" >&2
|
||||
return 0
|
||||
fi
|
||||
rows="$(printf '%s\n' "$ps" | awk '!/error=$/' | head -10)"
|
||||
rows="$(printf '%s\n' "$ps" | head -10)"
|
||||
[ -n "${rows}" ] || return 0
|
||||
printf '%s\n' "${rows}" | sed 's/^/ /' >&2
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user