jdx/mise · error
is still not writable after bootstrap
Error message
{} is still not writable after bootstrap What it means
After bootstrap runs sudo mkdir/chown to create the brew prefix and make it writable, it re-checks writability. If the prefix is still not writable by the current user — sudo failed silently, a read-only filesystem, sudoers denied the command, or something re-owned the tree — mise bails rather than continuing with a broken prefix.
Solutions
- Run once interactively so sudo can prompt, or configure passwordless sudoers for mkdir/chown on the prefix
- Manually create and chown the prefix: `sudo mkdir -p <prefix> && sudo chown -R $USER <prefix>` then re-run
- Check the mount (`findmnt <prefix>`) — remount read-write or move MISE_SYSTEM_BREW_PREFIX to a writable location
Example fix
# before mise bootstrap packages apply # fails in non-interactive CI # after (CI) sudo mkdir -p /home/linuxbrew/.linuxbrew && sudo chown -R "$(id -un)" /home/linuxbrew/.linuxbrew
Defensive patterns
Strategy: validation
Validate before calling
p="${MISE_SYSTEM_BREW_PREFIX:-/home/linuxbrew/.linuxbrew}"
[ -w "$p" ] || echo "prefix $p not writable — expect sudo bootstrap" Try / catch
try {
bootstrapPackages();
} catch (e) {
if (String(e).includes('still not writable after bootstrap')) {
// sudo likely failed non-interactively; pre-create with correct ownership
run(`sudo mkdir -p ${prefix} && sudo chown -R ${user} ${prefix}`);
bootstrapPackages();
} else throw e;
} Prevention
- In CI, pre-create the prefix with correct ownership instead of relying on interactive sudo
- Configure passwordless sudo for the bootstrap mkdir/chown commands
- Verify the prefix lives on a writable (non-read-only, non-root-squashed) filesystem
When it happens
Trigger: bootstrap executed `sudo mkdir`/`sudo chown` for the prefix, but writable(&prefix) still returns false afterwards: sudo requires a password (non-interactive run), sudoers lacks permission, the filesystem is read-only, or chown targeted the wrong tree.
Common situations: Running in CI without a TTY where `sudo` cannot prompt for a password; containers where sudo isn't configured for the user; the prefix on a read-only mount or NFS with root_squash.
Understand the failure class
Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.
Related errors
- brew-cask: refusing elevated operation through mutable…
- cannot determine the current user to own
- cannot determine the current user to own
- not running as root and system_packages.sudo is disabled…
- app Info.plist must be a regular file
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/11b96da1b2f5642d.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/packages/brew/prefix.rs:229
let owner = if cfg!(target_os = "macos") {
format!("{user}:admin")
} else {
user
};
let mut mkdir_dirs: Vec<String> = vec![prefix.to_string_lossy().to_string()];
mkdir_dirs.extend(dirs.iter().map(|d| d.display().to_string()));
let mkdir_args: Vec<String> = ["-p".to_string()].into_iter().chain(mkdir_dirs).collect();
let chown_args: Vec<String> = vec!["-R".to_string(), owner, prefix.display().to_string()];
if dry_run {
miseprintln!("{}", sudo::argv("mkdir", &mkdir_args).join(" "));
miseprintln!("{}", sudo::argv("chown", &chown_args).join(" "));
return Ok(());
}
info!("creating {} (requires sudo once)", prefix.display());
sudo::run("mkdir", &mkdir_args, &[])?;
sudo::run("chown", &chown_args, &[])?;
if !writable(&prefix) {
bail!("{} is still not writable after bootstrap", prefix.display());
}
} else if dry_run {
// prefix is ours but subdirs are missing — show what a real run
// would create (no sudo needed)
for dir in &missing_subdirs {
miseprintln!("mkdir -p {}", dir.display());
}
} else {
// prefix is ours, just fill in missing subdirs
for dir in missing_subdirs {
crate::file::create_dir_all(&dir)?;
}
}
Ok(())
}
View on GitHub (pinned to 533346cc37)