{"record":{"id":"c13a7a427960f980","repo":"risingwavelabs/risingwave","slug":"argument-license-key-path-or-env-var-rw-lice","errorCode":null,"errorMessage":"argument `--license-key-path` (or env var `RW_LICENSE_KEY_PATH`) and system parameter `license_key` (or env var `RW_LICENSE_KEY`) may not be set at the same time","messagePattern":"argument `--license-key-path` \\(or env var `RW_LICENSE_KEY_PATH`\\) and system parameter `license_key` \\(or env var `RW_LICENSE_KEY`\\) may not be set at the same time","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/meta/src/manager/env.rs","lineNumber":460,"sourceCode":"        let idle_manager = Arc::new(IdleManager::new(opts.max_idle_ms));\n        let stream_client_pool =\n            Arc::new(StreamClientPool::new(1, opts.stream_client_config.clone())); // typically no need for plural clients\n        let frontend_client_pool = Arc::new(FrontendClientPool::new(\n            1,\n            opts.frontend_client_config.clone(),\n        ));\n        let event_log_manager = Arc::new(start_event_log_manager(\n            opts.event_log_enabled,\n            opts.event_log_channel_max_size,\n        ));\n\n        // When license key path is specified, license key from system parameters can be easily\n        // overwritten. So we simply reject this case.\n        if opts.license_key_path.is_some()\n            && init_system_params.license_key\n                != system_param::default::license_key_opt().map(Into::into)\n        {\n            bail!(\n                \"argument `--license-key-path` (or env var `RW_LICENSE_KEY_PATH`) and \\\n                 system parameter `license_key` (or env var `RW_LICENSE_KEY`) may not \\\n                 be set at the same time\"\n            );\n        }\n\n        let cluster_first_launch = meta_store_impl.up().await.context(\n            \"Failed to initialize the meta store, \\\n            this may happen if there's existing metadata incompatible with the current version of RisingWave, \\\n            e.g., downgrading from a newer release or a nightly build to an older one. \\\n            For a single-node deployment, you may want to reset all data by deleting the data directory, \\\n            typically located at `~/.risingwave`.\",\n        )?;\n\n        let notification_manager =\n            Arc::new(NotificationManager::new(meta_store_impl.clone()).await);\n        let cluster_id = Cluster::find()\n            .one(&meta_store_impl.conn)","sourceCodeStart":442,"sourceCodeEnd":478,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/manager/env.rs#L442-L478","documentation":"License configuration is mutually exclusive: a license key file (--license-key-path / RW_LICENSE_KEY_PATH) and a license key set as a system parameter (license_key / RW_LICENSE_KEY) may not both be provided, because the path would silently overwrite the parameter value. Meta node startup fails fast with this message instead.","triggerScenarios":"Starting the meta node with --license-key-path set while the persisted system parameter table (or RW_LICENSE_KEY env var) already holds a non-default license_key value.","commonSituations":"Migrating from env-var licensing to file-based licensing without removing the old system parameter; IaC/k8s manifests setting RW_LICENSE_KEY_PATH while a previously persisted license_key remains in the meta store; re-running a cluster that was initialized with an old license parameter.","solutions":["Pick one source: remove --license-key-path / RW_LICENSE_KEY_PATH, or clear the license_key system parameter (RESET license_key in RW).","Inspect current system parameters (SHOW PARAMETERS / system_params table) and delete the stale license_key.","Ensure RW_LICENSE_KEY env var is not exported in the container/pod environment."],"exampleFix":"// before: both set in k8s env\nenv:\n  - name: RW_LICENSE_KEY_PATH\n    value: /etc/rw/license.key\n  - name: RW_LICENSE_KEY\n    value: xxx\n// after: keep only one\nenv:\n  - name: RW_LICENSE_KEY_PATH\n    value: /etc/rw/license.key","handlingStrategy":"validation","validationCode":"// Shell: fail before startup if both sources are set\nif [ -n \"$RW_LICENSE_KEY_PATH\" ] && [ -n \"$RW_LICENSE_KEY\" ]; then\n  echo \"Set only one of RW_LICENSE_KEY_PATH / RW_LICENSE_KEY\" >&2; exit 1;\nfi","typeGuard":null,"tryCatchPattern":"// Detect at config-load time\nmatch start_meta(opts).await {\n    Err(e) if e.to_string().contains(\"license-key-path\") && e.to_string().contains(\"license_key\") =>\n        eprintln!(\"Choose either a license key file or the license_key parameter, not both\"),\n    other => other?,\n}","preventionTips":["Adopt one licensing source org-wide (prefer system parameter license_key).","When switching to --license-key-path, run RESET license_key on the cluster first.","Audit k8s manifests/CI for both RW_LICENSE_KEY_PATH and RW_LICENSE_KEY."],"tags":["rust","meta-service","license","configuration","startup"],"backgroundTag":"conflicting-config-options","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"}