{"record":{"id":"77517c6d53382c63","repo":"jdx/mise","slug":"failed-to-archive-remote-source-with-status","errorCode":null,"errorMessage":"failed to archive remote source with {status}","messagePattern":"failed to archive remote source with (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/remote.rs","lineNumber":816,"sourceCode":"    };\n    let mut command = tokio::process::Command::new(tar);\n    command.kill_on_drop(true);\n    command.args([\"-czf\"]);\n    command.arg(&archive);\n    if session.host.copy_links {\n        command.arg(\"-h\");\n    }\n    for exclude in &session.host.exclude {\n        command.arg(format!(\"--exclude={exclude}\"));\n    }\n    let status = command\n        .args([\"-C\"])\n        .arg(archive_source)\n        .arg(\".\")\n        .status()\n        .await?;\n    if !status.success() {\n        bail!(\"failed to archive remote source with {status}\");\n    }\n    session\n        .status_with_stdin_async(&[\"tar\", \"-xzf\", \"-\", \"-C\", project], File::open(archive)?)\n        .await\n}\n\nfn validate_copy_link(source: &Path, link: &Path) -> Result<()> {\n    validate_copy_link_path(source, link)?;\n    let path = source.join(link);\n    fs::metadata(&path)\n        .wrap_err_with(|| format!(\"copy_link target does not exist: {}\", link.display()))?;\n    Ok(())\n}\n\nfn validate_copy_link_path(source: &Path, link: &Path) -> Result<()> {\n    if link.as_os_str().is_empty()\n        || link.is_absolute()\n        || link.components().any(|component| {","sourceCodeStart":798,"sourceCodeEnd":834,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/remote.rs#L798-L834","documentation":"When staging a remote source, mise runs tar (with -C archive_source) to archive the project files locally before streaming them over the session. If that tar process exits non-zero, the source could not be archived and mise bails with the tar exit status.","triggerScenarios":"The tar child process archiving the staged source exits non-zero — unreadable files, disk full while writing the archive, or tar not present/behaving unexpectedly on the machine building the archive.","commonSituations":"Remote staging fails when the project directory contains files the SSH account cannot read, the temp filesystem holding archive_source is full, or permissions changed mid-run.","solutions":["Check the tar stderr shown above the error for the specific file that failed","Ensure the SSH account can read all files in the staged source directory","Free space on the filesystem holding the archive temp directory","Re-run to rule out transient file changes during archiving"],"exampleFix":"// before\nbail!(\"failed to archive remote source with {status}\");\n// after: capture tar stderr\nbail!(\"failed to archive remote source (tar exit {status}): {stderr}\");","handlingStrategy":"try-catch","validationCode":"test -r \"$file\" || echo \"unreadable: $file\"  # pre-check staged files\n df -h \"$(dirname \"$archive\")\"                  # ensure space for the archive","typeGuard":null,"tryCatchPattern":"try { await archiveRemoteSource(); } catch (e) { if (String(e).includes('failed to archive remote source')) { logTarDiag(); } throw e; }","preventionTips":["Ensure the staging account can read every file in the source tree","Monitor temp-disk free space before remote staging","Avoid mutating the source tree concurrently with archiving"],"tags":["tar","remote","process-exit","filesystem"],"backgroundTag":"command-not-found","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}