astrid-runtime/astrid · error
MCP gateway PID is alive but its listener is unavailable
Error message
MCP gateway PID {} is alive but its listener is unavailable What it means
Fired by wait_for_gateway when the ready-record PID is alive but the socket connection outcome is Absent or Stale: the gateway process exists yet its listener is unusable. This is a hung/broken gateway that cannot recover on its own without proven daemon uplink.
Solutions
- Kill or stop the wedged gateway process and retry
- Check gateway logs for the bind/listen failure
- Clean the dead gateway markers and let wait_for_gateway spawn a fresh child
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at crates/astrid-cli/src/commands/mcp/lifecycle.rs:434 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09).
Data as JSON: /api/errors/114c7bd3a7227e77.
Report an issue: GitHub.
Appendix: source
Thrown at crates/astrid-cli/src/commands/mcp/lifecycle.rs:434
principal
);
}
match astrid_core::local_transport::connect_outcome(&socket)
.await
.context("failed to inspect MCP gateway endpoint")?
{
astrid_core::local_transport::ConnectOutcome::Connected(stream) => {
request_gateway_control(stream, &record, GatewayControlOperation::Health)
.await
.context("MCP gateway cannot prove a recoverable daemon uplink")?;
emit_ready(format, &record)?;
return Ok(ExitCode::SUCCESS);
},
astrid_core::local_transport::ConnectOutcome::Absent
| astrid_core::local_transport::ConnectOutcome::Stale
if crate::commands::daemon_control::is_process_alive(record.pid) =>
{
anyhow::bail!(
"MCP gateway PID {} is alive but its listener is unavailable",
record.pid
);
},
astrid_core::local_transport::ConnectOutcome::Absent
| astrid_core::local_transport::ConnectOutcome::Stale => {
remove_dead_gateway_markers(&record).await?;
},
}
}
if !spawned {
let supervisor = try_acquire_gateway_supervisor()?;
let Some(supervisor) = supervisor else {
if Instant::now() >= deadline {
anyhow::bail!(
"MCP gateway startup supervisor remained active within {} seconds",
SPAWNED_READY_TIMEOUT.as_secs()
);View on GitHub (pinned to affd8760f4)