{"record":{"id":"3a2188a7ec7e7e59","repo":"risingwavelabs/risingwave","slug":"a-valid-license-key-is-set-but-it-is-currently-no-3a2188","errorCode":null,"errorMessage":"a valid license key is set, but it is currently not effective because the memory in the cluster ({actual}) exceeds the maximum allowed by the license key ({limit}); consider removing some nodes or acquiring a new license key with a higher limit","messagePattern":"a valid license key is set, but it is currently not effective because the memory in the cluster \\((.+?)\\) exceeds the maximum allowed by the license key \\((.+?)\\); consider removing some nodes or acquiring a new license key with a higher limit","errorType":"error_code","errorClass":"LicenseError","httpStatus":null,"severity":"error","filePath":"src/license/src/manager.rs","lineNumber":212,"sourceCode":"            exp: u64::MAX,\n        }\n    }\n}\n\n/// The error type for invalid license key when verifying as JWT.\n#[derive(Debug, Clone, Error)]\npub enum LicenseError {\n    #[error(\"invalid license key\")]\n    InvalidKey(#[source] jsonwebtoken::errors::Error),\n\n    #[error(\n        \"a valid license key is set, but it is currently not effective because the CPU core in the cluster \\\n        ({actual}) exceeds the maximum allowed by the license key ({limit}); \\\n        consider removing some nodes or acquiring a new license key with a higher limit\"\n    )]\n    CpuLimitExceeded { limit: u64, actual: u64 },\n\n    #[error(\n        \"a valid license key is set, but it is currently not effective because the memory in the cluster \\\n        ({actual}) exceeds the maximum allowed by the license key ({limit}); \\\n        consider removing some nodes or acquiring a new license key with a higher limit\",\n        actual = humansize::format_size(*actual, humansize::BINARY),\n        limit = humansize::format_size(*limit, humansize::BINARY),\n    )]\n    MemoryLimitExceeded { limit: u64, actual: u64 },\n}\n\nstruct Inner {\n    license: Result<License, LicenseError>,\n    cached_cluster_resource: ClusterResource,\n}\n\n/// The singleton license manager.\npub struct LicenseManager {\n    inner: RwLock<Inner>,\n}","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/license/src/manager.rs#L194-L230","documentation":"The MemoryLimitExceeded variant of LicenseError (formatted with humansize binary units): the license key is valid, but the cluster's cached total memory exceeds the limit allowed by the license, so license-gated features are unavailable. Like CpuLimitExceeded it is raised from license.check_cluster_resource() when the license is checked against the cached ClusterResource.","triggerScenarios":"LicenseManager::license() / Feature::check_available while update_cluster_resource() reports total_memory_bytes greater than the license's memory limit — e.g. after adding nodes or raising per-node memory (K8s memory limits, host RAM upgrades).","commonSituations":"Scaling up cluster memory beyond the licensed quota; Kubernetes memory-limit increases; adding a memory-heavy node; trial/4-core licenses used on large clusters.","solutions":["Reduce total cluster memory (remove nodes or lower per-node memory limits) to fit the license limit.","Obtain a license key with a higher memory limit and set it via the `license_key` system parameter.","Check the error message's humanized values (actual vs limit) to see exactly how much memory must be removed."],"exampleFix":"// before: raise pod memory beyond license limit\nresources: { limits: { memory: '32Gi' } }  # 4 pods x 32Gi = 128Gi > licensed 64Gi\n// after: keep total memory within the license\nresources: { limits: { memory: '16Gi' } }  # 4 pods x 16Gi = 64Gi <= licensed 64Gi","handlingStrategy":"validation","validationCode":"// Before adding nodes/memory, validate against the license's memory limit\nlet license = LicenseManager::get().license()?;\nlet mem_limit = license.rw_credits.limit.memory();\nif planned_total_memory_bytes > mem_limit {\n    eprintln!(\"planned memory {} exceeds licensed {}\", planned_total_memory_bytes, mem_limit);\n}","typeGuard":"fn memory_limit_error(e: &LicenseError) -> Option<(u64, u64)> {\n    match e { LicenseError::MemoryLimitExceeded { limit, actual } => Some((*limit, *actual)), _ => None }\n}","tryCatchPattern":"match LicenseManager::get().license() {\n    Ok(license) => enable_feature(license),\n    Err(LicenseError::MemoryLimitExceeded { limit, actual }) => {\n        tracing::warn!(limit, actual, \"memory limit exceeded; feature gated\");\n        degrade_gracefully();\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Set Kubernetes memory requests/limits so total cluster memory stays under the licensed amount.","Alert on total cluster memory nearing the license limit.","Upgrade the license before memory-expanding changes such as node upgrades or bigger instances.","Re-validate license status after infrastructure changes."],"tags":["license","resource-limit","memory","scaling"],"backgroundTag":"value-out-of-range","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}