{"record":{"id":"17fe4e8a7dbcf226","repo":"astrid-runtime/astrid","slug":"mcp-gateway-is-starting-but-has-not-published-read","errorCode":null,"errorMessage":"MCP gateway is starting but has not published readiness within {} seconds","messagePattern":"MCP gateway is starting but has not published readiness within (.+?) seconds","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/mcp/lifecycle.rs","lineNumber":477,"sourceCode":"            }\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;\n            };\n            clean_unowned_gateway_startup(&lifecycle)\n                .await\n                .context(\"shutdown stage gateway.startup_cleanup\")?;\n            spawn_gateway(principal)?;\n            drop(lifecycle);\n            drop(supervisor);\n            spawned = true;\n        }\n        if Instant::now() >= deadline {\n            anyhow::bail!(\n                \"MCP gateway did not become ready within {} seconds\",","sourceCodeStart":459,"sourceCodeEnd":495,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/mcp/lifecycle.rs#L459-L495","documentation":"Fired by wait_for_gateway when the gateway is in a starting state (lease exists) but no ready record is published within the overall deadline. Distinguishes the still-starting case from a fully absent gateway.","triggerScenarios":"Thrown at crates/astrid-cli/src/commands/mcp/lifecycle.rs:477 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait longer or investigate why readiness is not published","Inspect gateway logs; the startup likely failed after the lease was taken","Stop the half-started gateway and spawn again"],"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"}