Report each teardown and setup step from what it did, not from whether it was attempted
This commit is contained in:
@@ -507,6 +507,7 @@ ensure_stack_networks_on_remote() {
|
||||
# ==============================================================================================
|
||||
cleanup_deployed_stack_on_remote() {
|
||||
local remote_ip="$1" ssh_key="$2"
|
||||
local _rc=0
|
||||
local -a xml_names=()
|
||||
[[ ${#PARTNERSHIP_AUTH_STACK[@]} -gt 0 ]] && xml_names+=("${PARTNERSHIP_AUTH_STACK[@]}")
|
||||
[[ ${#PARTNERSHIP_ARR_STACK[@]} -gt 0 ]] && xml_names+=("${PARTNERSHIP_ARR_STACK[@]}")
|
||||
@@ -552,13 +553,20 @@ cleanup_deployed_stack_on_remote() {
|
||||
|
||||
while IFS= read -r path; do
|
||||
[[ -z "$path" ]] && continue
|
||||
timeout "$SSH_TIMEOUT" ssh -i "$ssh_key" \
|
||||
if timeout "$SSH_TIMEOUT" ssh -i "$ssh_key" \
|
||||
-o ConnectTimeout="$SSH_TIMEOUT" -o BatchMode=yes root@"$remote_ip" \
|
||||
"rm -rf '$path' && echo removed" 2>/dev/null | grep -q removed && \
|
||||
echo " Appdata removed on $MIRROR: $path ✅" || \
|
||||
"rm -rf '$path' && echo removed" 2>/dev/null | grep -q removed; then
|
||||
echo " Appdata removed on $MIRROR: $path ✅"
|
||||
else
|
||||
warn " Failed to remove appdata on $MIRROR: $path"
|
||||
_rc=1
|
||||
fi
|
||||
done <<< "$appdata_paths"
|
||||
done
|
||||
# Only appdata failures are counted. The container branch above cannot tell "removal failed"
|
||||
# from "already gone" — both produce no `removed` echo — and an offboard re-run on a
|
||||
# half-finished teardown is a normal case, so treating that as failure would cry wolf.
|
||||
return "$_rc"
|
||||
}
|
||||
|
||||
# ==============================================================================================
|
||||
|
||||
@@ -182,7 +182,13 @@ function _vvPtRun(id, extraArgs) {
|
||||
if (!r.ok) throw new Error('HTTP ' + r.status);
|
||||
return r.text();
|
||||
}).then(text => {
|
||||
if (!text.trim()) return {ok: true, _empty_response: true};
|
||||
// An empty body is never success. api/run.php echoes JSON on every path it can reach, so
|
||||
// nothing arriving means the request died before it: Unraid's CSRF guard exits with an empty
|
||||
// body on a token mismatch, nginx returns an empty 200 for a bodyless POST, and a PHP fatal
|
||||
// produces the same. Returning {ok:true} for that made a killed request and a launched job
|
||||
// indistinguishable — press Onboard, get no error, and nothing has run. vvApiKey below has
|
||||
// always thrown on this; the action path is what disagreed.
|
||||
if (!text.trim()) throw new Error('Empty response — request rejected before it reached run.php');
|
||||
return JSON.parse(text);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user