facebook/flow · error

failed to write {}: {}

Error message

failed to write {}: {}

What it means

After flow init successfully creates .flowconfig, flow_config::write serializes the config into it. A write failure panics with the path and OS error. The file was just created, so the common causes are ENOSPC (disk full or quota exceeded), EIO (failing disk / flaky network filesystem), or EROFS.

Source

Thrown at rust_port/crates/flow_cli/src/init_command.rs:145

        includes,
        libs,
        options,
        lints,
    );
    let config = match config {
        Ok((config, warnings)) if warnings.is_empty() => config,
        Ok((_config, warnings)) => error(
            warnings
                .into_iter()
                .map(|flow_config::Warning(line, msg)| (line, msg))
                .collect(),
        ),
        Err(flow_config::Error(line, msg)) => error(vec![(line, msg)]),
    };
    let mut out = std::fs::File::create(&file)
        .unwrap_or_else(|err| panic!("failed to create {}: {}", file.display(), err));
    flow_config::write(&mut out, &config)
        .unwrap_or_else(|err| panic!("failed to write {}: {}", file.display(), err));
}

pub(crate) fn command() -> command_spec::Command {
    command_spec::command(spec(), main)
}

View on GitHub (pinned to f88ac94bcf)

Solutions

  1. Free space or raise the quota (df -h ., quota -s), then rerun flow init
  2. If on NFS/network storage, verify mount health and retry after the hiccup passes
  3. Point the project (or TMPDIR) at a local writable volume and retry
  4. Check dmesg/system logs for disk errors if EIO is reported

Example fix

# before
flow init   # panics: failed to write .flowconfig: No space left on device

# after
df -h .            # identify the full volume
clean / du -sh *    # free space (or raise quota)
flow init
Defensive patterns

Strategy: validation

Validate before calling

# before running flow init
df -h .        # abort if the target volume is full
quota -s 2>/dev/null || true

Prevention

When it happens

Trigger: Disk fills up between File::create and the write; user quota (EDQUOT) exhausted on the volume; I/O errors from a failing disk or an NFS/SMB hiccup mid-write.

Common situations: CI runners or containers with tiny tmp/root filesystems; corporate machines with home-directory quotas; network-mounted checkouts dropping out during flow init.

Related errors


AI-assisted analysis of facebook/flow@f88ac94bcf (2026-08-20). Data as JSON: /api/errors/4506fa6a73ff5190. Report an issue: GitHub.