Compare commits

..
Author SHA1 Message Date
MickLesk 19233948aa update-apps: name the failure when the container leaves no .errinfo
Updates that fail before the engine's error handler (the update helper,
a script fetch, an explicit exit) left no .errinfo, so the report and
telemetry said only 'exit code: 1'. The container's output is now teed
to a temp file and its last error line is appended.
2026-12-05 13:53:51 +01:00
3 changed files with 17 additions and 14 deletions

No files matched your search

+1 -4
View File
@@ -56,11 +56,8 @@ function update_script() {
msg_warn "The lockfile of this release is out of date, resolving dependencies without it"
$STD pnpm install --no-frozen-lockfile
}
# tsc 7 (Go) ignores NODE_OPTIONS; four checkers no longer fit in 10 GB, one with GOMEMLIMIT peaks at ~8 GB
sed -i 's/"compilerOptions": {/&\n "checkers": 1,/' server/tsconfig.json
export GOMEMLIMIT=6GiB
$STD pnpm build
unset NODE_OPTIONS GOMEMLIMIT
unset NODE_OPTIONS
msg_ok "Rebuilt Paperclip"
msg_info "Updating Agent CLIs"
+1 -4
View File
@@ -36,11 +36,8 @@ $STD pnpm install --frozen-lockfile || {
msg_warn "The lockfile of this release is out of date, resolving dependencies without it"
$STD pnpm install --no-frozen-lockfile
}
# tsc 7 (Go) ignores NODE_OPTIONS; four checkers no longer fit in 10 GB, one with GOMEMLIMIT peaks at ~8 GB
sed -i 's/"compilerOptions": {/&\n "checkers": 1,/' server/tsconfig.json
export GOMEMLIMIT=6GiB
$STD pnpm build
unset NODE_OPTIONS GOMEMLIMIT
unset NODE_OPTIONS
msg_ok "Built Paperclip"
msg_info "Installing Agent CLIs"
+15 -6
View File
@@ -625,19 +625,28 @@ for container in $CHOICE; do
# don't fail without a TTY — works for all shells incl. ash (no export -f)
SETUP_CMD="mkdir -p /tmp/.nc; printf '#!/bin/sh\n:\n' > /tmp/.nc/clear; chmod +x /tmp/.nc/clear; export PATH=/tmp/.nc:\$PATH; export TERM=dumb; "
case "$os" in
alpine) pct exec "$container" -- ash -c "${SETUP_CMD}${UPDATE_CMD}" ;;
archlinux) pct exec "$container" -- bash -c "${SETUP_CMD}${UPDATE_CMD}" ;;
fedora | rocky | centos | alma) pct exec "$container" -- bash -c "${SETUP_CMD}${UPDATE_CMD}" ;;
ubuntu | debian | devuan) pct exec "$container" -- bash -c "${SETUP_CMD}${UPDATE_CMD}" ;;
opensuse) pct exec "$container" -- bash -c "${SETUP_CMD}${UPDATE_CMD}" ;;
alpine) update_shell=ash ;;
archlinux | fedora | rocky | centos | alma | ubuntu | debian | devuan | opensuse) update_shell=bash ;;
*) update_shell="" ;;
esac
exit_code=$?
update_out=$(mktemp)
exit_code=0
if [[ -n "$update_shell" ]]; then
pct exec "$container" -- "$update_shell" -c "${SETUP_CMD}${UPDATE_CMD}" 2>&1 | tee "$update_out"
exit_code=${PIPESTATUS[0]}
fi
# The engine in the container leaves what failed in an .errinfo file; without it
# the report says only "exit code: 1".
update_detail=""
if [ $exit_code -ne 0 ]; then
update_detail=$(pct exec "$container" -- sh -c 'f=$(find /root /tmp -maxdepth 1 -name "*.errinfo" -newer /tmp/.cs-update-start 2>/dev/null | head -n1); [ -n "$f" ] || exit 0; m=$(sed -n "s/^MESSAGE=//p" "$f" | head -n1); [ -n "$m" ] || m=$(sed -n "s/^COMMAND=//p" "$f" | head -n1); printf "%s" "$m" | head -c 200' 2>/dev/null || true)
# Failures before the engine's error handler (the helper, a script fetch, an
# explicit exit) leave no .errinfo; the last error line printed says what broke.
if [[ -z "$update_detail" ]]; then
update_detail=$(sed -e 's/\x1b\[[0-9;?]*[a-zA-Z]//g' "$update_out" | tr '\r' '\n' | grep -E '✖|✘|\[ERROR\]|^E: |[Ee]rror' | tail -n1 | sed 's/^[[:space:]]*//' | head -c 200)
fi
fi
rm -f "$update_out"
#5) if build resources are different than run resources, then:
if [ "$UPDATE_BUILD_RESOURCES" -eq "1" ]; then