wasmerio/wasmer · error · panic
state::get_inode_at_path unknown file type: not file, direct
Error message
state::get_inode_at_path unknown file type: not file, directory, symlink, char device, block device, fifo, or socket
What it means
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.
Source
Thrown at lib/wasix/src/fs/mod.rs:1503
entry_name,
}
} else {
#[cfg(unix)]
{
//use std::os::unix::fs::FileTypeExt;
let file_type: Filetype = if file_type.is_char_device() {
Filetype::CharacterDevice
} else if file_type.is_block_device() {
Filetype::BlockDevice
} else if file_type.is_fifo() {
// FIFO doesn't seem to fit any other type, so unknown
Filetype::Unknown
} else if file_type.is_socket() {
// TODO: how do we know if it's a `SocketStream` or
// a `SocketDgram`?
Filetype::SocketStream
} else {
unimplemented!(
"state::get_inode_at_path unknown file type: not file, directory, symlink, char device, block device, fifo, or socket"
);
};
ComponentResolution::Special {
kind: Kind::File {
handle: None,
path: entry_path_buf,
fd: None,
},
name: entry_path.into(),
entry_name,
stat: Filestat {
st_filetype: file_type,
st_ino: Inode::from_path(path_str).as_u64(),
st_size: metadata.len(),
st_ctim: metadata.created(),
st_mtim: metadata.modified(),View on GitHub (pinned to 8c4b9ee9d3)
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.
Example fix
// before
} else {
unimplemented!("state::get_inode_at_path unknown file type ...")
};
// after
} else {
Filetype::Unknown // or return Errno::Notsup
}; Defensive patterns
Strategy: validation
Validate before calling
// stat host paths before exposing them to the guest
fn is_supported_file_type(md: &std::fs::Metadata) -> bool {
use std::os::unix::fs::FileTypeExt;
let ft = md.file_type();
ft.is_file() || ft.is_dir() || ft.is_symlink()
|| ft.is_char_device() || ft.is_block_device()
|| ft.is_fifo() || ft.is_socket()
} Try / catch
let resolved = std::panic::catch_unwind(|| state.get_inode_at_path(dir, path))
.map_err(|_| Errno::Notsup)?; Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- state::get_inode_at_path for buffers
- state::get_inode_at_path unknown file type: not file, direct
- wasi::path_unlink_file for Buffer
- Symlinks in wasi::fd_read
- wasi::platform_clock_time_get(wasi::Clockid::ProcessCputimeI
AI-assisted analysis of wasmerio/wasmer@8c4b9ee9d3 (2026-09-01).
Data as JSON: /api/errors/747c5ec814fa5f2a.
Report an issue: GitHub.