From 62b8162508000809828fe577d18bd061b4d63f12 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 4 Sep 2026 02:07:23 +0000 Subject: [PATCH 1/2] avoid broken-pipe panic reading stellar version --- .scripts/update-config-settings | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.scripts/update-config-settings b/.scripts/update-config-settings index f63893a2..11b92504 100755 --- a/.scripts/update-config-settings +++ b/.scripts/update-config-settings @@ -30,7 +30,13 @@ fi # stellar-cli's major version tracks the protocol it supports. If testnet has # advanced beyond it, `stellar network settings` silently omits settings the # older XDR doesn't know about, so fail loudly to prompt bumping the pinned CLI. -cli_protocol="$(stellar version | head -n1 | sed -E 's/^stellar ([0-9]+).*/\1/')" +# +# `stellar version` output is captured in full before piping to head/sed: piping +# it directly to `head -n1` lets head close its end of the pipe as soon as it +# has its line, which can race with `stellar` still writing its later lines and +# make it panic on the resulting broken pipe. +cli_version_output="$(stellar version)" +cli_protocol="$(printf '%s\n' "$cli_version_output" | head -n1 | sed -E 's/^stellar ([0-9]+).*/\1/')" if [ "$protocol" -gt "$cli_protocol" ]; then echo "error: testnet is on protocol $protocol but stellar-cli supports protocol $cli_protocol; bump the pinned stellar-cli version" >&2 exit 1 From 58172c371c1625f9caf511f83622c59c1d77f00c Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 4 Sep 2026 15:29:56 +0000 Subject: [PATCH 2/2] use stellar version --only-version-major flag --- .scripts/update-config-settings | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.scripts/update-config-settings b/.scripts/update-config-settings index 11b92504..82a632f1 100755 --- a/.scripts/update-config-settings +++ b/.scripts/update-config-settings @@ -30,13 +30,7 @@ fi # stellar-cli's major version tracks the protocol it supports. If testnet has # advanced beyond it, `stellar network settings` silently omits settings the # older XDR doesn't know about, so fail loudly to prompt bumping the pinned CLI. -# -# `stellar version` output is captured in full before piping to head/sed: piping -# it directly to `head -n1` lets head close its end of the pipe as soon as it -# has its line, which can race with `stellar` still writing its later lines and -# make it panic on the resulting broken pipe. -cli_version_output="$(stellar version)" -cli_protocol="$(printf '%s\n' "$cli_version_output" | head -n1 | sed -E 's/^stellar ([0-9]+).*/\1/')" +cli_protocol="$(stellar version --only-version-major)" if [ "$protocol" -gt "$cli_protocol" ]; then echo "error: testnet is on protocol $protocol but stellar-cli supports protocol $cli_protocol; bump the pinned stellar-cli version" >&2 exit 1