{"record":{"id":"7ef68fdf483e946b","repo":"jdx/mise","slug":"brew-cask-unsupported-directory-entry-7ef68f","errorCode":null,"errorMessage":"brew-cask: unsupported directory entry '{}'","messagePattern":"brew-cask: unsupported directory entry '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask/state.rs","lineNumber":480,"sourceCode":"        .into_iter()\n        .collect::<std::result::Result<Vec<_>, _>>()?;\n    entries.sort_by(|a, b| a.path().cmp(b.path()));\n    let mut digest = Sha256::new();\n    for entry in entries {\n        let path = entry.path();\n        let relative = path.strip_prefix(root)?;\n        if relative.as_os_str().is_empty() {\n            continue;\n        }\n        let metadata = path.symlink_metadata()?;\n        digest.update([if metadata.file_type().is_symlink() {\n            b'l'\n        } else if metadata.is_dir() {\n            b'd'\n        } else if metadata.is_file() {\n            b'f'\n        } else {\n            bail!(\n                \"brew-cask: unsupported directory entry '{}'\",\n                path.display()\n            );\n        }]);\n        hash_digest_field(&mut digest, relative.as_os_str().as_encoded_bytes());\n        if metadata.file_type().is_symlink() {\n            let target = std::fs::read_link(path)?;\n            hash_digest_field(&mut digest, target.as_os_str().as_encoded_bytes());\n        } else if metadata.is_dir() {\n        } else if metadata.is_file() {\n            hash_digest_field(&mut digest, hash::file_hash_sha256(path, None)?.as_bytes());\n        }\n    }\n    Ok(hex::encode(digest.finalize()))\n}\n\npub(super) fn hash_digest_field(digest: &mut Sha256, value: &[u8]) {\n    digest.update((value.len() as u64).to_le_bytes());","sourceCodeStart":462,"sourceCodeEnd":498,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/brew/cask/state.rs#L462-L498","documentation":"cask_directory_digest computes a content digest over a directory tree, hashing each entry kind (l for symlink, d for dir, f for file). Any entry that is none of these (socket, fifo, device) cannot be represented in the digest, so mise bails naming the offending path. Digests must be deterministic, so exotic entry types are rejected rather than skipped.","triggerScenarios":"cask_directory_digest (called from CaskTargetFingerprint/cask_target_fingerprint) walks a target directory and encounters an entry whose metadata.is_file(), is_dir(), and is_symlink() are all false — e.g. a Unix socket or FIFO inside the app bundle directory being fingerprinted.","commonSituations":"Apps that create sockets/fifos inside their bundle or support directories; running app leaving runtime files where the fingerprint is computed; dev/tmp mounts with special files.","solutions":["Locate the special file (`find <dir> ! -type f ! -type d ! -type l`) and remove or relocate it","Quit the app that created the socket/fifo, then retry","Reinstall the cask via `brew reinstall --cask <token>` to restore a clean tree"],"exampleFix":"// shell\n// before: MyApp.app contains a socket from a running helper\n// after:\npkill MyApp; find MyApp.app -type s -delete; mise install <cask-token>","handlingStrategy":"validation","validationCode":"use std::os::unix::fs::FileTypeExt;\nfn tree_has_special_files(root: &std::path::Path) -> std::io::Result<bool> {\n    for entry in std::fs::read_dir(root)? {\n        let md = entry?.metadata()?;\n        let ft = md.file_type();\n        if ft.is_socket() || ft.is_fifo() || ft.is_block_device() || ft.is_char_device() {\n            return Ok(true);\n        }\n    }\n    Ok(false)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Quit apps before fingerprinting their bundles so helpers release sockets/fifos","Scan target trees for special files with `find <dir> ! -type f ! -type d ! -type l` first","Reinstall the cask if runtime artifacts polluted the tree"],"tags":["filesystem","digest","unsupported-type","special-file"],"backgroundTag":"invalid-argument-value","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"}