facebook/relay · error

Failed to open daemon log file

Error message

Failed to open daemon log file

What it means

Startup panic in start_daemon_process: the log file derived from the config path and project list (via get_log_file_path) could not be created or opened for appending. The daemon's stdout/stderr are redirected into this file, so without it the child's output would be lost and startup aborts.

Source

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

    start_extra_args: &[String],
) {
    let current_exe = std::env::current_exe().expect("Failed to get current exe path");
    let mut args = vec!["server".to_string()];
    args.extend(extra_args.iter().cloned());
    for project in projects {
        args.push("--project".to_string());
        args.push(project.clone());
    }
    args.push("start".to_string());
    args.push("--foreground".to_string());
    args.extend(start_extra_args.iter().cloned());

    let log_path = get_log_file_path(config_path, projects);
    let log_file = File::options()
        .create(true)
        .append(true)
        .open(&log_path)
        .expect("Failed to open daemon log file");
    let log_file_clone = log_file
        .try_clone()
        .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).

View on GitHub (pinned to 668b1b85e0)

Solutions

  1. Check that the daemon log directory exists and is writable by the current user
  2. Inspect the computed log path for an invalid or unwritable location (read-only mount, permission denial)
  3. Free disk space or clear a full filesystem if writes fail
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at compiler/crates/relay-compiler/src/server_daemon.rs:386 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/9a05ffa8873bfcd7. Report an issue: GitHub.