{"record":{"id":"5646578a7401b1de","repo":"facebook/flow","slug":"failed-to-create","errorCode":null,"errorMessage":"failed to create {}: {}","messagePattern":"failed to create (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust_port/crates/flow_cli/src/init_command.rs","lineNumber":143,"sourceCode":"        untyped,\n        declarations,\n        includes,\n        libs,\n        options,\n        lints,\n    );\n    let config = match config {\n        Ok((config, warnings)) if warnings.is_empty() => config,\n        Ok((_config, warnings)) => error(\n            warnings\n                .into_iter()\n                .map(|flow_config::Warning(line, msg)| (line, msg))\n                .collect(),\n        ),\n        Err(flow_config::Error(line, msg)) => error(vec![(line, msg)]),\n    };\n    let mut out = std::fs::File::create(&file)\n        .unwrap_or_else(|err| panic!(\"failed to create {}: {}\", file.display(), err));\n    flow_config::write(&mut out, &config)\n        .unwrap_or_else(|err| panic!(\"failed to write {}: {}\", file.display(), err));\n}\n\npub(crate) fn command() -> command_spec::Command {\n    command_spec::command(spec(), main)\n}\n","sourceCodeStart":125,"sourceCodeEnd":151,"githubUrl":"https://github.com/facebook/flow/blob/f88ac94bcf6992f5d5a158854d94613ebb92c6e6/rust_port/crates/flow_cli/src/init_command.rs#L125-L151","documentation":"During flow init, after building the config, the CLI creates the .flowconfig file with std::fs::File::create. Failure panics with the target path and the OS error. Typical errno causes: EACCES (directory not writable), EISDIR/EEXIST variant where .flowconfig is a directory, EROFS (read-only mount), or ENAMETOOLONG.","triggerScenarios":"Running flow init in a directory the user cannot write to; a directory named .flowconfig already existing at the target; running on a read-only filesystem or container layer; path length limits exceeded.","commonSituations":"Running flow init in system directories or a mounted repo owned by another user; Docker/CI sandboxes with read-only workspaces; leftover .flowconfig directory from a mis-scripted setup.","solutions":["cd into a writable project directory and rerun flow init","If .flowconfig exists as a directory, remove it (rmdir .flowconfig) or rename it, then rerun","chmod u+w . on the target directory or fix ownership","Check for a read-only mount (mount | grep <dir>) and remount rw or pick another location"],"exampleFix":"# before\ncd /opt/shared-read-only && flow init   # panics: failed to create /opt/shared-read-only/.flowconfig: Permission denied\n\n# after\nmkdir -p ~/proj && cd ~/proj && flow init","handlingStrategy":"validation","validationCode":"# before running flow init\ntest -w \"$(pwd)\" || echo \"not writable: fix permissions/mount\"\n[ ! -e .flowconfig ] || echo \".flowconfig already exists (and must not be a directory)\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run flow init only inside a writable project directory","Check for a pre-existing .flowconfig directory before initializing","In containers/CI, confirm the workspace mount is read-write"],"tags":["filesystem","permissions","flow-init","config"],"backgroundTag":"file-create-permission-denied","analyzedSha":"f88ac94bcf6992f5d5a158854d94613ebb92c6e6","analyzedAt":"2026-08-20T10:41:37.992Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}