From b59b94099aaf64f9966df7242e6909878a7fab3c Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sat, 30 May 2026 18:45:24 -0400 Subject: [PATCH] Partnership: handle empty run.php response gracefully If run.php returns an empty body (transient nginx/PHP-FPM issue), the script still runs via nohup. Treat empty response as ok instead of throwing a JSON parse error that misleads the user into thinking the action failed. --- Plugin/unraid/pages/partnership.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Plugin/unraid/pages/partnership.php b/Plugin/unraid/pages/partnership.php index 302168a..943559b 100644 --- a/Plugin/unraid/pages/partnership.php +++ b/Plugin/unraid/pages/partnership.php @@ -63,7 +63,17 @@ function _vvPtRun(id, extraArgs) { return fetch('/plugins/varaverk/api/run.php', { method: 'POST', body: new URLSearchParams(params) - }).then(r => r.json()); + }).then(r => { + if (!r.ok) throw new Error('HTTP ' + r.status); + return r.text(); + }).then(text => { + if (!text.trim()) { + // Empty body — script likely started via nohup before response was sent. + // Treat as ok; check Scheduler log for confirmation. + return {ok: true, _empty_response: true}; + } + return JSON.parse(text); + }); } function vvPtPhase1(btn, hostId) {