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

  1. Remove or exclude the unrecognized special file from the directories exposed to the guest.
  2. Extend the classification chain to map the unknown type to a supported Filetype (e.g. treat unknown as RegularFile or return Errno::Notsup).
  3. Stat the offending path on the host beforehand to identify what type it is, and replace it with a supported kind.
  4. 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

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


AI-assisted analysis of wasmerio/wasmer@8c4b9ee9d3 (2026-09-01). Data as JSON: /api/errors/747c5ec814fa5f2a. Report an issue: GitHub.