From ab8399d034aa4533df77dfbe6e86b6932996e524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A2ni=20Marques?= Date: Thu, 16 Jul 2026 20:43:56 +0200 Subject: [PATCH] fix(monitoring): clearer WARN lines (problem + context) --- scripts/taler-monitoring/check_goa_ladder.sh | 14 ++++++++---- scripts/taler-monitoring/lib.sh | 23 ++++++++++++++++++-- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/scripts/taler-monitoring/check_goa_ladder.sh b/scripts/taler-monitoring/check_goa_ladder.sh index 5e5a303..ebd2a32 100755 --- a/scripts/taler-monitoring/check_goa_ladder.sh +++ b/scripts/taler-monitoring/check_goa_ladder.sh @@ -225,7 +225,8 @@ for AMT in "$@"; do rung=$((rung + 1)) if ladder_over; then STOP_REASON="timeout budget ${LADDER_TIMEOUT_S}s" - warn "ladder" "budget exhausted after $OK_N ok rungs" + warn ladder "time budget exhausted" \ + "problem: LADDER_TIMEOUT_S=${LADDER_TIMEOUT_S}s reached after ${OK_N} ok rungs; remaining amounts not tried" break fi @@ -267,7 +268,8 @@ for AMT in "$@"; do # Probe only: bank may reject GOA:0 — record and continue ladder status="ZERO_REJECT" note="zero-withdraw rejected (expected possible): $note" - warn bank "mint $AMT" "$note" + warn bank "mint $AMT rejected" \ + "problem: bank will not create a GOA:0 withdrawal (zero amount probe). Ladder continues. detail: $note" echo -e "${rung}\t${range_note}\t${AMT}\t${status}\t${ms_mint}\t${ms_accept}\t${ms_confirm}\t${ms_settle}\t${ms_total}\t${WID}\t${note}" >>"$TSV" OK_N=$((OK_N + 1)) continue @@ -299,11 +301,14 @@ for AMT in "$@"; do if [ "$IS_ZERO" = "1" ]; then status="ZERO_SKIP" note="zero-withdraw skip (7006 / no denoms): $note" + warn wallet "accept $AMT skipped" \ + "problem: wallet code 7006 — no coin denominations for GOA:0 (zero amount cannot be withdrawn as coins). Ladder continues. detail: $note" else status="SKIP_DENOM" note="skip amount (wallet 7006 no denoms): $note" + warn wallet "accept $AMT skipped" \ + "problem: wallet code 7006 — no denominations match this amount (below smallest coin or not combinable). Ladder continues with next rung. detail: $note" fi - warn wallet "accept $AMT" "$note" echo -e "${rung}\t${range_note}\t${AMT}\t${status}\t${ms_mint}\t${ms_accept}\t${ms_confirm}\t${ms_settle}\t${ms_total}\t${WID}\t${note}" >>"$TSV" continue fi @@ -473,7 +478,8 @@ sys.exit(0 if Decimal(sys.argv[1]) > Decimal(sys.argv[2]) else 1) if echo "$xfer" | grep -qi True; then status="OK_BANK_LAG" note="bank transfer_done avail=${after} $xfer" - warn "settle lag $AMT" "bank confirmed; wallet still ${CUR}:${after} (${ms_settle}ms)" + warn settle "lag after $AMT" \ + "problem: bank transfer_done but wallet balance not increased yet (avail=${CUR}:${after}, settle ${ms_settle}ms) — coins may still be in flight" OK_N=$((OK_N + 1)) echo -e "${rung}\t${range_note}\t${AMT}\t${status}\t${ms_mint}\t${ms_accept}\t${ms_confirm}\t${ms_settle}\t${ms_total}\t${WID}\t${note}" >>"$TSV" else diff --git a/scripts/taler-monitoring/lib.sh b/scripts/taler-monitoring/lib.sh index d405a2d..50a54ac 100755 --- a/scripts/taler-monitoring/lib.sh +++ b/scripts/taler-monitoring/lib.sh @@ -304,9 +304,28 @@ fail() { ERRORS+=("${LAST_TID:+$LAST_TID }$label${detail:+ — $detail}") } warn() { - local label="$1" detail="${2:-}" + # Forms (same idea as err; always try to state the problem): + # warn "problem" + # warn "problem" "why / context" + # warn component "problem" "why / context" + local a1="${1:-}" a2="${2:-}" a3="${3:-}" + local head detail _take_tid - printf '%s[WARN]%s %s%s%s\n' "$Y" "$N" "$(_fmt_tid)" "$label" "${detail:+ — $detail}" + if [ -n "$a3" ]; then + head="${a1}: ${a2}" + detail="$a3" + elif [ -n "$a2" ]; then + head="$a1" + detail="$a2" + else + head="$a1" + detail="" + fi + if [ -n "$detail" ]; then + printf '%s[WARN]%s %s%s — %s\n' "$Y" "$N" "$(_fmt_tid)" "$head" "$detail" + else + printf '%s[WARN]%s %s%s\n' "$Y" "$N" "$(_fmt_tid)" "$head" + fi WARN_N=$((WARN_N + 1)) } info() {