{"record":{"id":"7747a8b5b3c1dab5","repo":"Pumpkin-MC/Pumpkin","slug":"license-metadata-mismatch-0","errorCode":null,"errorMessage":"License metadata mismatch: {0}","messagePattern":"License metadata mismatch: (.+?)","errorType":"exception","errorClass":"LicenseError","httpStatus":null,"severity":"error","filePath":"crates/pumpkin-plugin-utils/src/license.rs","lineNumber":21,"sourceCode":"use crate::{\n    http::{HttpClient, HttpError},\n    models::{CheckLicenseResponse, LicenseLease, LicenseStatus, PumpkinMetadata},\n};\nuse std::{\n    path::{Path, PathBuf},\n    time::{Duration, SystemTime, UNIX_EPOCH},\n};\nuse thiserror::Error;\nuse tracing::{debug, info};\n\n/// License checking and verification errors.\n#[derive(Debug, Error)]\npub enum LicenseError {\n    /// HTTP communication error with marketplace.\n    #[error(\"Marketplace HTTP error: {0}\")]\n    Http(#[from] HttpError),\n    /// Metadata validation error (e.g. missing license on paid plugin).\n    #[error(\"License metadata mismatch: {0}\")]\n    MetadataMismatch(String),\n    /// License revoked or refunded by marketplace.\n    #[error(\"License was revoked or refunded: {0}\")]\n    Revoked(String),\n    /// License is expired.\n    #[error(\"License has expired on {0}\")]\n    Expired(String),\n    /// I/O error reading/writing license cache.\n    #[error(\"I/O error with license storage: {0}\")]\n    Io(#[from] std::io::Error),\n    /// JSON serialization error.\n    #[error(\"JSON serialization error: {0}\")]\n    Json(#[from] serde_json::Error),\n    /// Plugin is unsigned or missing marketplace metadata.\n    #[error(\"Plugin is unsigned or missing marketplace metadata\")]\n    UnsignedPlugin,\n    /// Plugin has not been initialized.\n    #[error(","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin-plugin-utils/src/license.rs#L3-L39","documentation":"LicenseError::MetadataMismatch indicates the plugin's marketplace metadata does not satisfy license requirements — typically a paid plugin shipped without the required license metadata, or metadata that doesn't match the marketplace record. The library validates plugin metadata during license verification and reports the specific discrepancy in {0}.","triggerScenarios":"Running license verification on a plugin whose embedded metadata lacks a license ID for a paid plugin, or whose plugin id/version/author fields disagree with the marketplace listing; raised by LicenseManager validation before any HTTP lookup concludes.","commonSituations":"Developer forgets to add license/marketplace metadata to the plugin manifest when publishing a paid plugin; renamed plugin id after purchase records were created; version fields edited locally breaking the match; hand-built jar missing metadata injected at build time.","solutions":["Add the required marketplace/license metadata (license id, plugin id) to the plugin manifest/build config.","Ensure plugin id and other fields exactly match the marketplace listing.","Rebuild/repackage the plugin through the official pipeline that injects metadata.","Re-download the plugin from the marketplace rather than using a locally modified copy.","If free/paid classification changed, update the marketplace listing accordingly."],"exampleFix":"// before (plugin.toml)\nname = \"MyPlugin\"\n// after\nname = \"MyPlugin\"\nlicense-id = \"abc-123\"\nmarketplace-id = \"my-plugin\"","handlingStrategy":"validation","validationCode":"// Validate plugin metadata before attempting license verification\nfn has_valid_license_metadata(meta: &PluginMeta) -> bool {\n    meta.license_id.as_deref().map_or(false, |l| !l.is_empty())\n        && meta.plugin_id == EXPECTED_MARKETPLACE_ID\n}\nif !has_valid_license_metadata(&meta) {\n    tracing::error!(\"plugin metadata incomplete for license check\");\n}","typeGuard":"fn is_metadata_mismatch(e: &LicenseError) -> bool {\n    matches!(e, LicenseError::MetadataMismatch(_))\n}","tryCatchPattern":"match manager.verify() {\n    Err(LicenseError::MetadataMismatch(detail)) => {\n        tracing::error!(\"fix plugin metadata: {detail}\");\n        disable_paid_features();\n    }\n    other => other.map(|_| ()),\n}","preventionTips":["Always publish through the official build pipeline that injects license metadata.","Keep plugin id/version identical to the marketplace listing.","Add a CI check that the packaged plugin contains required metadata keys.","Never hand-edit the packaged plugin metadata."],"tags":["license","metadata","validation","rust"],"backgroundTag":"schema-validation-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"}