← back to Ticket System
TK-11856 rc-propagation (RSYNC): ticket-gdrive-sync exits nonzero on failed export/rclone
121b08b5a4a55ed0d1effa2af897bdd5bf89f3ce · 2026-09-26 09:22:36 -0700 · Steve
Exit-code ONLY, no behavior change (Steve ruling 2026-09-26 Q1/Q2): every step still runs as
before; the wrapper now exits with the first nonzero rc of its side-effecting step(s) instead of
swallowing it, so cron-fire-canary's exit corroboration can see a failed run. No heartbeat file added.
Revert: git -C /Users/macstudio3/Projects/ticket-system revert <this sha>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YaiWjfgEuKQLTb5cdDreS3
Files touched
Diff
commit 121b08b5a4a55ed0d1effa2af897bdd5bf89f3ce
Author: Steve <steve@designerwallcoverings.com>
Date: Sat Sep 26 09:22:36 2026 -0700
TK-11856 rc-propagation (RSYNC): ticket-gdrive-sync exits nonzero on failed export/rclone
Exit-code ONLY, no behavior change (Steve ruling 2026-09-26 Q1/Q2): every step still runs as
before; the wrapper now exits with the first nonzero rc of its side-effecting step(s) instead of
swallowing it, so cron-fire-canary's exit corroboration can see a failed run. No heartbeat file added.
Revert: git -C /Users/macstudio3/Projects/ticket-system revert <this sha>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YaiWjfgEuKQLTb5cdDreS3
---
gdrive-sync.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdrive-sync.sh b/gdrive-sync.sh
index 441762f2..ffc2df9d 100755
--- a/gdrive-sync.sh
+++ b/gdrive-sync.sh
@@ -7,10 +7,15 @@ NODE="$(command -v node || echo /opt/homebrew/bin/node)"
RCLONE="$(command -v rclone || echo /opt/homebrew/bin/rclone)"
TMP="$ROOT/tmp-tickets-live.csv"
LOG="$ROOT/gdrive-sync.log"
+# TK-11856 rc-propagation (exit-code ONLY, no behavior change): same export -> rclone chain; we only
+# capture the failing step's rc in the SYNC FAILED branch and exit with it (was: always exit 0, so a
+# failed Drive upload read green). The { } group runs in THIS shell, so RC is visible after it.
+RC=0
{
echo "=== gdrive-sync $(date '+%F %T') ==="
"$NODE" "$ROOT/ticket-export.js" > "$TMP" 2>/dev/null && \
"$RCLONE" copyto "$TMP" "gdrive:DW-Ticket-Board/tickets-live.csv" && \
- echo "synced $(( $(wc -l < "$TMP") - 1 )) tickets" || echo "SYNC FAILED"
+ echo "synced $(( $(wc -l < "$TMP") - 1 )) tickets" || { RC=$?; echo "SYNC FAILED rc=$RC"; }
rm -f "$TMP"
} >> "$LOG" 2>&1
+exit "$RC"
← c5597b86 TK-11861: PR sell-mode segmentation evidence (read-only, 13,
·
back to Ticket System
·
TK-11856 rc-propagation (EMAIL): ticket-morning-report exits 8d852938 →