{"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/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/brew/cask/state.rs#L462-L498","documentation":"While hashing a cask directory's contents for its content digest, cask_directory_digest classifies each entry as symlink, directory, or file. Any other entry kind (socket, fifo, device node) has no stable content identity, so the digest computation aborts with this error.","triggerScenarios":"cask_directory_digest (called from CaskTargetFingerprint) iterates a directory tree and encounters an entry whose file type is none of symlink/dir/file.","commonSituations":"An app bundle or support directory contains a Unix domain socket or named pipe left by a running daemon; dev-mode tooling created special files inside an application directory.","solutions":["Find the special entry (`find <dir> ! -type f ! -type d ! -type l`) and remove it.","Stop the process creating the socket/fifo inside the cask directory, then retry.","Reinstall the cask to restore a clean artifact tree."],"exampleFix":"// before: daemon socket inside app dir\n$ find /Applications/MyApp.app ! -type f ! -type d ! -type l\n/Applications/MyApp.app/Contents/daemon.sock\n\n// after: stop daemon, remove socket, retry the mise operation","handlingStrategy":"validation","validationCode":"let bad: Vec<_> = walk(dir).filter(|p| {\n    let ft = std::fs::symlink_metadata(p).unwrap().file_type();\n    !(ft.is_file() || ft.is_dir() || ft.is_symlink())\n}).collect();\nif !bad.is_empty() { /* stop daemons and remove special entries first */ }","typeGuard":"fn digestable_entry(p: &Path) -> bool {\n    matches!(std::fs::symlink_metadata(p).map(|m| m.file_type()), Ok(ft)\n        if ft.is_file() || ft.is_dir() || ft.is_symlink())\n}","tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"unsupported directory entry\") => {\n        let dir = extract_dir(&e);\n        find_and_remove_special_entries(dir)?; retry()\n    }\n    r => r,\n}","preventionTips":["Stop running apps/daemons before cask installs that hash their bundles.","Scan cask directories for sockets/fifos after dev-tool usage.","Keep special-purpose files outside Homebrew Caskroom/Application paths."],"tags":["cask","digest","filesystem","unsupported-type"],"backgroundTag":"unsupported-operation","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"}