astrid-runtime/astrid · error

MCP gateway startup supervisor remained active within

Error message

MCP gateway startup supervisor remained active within {} seconds

What it means

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.

Solutions

  1. Inspect the supervisor/gateway logs for startup failure
  2. Stop the lingering supervisor process and retry the ready command
  3. Increase the timeout only if startup is legitimately slow
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at crates/astrid-cli/src/commands/mcp/lifecycle.rs:449 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/0822afc54a086536. Report an issue: GitHub.

Appendix: source

Thrown at crates/astrid-cli/src/commands/mcp/lifecycle.rs:449

                | 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()
                    );
                }
                tokio::time::sleep(READY_POLL).await;
                continue;
            };
            if read_gateway_ready()?.is_some() {
                continue;
            }
            if let Some(lease) = read_gateway_startup_lease()?
                && crate::commands::daemon_control::is_process_alive(lease.supervisor_pid)
            {
                drop(supervisor);
                if Instant::now() >= deadline {
                    anyhow::bail!(
                        "MCP gateway PID {} is still starting within {} seconds",
                        lease.supervisor_pid,

View on GitHub (pinned to affd8760f4)