Skip to content

InfluxDB scaler: authToken should be optional for unauthenticated instances #7616

Description

@lumaks-redox

Report

The InfluxDB scaler (both v2 and v3) enforces authToken as required in the Validate() method:

if i.AuthToken == "" {
    return fmt.Errorf("authToken is required")
}

However, the documentation marks authToken as Optional.

InfluxDB 3 Core (OSS) does not require authentication by default. When running an unauthenticated InfluxDB instance, the scaler fails during metadata parsing with:

error parsing influxdb metadata: authToken is required

The only workaround is to pass a dummy token value (e.g., authToken: "unused"), which InfluxDB will ignore but feels incorrect and contradicts the documentation.

Expected Behavior

If authToken is empty/unset, the scaler should initialize without error and make unauthenticated requests to InfluxDB — matching the documented behavior where authToken is listed as optional.

Actual Behavior

The scaler refuses to start and returns authToken is required, even when the target InfluxDB instance has no authentication configured.

Steps to Reproduce

  1. Deploy InfluxDB 3 Core without authentication
  2. Create a ScaledObject with an influxdb trigger without authToken:
    triggers:
      - type: influxdb
        metadata:
          serverURL: "http://influxdb:8181"
          influxVersion: "3"
          query: "SELECT count(*) FROM my_measurement WHERE time > now() - 5m"
          thresholdValue: "10"
          metricKey: "count"
          database: "mydb"
  3. Observe the ScaledObject condition: ScaledObjectCheckFailed with message authToken is required

KEDA Version

2.19

Kubernetes Version

1.31

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Ready To Ship

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions