{"record":{"id":"5af828070b8db6af","repo":"jdx/mise","slug":"unsupported-host-path-type","errorCode":null,"errorMessage":"unsupported host path type: {}","messagePattern":"unsupported host path type: (.+?)","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/oci/layer.rs","lineNumber":141,"sourceCode":"        eyre::bail!(\"cannot copy a file or symlink to the image root\");\n    }\n    if image_path.ends_with('/') {\n        eyre::bail!(\n            \"copy image path {image_path:?} ends with `/` but {} is not a directory; \\\n             specify the exact destination file name\",\n            host_path.display()\n        );\n    }\n\n    let kind = if metadata.file_type().is_symlink() {\n        EntryKind::Symlink(\n            std::fs::read_link(host_path)\n                .wrap_err_with(|| format!(\"reading symlink {}\", host_path.display()))?,\n        )\n    } else if metadata.is_file() {\n        EntryKind::File\n    } else {\n        eyre::bail!(\"unsupported host path type: {}\", host_path.display());\n    };\n    let mode = match &kind {\n        EntryKind::Symlink(_) => 0o777,\n        EntryKind::File if file_is_executable(host_path, &metadata) => 0o755,\n        EntryKind::File => 0o644,\n        EntryKind::Dir => unreachable!(),\n    };\n    let target_path = Path::new(target);\n    let rel = target_path\n        .file_name()\n        .map(PathBuf::from)\n        .ok_or_else(|| eyre::eyre!(\"copy image path has no file name: {image_path}\"))?;\n    let prefix = target_path\n        .parent()\n        .unwrap_or_else(|| Path::new(\"\"))\n        .to_string_lossy();\n    let size = if matches!(kind, EntryKind::Symlink(_)) {\n        0","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/oci/layer.rs#L123-L159","documentation":"build_layer_from_path classifies the source by its file type (via symlink_metadata, so symlinks are detected as such). Only regular files, symlinks, and directories are supported; anything else — FIFO, unix socket, block/char device — hits this guard. The tar layer has no meaningful, portable representation for those types.","triggerScenarios":"A copy entry whose source is a named pipe (mkfifo), a listening unix socket file (e.g. /var/run/docker.sock on hosts where it's a socket rather than a symlink), or a device node.","commonSituations":"Broad globbing over a directory that happens to include runtime sockets/pipes; copying /var/run or /tmp contents into an image; leftover fifo artifacts in a dotfiles repo.","solutions":["Point the entry at the real file or directory you intended, not the socket/fifo.","Exclude runtime artifacts (sockets, fifos) from the source set before building.","If you need a socket in the image, create it at container start (entrypoint), not by copying from the host."],"exampleFix":"# before\nfiles = [ \"/var/run/docker.sock:/run/docker.sock\" ]\n\n# after\n# do not copy sockets; create at runtime, e.g. via entrypoint\nfiles = [ \"./run-wrapper.sh:/usr/local/bin/run-wrapper.sh\" ]","handlingStrategy":"validation","validationCode":"import os, stat, sys\nfor src, _ in copy_entries.items():\n    m = os.lstat(src).st_mode\n    kind = stat.S_IFMT(m)\n    if kind not in (stat.S_IFREG, stat.S_IFLNK, stat.S_IFDIR):\n        sys.exit(f\"unsupported source type (fifo/socket/device): {src}\")","typeGuard":"fn is_layer_supported(p: &Path) -> bool {\n    matches!(std::fs::symlink_metadata(p)\n        .map(|m| m.file_type())\n        .map(|ft| ft.is_file() || ft.is_symlink() || ft.is_dir()), Ok(true))\n}","tryCatchPattern":null,"preventionTips":["Do not glob over /tmp, /var/run, or other runtime dirs containing sockets and fifos.","Keep dotfiles repos free of mkfifo/socket artifacts (check with `find . ! -type f ! -type d ! -type l`).","Create sockets/pipes at container runtime, never by layering host files."],"tags":["oci","layer","file-type","unix-socket"],"backgroundTag":"unsupported-file-type","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}