{"record":{"id":"747c5ec814fa5f2a","repo":"wasmerio/wasmer","slug":"state-get-inode-at-path-unknown-file-type-not-fi","errorCode":null,"errorMessage":"state::get_inode_at_path unknown file type: not file, directory, symlink, char device, block device, fifo, or socket","messagePattern":"state::get_inode_at_path unknown file type: not file, directory, symlink, char device, block device, fifo, or socket","errorType":"panic","errorClass":"panic","httpStatus":null,"severity":"error","filePath":"lib/wasix/src/fs/mod.rs","lineNumber":1503,"sourceCode":"                                        entry_name,\n                                    }\n                                } else {\n                                    #[cfg(unix)]\n                                    {\n                                        //use std::os::unix::fs::FileTypeExt;\n                                        let file_type: Filetype = if file_type.is_char_device() {\n                                            Filetype::CharacterDevice\n                                        } else if file_type.is_block_device() {\n                                            Filetype::BlockDevice\n                                        } else if file_type.is_fifo() {\n                                            // FIFO doesn't seem to fit any other type, so unknown\n                                            Filetype::Unknown\n                                        } else if file_type.is_socket() {\n                                            // TODO: how do we know if it's a `SocketStream` or\n                                            // a `SocketDgram`?\n                                            Filetype::SocketStream\n                                        } else {\n                                            unimplemented!(\n                                                \"state::get_inode_at_path unknown file type: not file, directory, symlink, char device, block device, fifo, or socket\"\n                                            );\n                                        };\n\n                                        ComponentResolution::Special {\n                                            kind: Kind::File {\n                                                handle: None,\n                                                path: entry_path_buf,\n                                                fd: None,\n                                            },\n                                            name: entry_path.into(),\n                                            entry_name,\n                                            stat: Filestat {\n                                                st_filetype: file_type,\n                                                st_ino: Inode::from_path(path_str).as_u64(),\n                                                st_size: metadata.len(),\n                                                st_ctim: metadata.created(),\n                                                st_mtim: metadata.modified(),","sourceCodeStart":1485,"sourceCodeEnd":1521,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/wasix/src/fs/mod.rs#L1485-L1521","documentation":"During get_inode_at_path, when a path component resolves to an on-disk special file whose type cannot be classified into a known Filetype (file, directory, symlink, char device, block device, fifo, socket), the code panics with unimplemented!. Filetype::SocketStream is used for sockets, but anything unrecognized (unknown/other file types reported by the OS) falls through to the panic.","triggerScenarios":"Path resolution encounters a real filesystem entry whose stat file_type matches none of the supported predicates (not file/dir/symlink/char/block/fifo/socket) — e.g. exotic OS-specific file types or Filetype::Unknown results.","commonSituations":"Preopening directories containing unusual files (procfs/sysfs oddities, FUSE nodes, whiteouts, future/OS-specific types), running on unusual platforms, or mounting host paths with special files.","solutions":["Remove or exclude the unrecognized special file from the directories exposed to the guest.","Extend the classification chain to map the unknown type to a supported Filetype (e.g. treat unknown as RegularFile or return Errno::Notsup).","Stat the offending path on the host beforehand to identify what type it is, and replace it with a supported kind.","Patch the unimplemented! arm to return an error (Errno::Notsup) rather than panicking."],"exampleFix":"// before\n} else {\n    unimplemented!(\"state::get_inode_at_path unknown file type ...\")\n};\n\n// after\n} else {\n    Filetype::Unknown // or return Errno::Notsup\n};","handlingStrategy":"validation","validationCode":"// stat host paths before exposing them to the guest\nfn is_supported_file_type(md: &std::fs::Metadata) -> bool {\n    use std::os::unix::fs::FileTypeExt;\n    let ft = md.file_type();\n    ft.is_file() || ft.is_dir() || ft.is_symlink()\n        || ft.is_char_device() || ft.is_block_device()\n        || ft.is_fifo() || ft.is_socket()\n}","typeGuard":null,"tryCatchPattern":"let resolved = std::panic::catch_unwind(|| state.get_inode_at_path(dir, path))\n    .map_err(|_| Errno::Notsup)?;","preventionTips":["Pre-scan preopened directories and exclude unrecognized special files","Avoid exposing procfs/sysfs/FUSE mounts to guests","Map unknown file types to Errno::Notsup instead of letting them reach the panic"],"tags":["wasix","filesystem","filetype","unimplemented"],"backgroundTag":"unsupported-inode-kind","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}