influxdata/influxdb · error · Error

environment variable

Error message

environment variable {0} (named by --node-id-from-env / INFLUXDB3_NODE_ID_FROM_ENV) must be set to a valid node id

What it means

Returned when the node id cannot be determined from the environment variable named by `--node-id-from-env` (default/INFLUXDB3_NODE_ID_FROM_ENV). The variable is either unset or its value does not parse as a valid node id. The offending variable name is included in the message ({0}).

Solutions

  1. Set the named environment variable to a valid numeric node id, e.g. export INFLUXDB3_NODE_ID_FROM_ENV=1.
  2. Verify the exact variable name passed to --node-id-from-env matches what is exported in the environment.
  3. Alternatively drop --node-id-from-env and pass an explicit --node-id.

Example fix

# before
influxdb3 serve --node-id-from-env HOST_ID   # HOST_ID unset
# after
export HOST_ID=1
influxdb3 serve --node-id-from-env HOST_ID
Defensive patterns

Strategy: validation

Validate before calling

let var = std::env::var("INFLUXDB3_NODE_ID_FROM_ENV")
    .map_err(|_| "INFLUXDB3_NODE_ID_FROM_ENV must be set")?;
let id: u64 = var.parse().map_err(|_| "node id must be a valid number")?;

Type guard

fn valid_node_id(v: Option<&str>) -> bool {
    v.map(|s| s.parse::<u64>().is_ok()).unwrap_or(false)
}

Prevention

When it happens

Trigger: Starting `influxdb3 serve` with `--node-id-from-env VAR` where VAR is not set, or set to a non-integer/unparsable string.

Common situations: Container/orchestrator configs that forgot to inject the env var, typos in the variable name, or a value like "node-1" instead of a numeric id.

Understand the failure class

Background: "is not a valid" / "Invalid ... value" environment variable errors: how libraries validate env vars and what to do when they reject yours — this error's family across 48 libraries.

Related errors


AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19). Data as JSON: /api/errors/65dbf38dd98923e6. Report an issue: GitHub.

Appendix: source

Thrown at influxdb3/src/commands/serve.rs:170

    #[error("lost backend")]
    LostBackend,

    #[error("lost HTTP/gRPC service")]
    LostHttpGrpc,

    #[error("lost admin token recovery service")]
    LostAdminTokenRecovery,

    #[error("tls requires both a cert and a key file to be passed in to work")]
    NoCertOrKeyFile,

    #[error("table cache index initialization failed: {0}")]
    TableIndexCacheInitialization(
        #[source] influxdb3_write::table_index_cache::TableIndexCacheError,
    ),

    #[error(
        "environment variable {0} (named by --node-id-from-env / INFLUXDB3_NODE_ID_FROM_ENV) \
        must be set to a valid node id"
    )]
    NodeIdEnvVarMissing(String),

    #[error(
        "Python environment initialization failed: {0}\nPlease ensure Python and pip package manager is installed"
    )]
    PythonEnvironmentInitialization(
        #[source] influxdb3_processing_engine::environment::PluginEnvironmentError,
    ),
}

pub type Result<T, E = Error> = std::result::Result<T, E>;

// variable name and migration message tuples
const DEPRECATED_ENV_VARS: &[(&str, &str)] = &[(
    "INFLUXDB3_PARQUET_MEM_CACHE_SIZE_MB",

View on GitHub (pinned to 06200ef96b)