{"record":{"id":"71ceff21d4b42533","repo":"astrid-runtime/astrid","slug":"mcp-gateway-pid-is-still-starting-within-sec","errorCode":null,"errorMessage":"MCP gateway PID {} is still starting within {} seconds","messagePattern":"MCP gateway PID (.+?) is still starting within (.+?) seconds","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/mcp/lifecycle.rs","lineNumber":465,"sourceCode":"            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,\n                        SPAWNED_READY_TIMEOUT.as_secs()\n                    );\n                }\n                tokio::time::sleep(READY_POLL).await;\n                continue;\n            }\n            let Some(lifecycle) = try_acquire_gateway_lifecycle()? else {\n                drop(supervisor);\n                if Instant::now() >= deadline {\n                    anyhow::bail!(\n                        \"MCP gateway is starting but has not published readiness within {} seconds\",\n                        SPAWNED_READY_TIMEOUT.as_secs()\n                    );\n                }\n                tokio::time::sleep(READY_POLL).await;\n                continue;","sourceCodeStart":447,"sourceCodeEnd":483,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/mcp/lifecycle.rs#L447-L483","documentation":"Fired by wait_for_gateway when a leased supervisor PID is alive but the gateway has not published readiness before the deadline. The startup is in progress but is not converging within the allowed window.","triggerScenarios":"Thrown at crates/astrid-cli/src/commands/mcp/lifecycle.rs:465 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check gateway startup logs for errors or slow initialization","Kill the still-starting process and retry","Free system resources if the startup is blocked on them"],"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"}