{"record":{"id":"0822afc54a086536","repo":"astrid-runtime/astrid","slug":"mcp-gateway-startup-supervisor-remained-active-wit","errorCode":null,"errorMessage":"MCP gateway startup supervisor remained active within {} seconds","messagePattern":"MCP gateway startup supervisor remained active within (.+?) seconds","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/mcp/lifecycle.rs","lineNumber":449,"sourceCode":"                | astrid_core::local_transport::ConnectOutcome::Stale\n                    if crate::commands::daemon_control::is_process_alive(record.pid) =>\n                {\n                    anyhow::bail!(\n                        \"MCP gateway PID {} is alive but its listener is unavailable\",\n                        record.pid\n                    );\n                },\n                astrid_core::local_transport::ConnectOutcome::Absent\n                | astrid_core::local_transport::ConnectOutcome::Stale => {\n                    remove_dead_gateway_markers(&record).await?;\n                },\n            }\n        }\n        if !spawned {\n            let supervisor = try_acquire_gateway_supervisor()?;\n            let Some(supervisor) = supervisor else {\n                if Instant::now() >= deadline {\n                    anyhow::bail!(\n                        \"MCP gateway startup supervisor remained active within {} seconds\",\n                        SPAWNED_READY_TIMEOUT.as_secs()\n                    );\n                }\n                tokio::time::sleep(READY_POLL).await;\n                continue;\n            };\n            if read_gateway_ready()?.is_some() {\n                continue;\n            }\n            if let Some(lease) = read_gateway_startup_lease()?\n                && crate::commands::daemon_control::is_process_alive(lease.supervisor_pid)\n            {\n                drop(supervisor);\n                if Instant::now() >= deadline {\n                    anyhow::bail!(\n                        \"MCP gateway PID {} is still starting within {} seconds\",\n                        lease.supervisor_pid,","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/mcp/lifecycle.rs#L431-L467","documentation":"Startup timeout in wait_for_gateway: after repeatedly probing the gateway listener, the supervisor process is still alive but never became connectable within the allowed window. Fired from the `ready` command; the gateway may be hung during initialization (port binding failure, deadlocked startup) even though its PID exists, so readiness cannot be confirmed.","triggerScenarios":"Thrown at crates/astrid-cli/src/commands/mcp/lifecycle.rs:449 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the supervisor/gateway logs for startup failure","Stop the lingering supervisor process and retry the ready command","Increase the timeout only if startup is legitimately slow"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}