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, or symlink

What it means

In get_inode_at_path, the non-unix build path for resolving on-disk directory entries only implements file/directory/symlink classification; on any other platform, encountering such an entry hits unimplemented! with a message saying only file, directory, or symlink are supported. It is a platform-coverage gap: the unix branch handles char/block devices, fifos, and sockets, the non-unix branch does not.

Source

Thrown at lib/wasix/src/fs/mod.rs:1528

                                                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(),
                                                st_atim: metadata.accessed(),
                                                ..Filestat::default()
                                            },
                                        }
                                    }
                                    #[cfg(not(unix))]
                                    unimplemented!(
                                        "state::get_inode_at_path unknown file type: not file, directory, or symlink"
                                    );
                                }
                            } // end of non-ephemeral entry case
                        } // end of Kind::Dir match case
                    } // end of match
                }; // end of component_resolution block

                // 2. Create an INode and update directory entries
                // --
                // The cur_inode is definitely a directory (Kind::Dir) at this
                // stage, and we need to create an inode (new_inode) and cache
                // as an entry in current directory (entry_name => cur_inode).
                let (entry_name, new_inode, should_insert, should_return) =
                    match component_resolution {
                        ComponentResolution::Create {
                            kind,
                            name,

View on GitHub (pinned to 8c4b9ee9d3)

Solutions

  1. Ensure only regular files, directories, and symlinks exist in host directories shared with the guest on non-unix platforms.
  2. Filter/skip unsupported entry types when building the FS view on non-unix targets.
  3. Port the unix classification logic (char/block/fifo/socket) to the non-unix branch.
  4. Change the arm to return Errno::Notsup instead of panicking for unsupported types.

Example fix

// before
#[cfg(not(unix))]
unimplemented!("state::get_inode_at_path unknown file type ...");

// after
#[cfg(not(unix))]
return Err(Errno::Notsup);
Defensive patterns

Strategy: validation

Validate before calling

// non-unix: only allow file/dir/symlink entries before path resolution
#[cfg(not(unix))]
fn entry_supported(ft: std::fs::FileType) -> bool {
    ft.is_file() || ft.is_dir() || ft.is_symlink()
}

Try / catch

let resolved = std::panic::catch_unwind(|| state.get_inode_at_path(dir, path))
    .map_err(|_| Errno::Notsup)?;

Prevention

When it happens

Trigger: Building/running on a non-unix target (e.g. Windows) and resolving a path whose entry is not a plain file, directory, or symlink (device files, reparse points not classified as symlinks, sockets, etc.).

Common situations: Windows hosts exposing directories containing device files, named pipes, junctions, or other special entries to a guest; cross-platform test suites that pass on unix but panic on windows.

Related errors


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