{"record":{"id":"f99fd19fd7be651e","repo":"jdx/mise","slug":"unsupported-host-path-type-host-path-display","errorCode":null,"errorMessage":"unsupported host path type: {host_path.display}","messagePattern":"unsupported host path type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/oci/layer.rs","lineNumber":189,"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":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/oci/layer.rs#L171-L207","documentation":"build_layer_from_path classifies the host path into Dir, Symlink, or File. Anything else — most commonly FIFOs, device nodes, or sockets — cannot be represented by this layer builder, so it throws this error listing the offending path.","triggerScenarios":"Calling build_layer_from_path with a host path that is neither a directory, a symlink, nor a regular file — e.g. a named pipe (mkfifo), a unix socket, or a device node under /dev — so metadata matches none of the supported kinds.","commonSituations":"Accidentally including a socket or FIFO from a working/runtime directory in a copy spec; a broken special file created by a build step; pointing the layer builder at /dev or /proc entries.","solutions":["Remove the special file from the source directory or exclude it from the copy spec before building the layer.","Replace the FIFO/socket with a regular file (or create it at container runtime instead of baking it into the image).","If the path should have been a regular file, inspect what created it — a leftover runtime artifact usually means the src_dir needs cleaning."],"exampleFix":"// before\ncopy spec includes ./run/app.sock (a socket)\n// after\nrm ./run/app.sock   # or exclude ./run from the copy spec","handlingStrategy":"validation","validationCode":"function assertSupportedKind(p) {\n  const st = fs.lstatSync(p);\n  if (!(st.isDirectory() || st.isFile() || st.isSymbolicLink())) {\n    throw new Error(`unsupported path type (fifo/socket/device?): ${p}`);\n  }\n}","typeGuard":"fn is_layerable(p: &Path) -> bool {\n    match std::fs::symlink_metadata(p) {\n        Ok(m) => m.is_dir() || m.is_file() || m.file_type().is_symlink(),\n        Err(_) => false,\n    }\n}","tryCatchPattern":"match build_layer_from_path(&host, image_path, owner) {\n    Err(e) if e.to_string().contains(\"unsupported host path type\") => {\n        eprintln!(\"exclude the special file (fifo/socket/device) from the copy spec: {host:?}\");\n    }\n    r => r,\n}","preventionTips":["Exclude runtime dirs containing sockets/FIFOs from image copy specs.","Clean build artifacts that create special files before packaging.","lstat source trees to detect unsupported file types early."],"tags":["oci","layer","file-type"],"backgroundTag":"unsupported-configuration","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}