risingwavelabs/risingwave · error

argument `--license-key-path` (or env var `RW_LICENSE_KEY_PA

Error message

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

What it means

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.

Source

Thrown at src/meta/src/manager/env.rs:460

        let idle_manager = Arc::new(IdleManager::new(opts.max_idle_ms));
        let stream_client_pool =
            Arc::new(StreamClientPool::new(1, opts.stream_client_config.clone())); // typically no need for plural clients
        let frontend_client_pool = Arc::new(FrontendClientPool::new(
            1,
            opts.frontend_client_config.clone(),
        ));
        let event_log_manager = Arc::new(start_event_log_manager(
            opts.event_log_enabled,
            opts.event_log_channel_max_size,
        ));

        // When license key path is specified, license key from system parameters can be easily
        // overwritten. So we simply reject this case.
        if opts.license_key_path.is_some()
            && init_system_params.license_key
                != system_param::default::license_key_opt().map(Into::into)
        {
            bail!(
                "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"
            );
        }

        let cluster_first_launch = meta_store_impl.up().await.context(
            "Failed to initialize the meta store, \
            this may happen if there's existing metadata incompatible with the current version of RisingWave, \
            e.g., downgrading from a newer release or a nightly build to an older one. \
            For a single-node deployment, you may want to reset all data by deleting the data directory, \
            typically located at `~/.risingwave`.",
        )?;

        let notification_manager =
            Arc::new(NotificationManager::new(meta_store_impl.clone()).await);
        let cluster_id = Cluster::find()
            .one(&meta_store_impl.conn)

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Pick one source: remove --license-key-path / RW_LICENSE_KEY_PATH, or clear the license_key system parameter (RESET license_key in RW).
  2. Inspect current system parameters (SHOW PARAMETERS / system_params table) and delete the stale license_key.
  3. Ensure RW_LICENSE_KEY env var is not exported in the container/pod environment.

Example fix

// before: both set in k8s env
env:
  - name: RW_LICENSE_KEY_PATH
    value: /etc/rw/license.key
  - name: RW_LICENSE_KEY
    value: xxx
// after: keep only one
env:
  - name: RW_LICENSE_KEY_PATH
    value: /etc/rw/license.key
Defensive patterns

Strategy: validation

Validate before calling

// Shell: fail before startup if both sources are set
if [ -n "$RW_LICENSE_KEY_PATH" ] && [ -n "$RW_LICENSE_KEY" ]; then
  echo "Set only one of RW_LICENSE_KEY_PATH / RW_LICENSE_KEY" >&2; exit 1;
fi

Try / catch

// Detect at config-load time
match start_meta(opts).await {
    Err(e) if e.to_string().contains("license-key-path") && e.to_string().contains("license_key") =>
        eprintln!("Choose either a license key file or the license_key parameter, not both"),
    other => other?,
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/c13a7a427960f980. Report an issue: GitHub.