Pumpkin-MC/Pumpkin · error · LoaderError

Wasm plugin initialization error

Error message

Wasm plugin initialization error: {0}

What it means

This is `PluginLoadError::WasmInitializationError`, a `#[from]` wrapper around `PluginInitError`. It surfaces any failure that occurred while booting the WASM engine or initializing the plugin component (engine creation, linker setup, instantiation, init_plugin call, etc.). The inner error's message is embedded via `{0}`.

Solutions

  1. Read the inner `{0}` message to identify which init step failed
  2. Verify the .wasm file exists, is readable, and is a valid WASM component (wasm-tools component wit output)
  3. Check cache directory write permissions and clear stale cache files
  4. Rebuild the plugin and check server logs for the host function that was missing or faulted
Defensive patterns

Strategy: try-catch

Try / catch

match loader.load(path) {
    Err(PluginLoadError::WasmInitializationError(e)) => {
        eprintln!("plugin init failed: {e}"); // drill into the inner PluginInitError
        // skip the plugin, keep server running
    }
    other => other,
}

Prevention

When it happens

Trigger: Any `PluginInitError` raised during `WasmPluginLoader` load: wasmtime engine/linker/component failures, file IO on the plugin or cache, instantiation errors, or host-call errors (`init_plugin`, `get_metadata`).

Common situations: Corrupt or non-component .wasm files, missing WASI host functions, unwritable cache directory, plugin panicking inside `init_plugin`, unreadable plugin file path.

Related errors


AI-assisted analysis of Pumpkin-MC/Pumpkin@8d4639e25a (2026-09-09). Data as JSON: /api/errors/e544c3cf7ee44238. Report an issue: GitHub.

Appendix: source

Thrown at crates/pumpkin/src/plugin/loader/mod.rs:70

    RuntimeError(String),

    #[error("Invalid loader data")]
    InvalidLoaderData,

    #[error(
        "Plugin was built for an incompatible API version. Please rebuild it against this Pumpkin build."
    )]
    ApiVersionMissing,

    #[error(
        "Plugin API version mismatch (plugin {plugin_version}, server {server_version}). Please rebuild it against this Pumpkin build."
    )]
    ApiVersionMismatch {
        plugin_version: u32,
        server_version: u32,
    },

    #[error("Wasm plugin initialization error: {0}")]
    WasmInitializationError(#[from] PluginInitError),
}

View on GitHub (pinned to 8d4639e25a)