{"record":{"id":"94016b9749fb67fb","repo":"Pumpkin-MC/Pumpkin","slug":"missing-plugin-metadata","errorCode":null,"errorMessage":"Missing plugin metadata","messagePattern":"Missing plugin metadata","errorType":"error_code","errorClass":"LoaderError","httpStatus":null,"severity":"error","filePath":"crates/pumpkin/src/plugin/loader/mod.rs","lineNumber":42,"sourceCode":"    /// 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(\n        \"Plugin was built for an incompatible API version. Please rebuild it against this Pumpkin build.\"\n    )]\n    ApiVersionMissing,","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/plugin/loader/mod.rs#L24-L60","documentation":"This is LoaderError::MetadataMissing, part of the plugin loader's unified error enum. It means the loaded plugin did not provide required plugin metadata (name, id, version, etc.), so the loader cannot register it. Metadata is mandatory to identify and manage the plugin.","triggerScenarios":"Raised after the library loads but before the entrypoint runs, when the descriptor/metadata the loader extracts from the plugin is absent or empty.","commonSituations":"Plugin author forgot to export/fill the metadata structure; hand-built plugin crates missing the metadata macro/export; plugin built against an older loader expecting a different metadata location.","solutions":["Add the required plugin metadata (id/name/version) to the plugin using the current Pumpkin plugin macro or export","Rebuild the plugin with the latest pumpkin-plugin API","Compare against a working example plugin to see the required metadata shape","Check the plugin was built from a source tree that includes the metadata module, not a partial build"],"exampleFix":"null","handlingStrategy":"validation","validationCode":"// in the plugin crate, ensure metadata is defined\n#[derive(PluginMetadata)]\n#[plugin(id = \"myplugin\", version = \"0.1.0\")]\nstruct MyPlugin;","typeGuard":"null","tryCatchPattern":"match loader.load(path) {\n    Err(LoaderError::MetadataMissing) => eprintln!(\"plugin has no metadata; rebuild with the plugin macro\"),\n    Ok(p) => enable(p),\n    Err(e) => return Err(e),\n}","preventionTips":["Always generate plugins from the official template","Never strip the metadata export from built libraries","Rebuild plugins when the metadata format changes"],"tags":["plugin","loader","metadata","rust"],"backgroundTag":"missing-required-config-field","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"}