Pumpkin-MC/Pumpkin · critical · PluginInitError

Failed to setup linker

Error message

Failed to setup linker: {0}

What it means

This is `PluginInitError::LinkerSetupFailed`, wrapping a `wasmtime::Error`. Pumpkin failed while setting up the component `Linker` — the object that maps host functions (WIT interfaces) into the WASM guest. This happens before any plugin is instantiated, so it indicates a host-side definition conflict or error.

Solutions

  1. Read the wrapped wasmtime::Error to see which WIT instance conflicted
  2. Ensure each WIT interface is defined in the linker only once
  3. Regenerate bindings with the same wit package and wasmtime version the server uses
  4. Update or rebuild Pumpkin so linker setup code matches its wasmtime dependency
Defensive patterns

Strategy: try-catch

Try / catch

match init::setup_linker(&engine) {
    Err(PluginInitError::LinkerSetupFailed(e)) => {
        eprintln!("linker setup failed: {e} — check for duplicate WIT instance definitions");
    }
    other => other,
}

Prevention

When it happens

Trigger: Adding Pumpkin's WIT host interfaces to a `wasmtime::component::Linker`, e.g. duplicate instance definitions or a type mismatch in the generated bindings, returned as a wasmtime::Error.

Common situations: Registering the same WIT world/instance twice, mismatched generated bindings between the server and its WIT package, wasmtime version drift after an update.

Related errors


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

Appendix: source

Thrown at crates/pumpkin/src/plugin/loader/wasm/wasm_host/mod.rs:25

use crate::plugin::{
    Context, PluginMetadata, cache::calculate_hash_for_bytes,
    loader::wasm::wasm_host::state::PluginHostState, permissions,
};
use pumpkin_plugin_runtime::RuntimeSpawner;

pub mod args;
pub mod concurrent_store;
pub mod logging;
pub mod signature;
pub mod state;
pub mod wit;

#[derive(Error, Debug)]
pub enum PluginInitError {
    #[error("Engine creation failed: {0}")]
    EngineCreationFailed(wasmtime::Error),
    #[error("Failed to setup linker: {0}")]
    LinkerSetupFailed(wasmtime::Error),
    #[error("Plugin is built against a different API version: {0}")]
    ApiVersionMismatch(wasmtime::Error),
    #[error("Failed to read plugin file: {0}")]
    FileReadFailed(std::io::Error),
    #[error("Failed to load plugin as component: {0}")]
    ComponentNewFailed(wasmtime::Error),
    #[error("Failed to create cache data for plugin: {0}")]
    ComponentCacheSerializeFailed(wasmtime::Error),
    #[error("Failed to write cache file for plugin: {0}")]
    ComponentCacheWriteFailed(std::io::Error),
    #[error("Failed to instantiate plugin: {0}")]
    InstantiationFailed(wasmtime::Error),
    #[error("Calling `init_plugin` failed: {0}")]
    CallInitPluginFailed(wasmtime::Error),
    #[error("Calling `get_metadata` failed: {0}")]
    CallGetMetadataFailed(wasmtime::Error),
    #[error("Failed to get absolute path: {0}")]

View on GitHub (pinned to 8d4639e25a)