{"record":{"id":"26fe3a9fed30635e","repo":"Pumpkin-MC/Pumpkin","slug":"failed-to-load-library-0","errorCode":null,"errorMessage":"Failed to load library: {0}","messagePattern":"Failed to load library: (.+?)","errorType":"error_code","errorClass":"LoaderError","httpStatus":null,"severity":"error","filePath":"crates/pumpkin/src/plugin/loader/mod.rs","lineNumber":39,"sourceCode":"    Pin<Box<dyn Future<Output = Result<(), LoaderError>> + Send + 'a>>;\n\npub trait PluginLoader: Send + Sync {\n    /// Load a plugin from the specified path\n    fn load<'a>(&'a self, path: &'a Path) -> PluginLoadFuture<'a>;\n\n    /// Check if this loader can handle the given file\n    fn can_load(&self, path: &Path) -> bool;\n\n    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(","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/plugin/loader/mod.rs#L21-L57","documentation":"This is LoaderError::LibraryLoad(String), thrown by the Pumpkin plugin loader's unified error type. It means the plugin's dynamic library (.so/.dylib/.dll) could not be loaded into the process. The underlying OS/loader error is carried in the String payload.","triggerScenarios":"Raised when the plugin loader calls the dynamic library loading routine and it fails: missing file, invalid shared object, unresolved symbols, or incompatible ABI.","commonSituations":"Plugin path is wrong or the .so file is missing; plugin compiled for a different architecture or libc; missing transitive shared library dependencies; plugin built against a different Pumpkin API.","solutions":["Check the error string payload for the underlying OS error (e.g. missing dependency, bad ELF header)","Confirm the plugin file exists at the configured path and matches the platform/architecture","Rebuild the plugin against the current Pumpkin version","Run ldd (Linux) on the plugin to find missing shared library dependencies"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"// before enabling: check the plugin file exists\nif !plugin_path.exists() {\n    bail!(\"plugin library not found at {}\", plugin_path.display());\n}","typeGuard":"null","tryCatchPattern":"match loader.load(path) {\n    Err(LoaderError::LibraryLoad(msg)) => eprintln!(\"plugin .so failed to load: {msg}\"),\n    Ok(p) => enable(p),\n    Err(e) => return Err(e),\n}","preventionTips":["Build plugins for the exact server platform and architecture","Rebuild plugins after every Pumpkin API bump","Check dynamic library dependencies (ldd) before deploying"],"tags":["plugin","loader","dynamic-library","rust","native"],"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"}