{"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":null,"httpStatus":null,"severity":"error","filePath":"src/oci/layer.rs","lineNumber":192,"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":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/oci/layer.rs#L174-L210","documentation":"`build_layer_from_path` classifies the host path as symlink, file, or directory to choose an EntryKind; any other file type (fifo, socket, device node) has no image representation here and fails with `unsupported host path type: <path>`.","triggerScenarios":"Calling `build_layer_from_path` on a host path whose metadata is neither dir, file, nor symlink — e.g. a FIFO created by `mkfifo`, a unix socket, or a device file in the copy set.","commonSituations":"Copy rules over a directory tree that includes sockets/fifos generated at runtime (e.g. a dev server left a .sock file); including /run or /var/run contents; accidental inclusion of device nodes.","solutions":["Exclude sockets/fifos/devices from the copy set (filter or delete them from the source directory first).","Copy the regular files you need explicitly instead of a broad directory sweep.","If a device node is truly needed, create it at container start (entrypoint) rather than baking it into a layer."],"exampleFix":"// before\nbuild_layer_from_path(\"/run/app/app.sock\", \"/run/app/app.sock\", owner)?; // error\n\n// after\n// skip non-regular entries\nif src.is_dir() || src.is_file() || src.symlink_metadata().is_ok() && src.file_type().map(|t| t.is_symlink()).unwrap_or(false) {\n    build_layer_from_path(src, \"/run/app/app.sock\", owner)?;\n} else {\n    eprintln!(\"skipping special file {}\", src.display());\n}","handlingStrategy":"validation","validationCode":"let md = std::fs::symlink_metadata(host)?;\nlet ok = md.is_dir() || md.is_file() || md.file_type().is_symlink();\nif !ok {\n    bail!(\"skip special file {} (socket/fifo/device) before layering\", host.display());\n}","typeGuard":null,"tryCatchPattern":"match build_layer_from_path(host, image_path, owner) {\n    Err(e) if e.to_string().contains(\"unsupported host path type\") => {\n        eprintln!(\"skipping special file: {e}\");\n        Ok(())\n    }\n    r => r,\n}","preventionTips":["Prune sockets/FIFOs/devices from staged directories before building layers.","Exclude runtime dirs like /run or tmp dirs from copy sets.","Clean build outputs of stale .sock/.pid artifacts before packaging."],"tags":["oci","layer","filesystem","unsupported-type"],"backgroundTag":"incompatible-source-type","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"}