facebook/relay · error

Failed to check daemon process status

Error message

Failed to check daemon process status

What it means

Panic in start_daemon_process's readiness poll: child.try_wait() (or equivalent status check) failed while waiting for the newly spawned daemon to bind its socket within the 60-attempt polling loop. The status check is used to detect early child exit, and its failure aborts startup monitoring.

Source

Thrown at compiler/crates/relay-compiler/src/server_daemon.rs:407

        .expect("Failed to clone daemon log file handle");

    let mut child = Command::new(current_exe)
        .args(&args)
        .stdin(Stdio::null())
        .stdout(Stdio::from(log_file))
        .stderr(Stdio::from(log_file_clone))
        .spawn()
        .expect("Failed to spawn daemon process");

    let socket_path = get_socket_path(config_path, projects);
    let max_attempts = 60;
    for i in 0..max_attempts {
        tokio::time::sleep(std::time::Duration::from_secs(1)).await;

        // Detect early daemon-process exit (e.g. invalid project name).
        if let Some(status) = child
            .try_wait()
            .expect("Failed to check daemon process status")
        {
            error!("Daemon process exited during startup with {status}");
            log_daemon_file(&log_path);
            std::process::exit(1);
        }

        if send_request(&socket_path, DaemonRequest::Version)
            .await
            .is_some()
        {
            info!("Daemon is ready.");
            return;
        }
        if i % 10 == 9 {
            info!("Still waiting for daemon to start ({} seconds)...", i + 1);
        }
    }

View on GitHub (pinned to 668b1b85e0)

Solutions

  1. Check the daemon log file for the child's stderr output explaining why it exited or misbehaved
  2. Verify system resources (zombie reaping, PID limits) that can make wait-status queries fail
  3. Restart the daemon; if it persists, run 'server start --foreground' manually to surface the failure directly
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at compiler/crates/relay-compiler/src/server_daemon.rs:407 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of facebook/relay@668b1b85e0 (2026-09-02). Data as JSON: /api/errors/474c2ab5001c13aa. Report an issue: GitHub.