{"record":{"id":"de445a43520d6262","repo":"Pumpkin-MC/Pumpkin","slug":"failed-to-setup-linker-0","errorCode":null,"errorMessage":"Failed to setup linker: {0}","messagePattern":"Failed to setup linker: (.+?)","errorType":"error_code","errorClass":"PluginInitError","httpStatus":null,"severity":"critical","filePath":"crates/pumpkin/src/plugin/loader/wasm/wasm_host/mod.rs","lineNumber":25,"sourceCode":"\nuse crate::plugin::{\n    Context, PluginMetadata, cache::calculate_hash_for_bytes,\n    loader::wasm::wasm_host::state::PluginHostState, permissions,\n};\nuse pumpkin_plugin_runtime::RuntimeSpawner;\n\npub mod args;\npub mod concurrent_store;\npub mod logging;\npub mod signature;\npub mod state;\npub mod wit;\n\n#[derive(Error, Debug)]\npub enum PluginInitError {\n    #[error(\"Engine creation failed: {0}\")]\n    EngineCreationFailed(wasmtime::Error),\n    #[error(\"Failed to setup linker: {0}\")]\n    LinkerSetupFailed(wasmtime::Error),\n    #[error(\"Plugin is built against a different API version: {0}\")]\n    ApiVersionMismatch(wasmtime::Error),\n    #[error(\"Failed to read plugin file: {0}\")]\n    FileReadFailed(std::io::Error),\n    #[error(\"Failed to load plugin as component: {0}\")]\n    ComponentNewFailed(wasmtime::Error),\n    #[error(\"Failed to create cache data for plugin: {0}\")]\n    ComponentCacheSerializeFailed(wasmtime::Error),\n    #[error(\"Failed to write cache file for plugin: {0}\")]\n    ComponentCacheWriteFailed(std::io::Error),\n    #[error(\"Failed to instantiate plugin: {0}\")]\n    InstantiationFailed(wasmtime::Error),\n    #[error(\"Calling `init_plugin` failed: {0}\")]\n    CallInitPluginFailed(wasmtime::Error),\n    #[error(\"Calling `get_metadata` failed: {0}\")]\n    CallGetMetadataFailed(wasmtime::Error),\n    #[error(\"Failed to get absolute path: {0}\")]","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/plugin/loader/wasm/wasm_host/mod.rs#L7-L43","documentation":"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.","triggerScenarios":"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.","commonSituations":"Registering the same WIT world/instance twice, mismatched generated bindings between the server and its WIT package, wasmtime version drift after an update.","solutions":["Read the wrapped wasmtime::Error to see which WIT instance conflicted","Ensure each WIT interface is defined in the linker only once","Regenerate bindings with the same wit package and wasmtime version the server uses","Update or rebuild Pumpkin so linker setup code matches its wasmtime dependency"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match init::setup_linker(&engine) {\n    Err(PluginInitError::LinkerSetupFailed(e)) => {\n        eprintln!(\"linker setup failed: {e} — check for duplicate WIT instance definitions\");\n    }\n    other => other,\n}","preventionTips":["Define each WIT host interface in the linker exactly once","Regenerate bindings with the same wit package and wasmtime version as the server","Rebuild the server fully after upgrading wasmtime"],"tags":["wasmtime","linker","wit","wasm"],"backgroundTag":"module-init-failed","analyzedSha":"8d4639e25a57c15e47448ec327c780d41bbf2356","analyzedAt":"2026-09-09T15:32:22.916Z","contentChangedAt":"2026-09-09T15:32:22.916Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}