Widen Komodo health probe: try container endpoints, snippet on failure
GetDeployment returns config, not runtime state, so the health check was always coming back with 'no container state found in response'. For deployment-type servers the probe now tries GetDeploymentContainer, InspectDeploymentContainer, and GetDeploymentStatus first, falling back to GetDeployment only if those aren't available. The extractor also recognizes more shapes (Health.Status, container_state, deployment_state, etc.) and accepts more healthy strings (running, healthy, ok, started, up). When nothing matches, the truncated raw response snippet rides along in the error field so the deployment/beta UI shows exactly which field to teach the extractor next time. Currently-stuck deployment_server rows are still 'pending', so the sweep will retry them on its next 15s tick — no manual reset needed. Once one of the widened endpoints resolves, those rows advance to 'done' automatically. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -177,7 +177,10 @@ async function runRestartPhase(server: string): Promise<{ state: 'done' | 'faile
|
||||
async function runHealthPhase(server: string): Promise<{ state: 'done' | 'failed' | 'pending'; players: number | null; error: string | null; restartedNow: boolean }> {
|
||||
const h = await komodoInspectHealthy(server);
|
||||
if (!h.ok) {
|
||||
return { state: 'pending', players: null, error: `unhealthy: ${h.reason}`, restartedNow: false };
|
||||
// Include a truncated response snippet (when the extractor is the
|
||||
// failure) so the operator can spot which Komodo field to teach.
|
||||
const snippet = h.snippet ? ` snippet=${h.snippet.slice(0, 400)}` : '';
|
||||
return { state: 'pending', players: null, error: `unhealthy: ${h.reason}${snippet}`, restartedNow: false };
|
||||
}
|
||||
const rcon = await rconStatusResult(server);
|
||||
if (!rcon.ok) {
|
||||
|
||||
Reference in New Issue
Block a user