{"record":{"id":"304a915cb7925833","repo":"Pumpkin-MC/Pumpkin","slug":"loader-error-0","errorCode":null,"errorMessage":"Loader error: {0}","messagePattern":"Loader error: (.+?)","errorType":"error_code","errorClass":"ManagerError","httpStatus":null,"severity":"error","filePath":"crates/pumpkin/src/plugin/mod.rs","lineNumber":221,"sourceCode":"///\n/// OS specific issues\n/// - Windows: Plugin cannot be unloaded, it can be only active or not\nstruct LoadedPlugin {\n    metadata: PluginMetadata,\n    instance: Option<Arc<dyn Plugin>>,\n    loader: Arc<dyn PluginLoader>,\n    loader_data: Option<Box<dyn Any + Send + Sync>>,\n    is_active: bool,\n    context: Arc<Context>,\n    path: PathBuf,\n}\n\n/// Error types for plugin management\n#[derive(Error, Debug)]\npub enum ManagerError {\n    #[error(\"Plugin not found: {0}\")]\n    PluginNotFound(String),\n    #[error(\"Loader error: {0}\")]\n    LoaderError(#[from] LoaderError),\n    #[error(\"IO error: {0}\")]\n    IoError(#[from] std::io::Error),\n    #[error(\"Dependency error: {0}\")]\n    DependencyError(String),\n}\n\nimpl Default for PluginManager {\n    fn default() -> Self {\n        Self::new(true)\n    }\n}\n\nimpl PluginManager {\n    /// Create a new plugin manager with default loaders\n    #[must_use]\n    pub fn new(verify_plugin_signatures: bool) -> Self {\n        Self {","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/plugin/mod.rs#L203-L239","documentation":"ManagerError::LoaderError(#[from] LoaderError) wraps a lower-level plugin LoaderError inside the plugin manager's error enum, displayed as \"Loader error: {0}\". It surfaces when a load/unload operation fails inside the plugin loader itself (e.g. jar reading, WASM instantiation, manifest parsing) rather than in manager bookkeeping. Use its source to see the underlying loader failure.","triggerScenarios":"Loading a plugin whose file is corrupt, whose WASM module fails to instantiate, or whose plugin metadata/manifest is invalid; the manager propagates the loader's error via the #[from] conversion.","commonSituations":"Dropping an incompatible or corrupted plugin file into the plugins folder; plugin compiled against a different plugin API/WIT version than the server supports; malformed plugin metadata in the jar.","solutions":["Read the wrapped LoaderError message for the concrete cause (IO, instantiation, or metadata failure)","Rebuild/re-download the plugin for the running server's plugin API version","Validate the plugin file (correct jar/wasm, intact manifest) before loading","Test the plugin standalone or update the server if the plugin requires a newer loader"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify plugin file before load attempt\nlet path = Path::new(&plugin_path);\nif !path.is_file() || MetadataExt::size(&path.metadata()?) == 0 {\n    return Err(\"plugin file missing or empty\".into());\n}","typeGuard":null,"tryCatchPattern":"match manager.load_plugin(path) {\n    Err(ManagerError::LoaderError(e)) => {\n        error!(\"loader failure for {path}: {e}\");\n        // inspect e (and its source chain) for the concrete cause\n    }\n    other => other?,\n}","preventionTips":["Download plugins from trusted sources and verify integrity","Match plugin builds to the server's plugin API version","Validate plugin metadata/manifest before shipping","Test plugin loading in a staging server"],"tags":["plugin-manager","loader","thiserror","error-wrapping"],"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-15T23:17:13.987Z"}