{"record":{"id":"173a52437f7c2574","repo":"jdx/mise","slug":"failed-rename-err","errorCode":null,"errorMessage":"failed rename: {} -> {}: {err}","messagePattern":"failed rename: (.+?) -> (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dotfiles/add.rs","lineNumber":353,"sourceCode":"                                    )\n                                })?;\n                                let recovery = tempfile::Builder::new()\n                                    .prefix(\".mise-dotfiles-rollback-\")\n                                    .tempdir_in(parent)?;\n                                let recovery_path = recovery.path().join(\"target\");\n                                // Keep the original on its own filesystem until\n                                // the entire transaction succeeds. This makes\n                                // rollback an atomic rename instead of another\n                                // potentially failing recursive removal.\n                                file::rename(&item.target, &recovery_path)?;\n                                moved_targets.push(MovedTarget {\n                                    target: item.target.clone(),\n                                    source: item.source.clone(),\n                                    recovery: Some(recovery),\n                                });\n                                system::files::copy_path(&recovery_path, &item.source)?;\n                            }\n                            Err(err) => bail!(\n                                \"failed rename: {} -> {}: {err}\",\n                                item.target.display_user(),\n                                item.source.display_user()\n                            ),\n                        }\n                        journal::commit_changes(pending);\n                        info!(\n                            \"dotfiles: moved {} to {}\",\n                            item.target.display_user(),\n                            item.source.display_user()\n                        );\n                    } else {\n                        target_backups.push((\n                            item.target.clone(),\n                            backup_path(\n                                &item.target,\n                                &backup_dir.path().join(\"targets\").join(index.to_string()),\n                            )?,","sourceCodeStart":335,"sourceCodeEnd":371,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/dotfiles/add.rs#L335-L371","documentation":"During `mise dot add`, a staged rename of the source file into place failed mid-apply. The operation bails with the target, source, and underlying OS error; prior steps are handed to rollback via the pushed recovery item. This usually indicates a filesystem-level problem moving the file (permissions, cross-device, missing parent dir).","triggerScenarios":"The internal rename step returns Err while applying a new dotfile; the code bails with `failed rename: {target} -> {source}: {err}`.","commonSituations":"Source on a different filesystem/device than destination; read-only or permission-restricted directory; parent directory deleted mid-run; disk full.","solutions":["Read the trailing OS error for the root cause (e.g. EXDEV, EACCES, ENOSPC)","Ensure source and target are on the same filesystem, or pre-copy manually before `mise dot add`","Fix permissions on the source file and destination directories","Re-run `mise dot add`; if the run was interrupted, recover state via `mise dot` recovery/journal commands if available"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# preflight: same device and writable destination\ndf --output=target \"$SRC\" \"$DST_PARENT\" && test -w \"$DST_PARENT\"","typeGuard":null,"tryCatchPattern":"match mise_dot_add(...) {\n    Err(e) if e.contains(\"failed rename\") => {\n        // inspect trailing OS error; fix permissions/device, then retry\n    }\n    ...\n}","preventionTips":["Keep dotfile sources and targets on the same filesystem when possible","Run with sufficient permissions; check disk space before bulk adds"],"tags":["dotfiles","filesystem","rename"],"backgroundTag":"file-write-failed","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}