{"record":{"id":"38eecd2f64d2f5bd","repo":"Pumpkin-MC/Pumpkin","slug":"plugin-initialization-failed-0","errorCode":null,"errorMessage":"Plugin initialization failed: {0}","messagePattern":"Plugin initialization failed: (.+?)","errorType":"error_code","errorClass":"LoaderError","httpStatus":null,"severity":"error","filePath":"crates/pumpkin/src/plugin/loader/mod.rs","lineNumber":48,"sourceCode":"    fn unload(&self, data: Box<dyn Any + Send + Sync>) -> PluginUnloadFuture<'_>;\n\n    /// Checks if the plugin can be safely unloaded.\n    fn can_unload(&self) -> bool;\n}\n\n/// Unified loader error type\n#[derive(Error, Debug)]\npub enum LoaderError {\n    #[error(\"Failed to load library: {0}\")]\n    LibraryLoad(String),\n\n    #[error(\"Missing plugin metadata\")]\n    MetadataMissing,\n\n    #[error(\"Missing plugin entrypoint\")]\n    EntrypointMissing,\n\n    #[error(\"Plugin initialization failed: {0}\")]\n    InitializationFailed(String),\n\n    #[error(\"Runtime error: {0}\")]\n    RuntimeError(String),\n\n    #[error(\"Invalid loader data\")]\n    InvalidLoaderData,\n\n    #[error(\n        \"Plugin was built for an incompatible API version. Please rebuild it against this Pumpkin build.\"\n    )]\n    ApiVersionMissing,\n\n    #[error(\n        \"Plugin API version mismatch (plugin {plugin_version}, server {server_version}). Please rebuild it against this Pumpkin build.\"\n    )]\n    ApiVersionMismatch {\n        plugin_version: u32,","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/plugin/loader/mod.rs#L30-L66","documentation":"This is LoaderError::InitializationFailed(String). It means the plugin's entrypoint ran but plugin initialization returned an error or panicked; the message carries the underlying cause. The loader surfaces it as a unified error so the server can report which plugin failed to start.","triggerScenarios":"Raised when invoking the plugin entrypoint/constructor and it returns Err or otherwise fails during setup (e.g. registering commands, reading its own config, hooking APIs that are unavailable).","commonSituations":"Plugin's own config file missing/invalid; plugin assuming APIs or registries that don't exist in this server build; plugin dependency (e.g. another plugin or data directory) not present; version incompatibility between plugin expectations and server.","solutions":["Read the inner message payload for the plugin's own error cause","Fix the plugin's configuration/data files it complains about","Update or downgrade the plugin to a version compatible with this Pumpkin build","Report/inspect the plugin's init code — the failure is in the plugin, not the loader"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"match loader.load(path) {\n    Err(LoaderError::InitializationFailed(msg)) => eprintln!(\"plugin init failed: {msg}; disabling plugin\"),\n    Ok(p) => enable(p),\n    Err(e) => return Err(e),\n}","preventionTips":["Have plugins validate their own config files early and fail with clear messages","Test plugin init against the exact server build in CI","Avoid assuming optional APIs/registries exist without checks"],"tags":["plugin","loader","initialization","rust"],"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"}