{"record":{"id":"7cf88f45d861c833","repo":"risingwavelabs/risingwave","slug":"a-valid-license-key-is-set-but-it-is-currently-no","errorCode":null,"errorMessage":"a valid license key is set, but it is currently not effective because the CPU core 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 CPU core 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":205,"sourceCode":"    /// Used when `license_key` is unset or invalid.\n    fn default() -> Self {\n        Self {\n            sub: \"default\".to_owned(),\n            tier: Tier::Free,\n            iss: Issuer::Prod,\n            rwu_limit: None,\n            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>,","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/license/src/manager.rs#L187-L223","documentation":"LicenseError::CpuLimitExceeded means the license key itself is valid, but its CPU-core quota is not currently effective: the cluster's cached total CPU cores (actual) exceed the max cores allowed by the license (limit). It is raised by license.check_cluster_resource() when LicenseManager::license() validates the cached ClusterResource, and Feature::check_available surfaces it.","triggerScenarios":"LicenseManager::license() (typically via Feature::check_available for a gated feature) while update_cluster_resource() has reported a total_cpu_cores greater than the license's core limit — e.g. after scaling up the cluster or adding nodes with more cores.","commonSituations":"Auto-scaling or adding compute nodes pushes total cores past the licensed limit; moving from a 4-core trial license to a bigger cluster without upgrading the license; increasing per-node core allocation (e.g. K8s CPU limits) without changing the license.","solutions":["Reduce the number of nodes or per-node CPU cores so total cluster cores are at or below the license limit.","Purchase or renew a license key with a higher CPU-core limit and set it via the `license_key` system parameter.","Scale the cluster back down (remove nodes / shrink CPU requests in Kubernetes) to restore compliance."],"exampleFix":"// before: scale compute to 8 cores total with a 4-core license\nkubectl scale deploy/risingwave-compute --replicas=4  # 4 pods x 2 cores = 8 > limit 4\n// after: stay within the 4-core license or upgrade it\nkubectl scale deploy/risingwave-compute --replicas=2  # 2 pods x 2 cores = 4 <= limit 4","handlingStrategy":"validation","validationCode":"// Before scaling, check the licensed core limit against planned cluster size\nlet license = LicenseManager::get().license()?;\nlet limit = license.rw_credits.limit.cpu_core();\nif planned_total_cores > limit {\n    eprintln!(\"refusing scale-up: {} cores would exceed license limit {}\", planned_total_cores, limit);\n}","typeGuard":"fn cpu_limit_error(e: &LicenseError) -> Option<(u64, u64)> {\n    match e { LicenseError::CpuLimitExceeded { limit, actual } => Some((*limit, *actual)), _ => None }\n}","tryCatchPattern":"match LicenseManager::get().license() {\n    Ok(license) => enable_feature(license),\n    Err(LicenseError::CpuLimitExceeded { limit, actual }) => {\n        tracing::warn!(limit, actual, \"CPU limit exceeded; feature gated\");\n        degrade_gracefully();\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Know your license's core limit and set autoscaling max-replicas/CPU quotas below it.","Re-check license availability (Feature::check_available) after every topology change.","Renew/upgrade the license before planned scale-out operations.","Monitor cluster-wide CPU cores and alert when approaching the licensed limit."],"tags":["license","resource-limit","cpu","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"}