linera-io/linera-protocol · critical

Admin HTTP server exited unexpectedly: {result:?}

Error message

Admin HTTP server exited unexpectedly: {result:?}

What it means

In serve_loop's tokio::select!, the admin HTTP server task exited. The relay binds a separate admin endpoint on 127.0.0.1:{admin_port} (axum::serve with .context("Admin HTTP server error")); if that task stops for any reason, serve_loop fails fast and the entire relay exits.

Source

Thrown at linera-bridge/src/relay/mod.rs:520

    loop {
        tokio::select! {
            result = &mut chain_listener_handle => {
                anyhow::bail!("Chain listener exited unexpectedly: {result:?}");
            }
            result = &mut evm_scan_handle => {
                anyhow::bail!("EVM scan loop exited unexpectedly: {result:?}");
            }
            result = &mut linera_scan_handle => {
                anyhow::bail!("Linera scan loop exited unexpectedly: {result:?}");
            }
            result = &mut retry_handle => {
                anyhow::bail!("Retry loop exited unexpectedly: {result:?}");
            }
            result = &mut http_server_handle => {
                anyhow::bail!("HTTP server exited unexpectedly: {result:?}");
            }
            result = &mut admin_server_handle => {
                anyhow::bail!("Admin HTTP server exited unexpectedly: {result:?}");
            }
            _ = inbox_drain_interval.tick() => {
                // Periodic safety net for a missed `NewIncomingBundle`: sync and
                // drain the inbox so stranded messages (e.g. user burns) are
                // eventually processed even without a fresh notification.
                if let Err(e) = chain_client.synchronize_from_validators().await {
                    tracing::warn!("Periodic sync before inbox drain failed: {e}");
                } else {
                    match chain_client.process_inbox().await {
                        Ok((certs, _)) if !certs.is_empty() => {
                            tracing::info!(count = certs.len(), "Periodic inbox drain processed messages");
                        }
                        Ok(_) => {}
                        Err(e) => tracing::warn!("Periodic inbox drain failed: {e}"),
                    }
                }
            }
            notification = notifications.next() => {

View on GitHub (pinned to 6c226ddcb3)

Solutions

  1. Look for the preceding "Admin HTTP server error" log line — it carries the underlying io error.
  2. Ensure the admin port is exclusively owned by the relay (check ss -ltnp) and not grabbed by a sidecar or second relay instance.
  3. Fix any panicking admin handler (validate/guard admin request payloads).
  4. Restart the relay via its supervisor; consider making the admin server optional if your deployment does not use it.

Example fix

// before
result = &mut admin_server_handle => {
    anyhow::bail!("Admin HTTP server exited unexpectedly: {result:?}");
}

// after: preserve the inner error
result = &mut admin_server_handle => {
    let inner = result.unwrap_or_else(|join| Err(anyhow::anyhow!("join error: {join}")));
    anyhow::bail!("Admin HTTP server exited unexpectedly: {inner:?}");
}
Defensive patterns

Strategy: retry

Validate before calling

// Pre-flight: bind the admin listener before spawn (already done); optionally probe
// 127.0.0.1:{admin_port} is free before relay start to fail fast on conflicts.

Try / catch

// Fatal by design; restart the process. The inner context "Admin HTTP server error" names the io cause.

Prevention

When it happens

Trigger: The admin axum server returns an io error at runtime, or the task panics inside an admin handler. Bind-time port conflicts on the admin port normally fail earlier during TcpListener::bind, so an exit here means a runtime socket error or handler panic.

Common situations: Admin port colliding with a rebinding process after runtime starts; a panic in an admin endpoint handler when queried with unexpected input; socket loss after container network reconfiguration.

Related errors


AI-assisted analysis of linera-io/linera-protocol@6c226ddcb3 (2026-08-22). Data as JSON: /api/errors/410cac8239321406. Report an issue: GitHub.