weaviate/weaviate · error

%s must be an integer between 1 and %d. Got: %v

Error message

%s must be an integer between 1 and %d. Got: %v

What it means

Configuration validation error for GCS_MODULE_GRPC_CONN_POOL: the value falls outside the allowed range [1, MaxBackupGCSGRPCConnPool]. A zero/negative or excessively large connection pool size for the GCS gRPC client is rejected.

Source

Thrown at usecases/config/environment.go:2411

	// parseIntVerify always writes the default back, so seed it from the config
	// file value to keep an unset variable from overwriting it.
	connPool := DefaultBackupGCSGRPCConnPool
	if c.BackupGCS.GRPCConnPool != 0 {
		connPool = c.BackupGCS.GRPCConnPool
	}
	if err := parseIntVerify("GCS_MODULE_GRPC_CONN_POOL", connPool,
		func(val int) { c.BackupGCS.GRPCConnPool = val },
		validateBackupGCSConnPool); err != nil {
		return err
	}

	return nil
}

func validateBackupGCSConnPool(val int, setting string) error {
	if val < 1 || val > MaxBackupGCSGRPCConnPool {
		return fmt.Errorf("%s must be an integer between 1 and %d. Got: %v", setting, MaxBackupGCSGRPCConnPool, val)
	}
	return nil
}

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Set the value to an integer between 1 and MaxBackupGCSGRPCConnPool (see message for the max)
  2. Unset the variable to fall back to DefaultBackupGCSGRPCConnPool
  3. If you need more concurrency, check the current max constant in usecases/config/environment.go and raise it deliberately

Example fix

# before
BACKUP_GCS_CONN_POOL=0
# after
BACKUP_GCS_CONN_POOL=10
Defensive patterns

Strategy: validation

Validate before calling

v := os.Getenv("BACKUP_GCS_CONN_POOL")
if v != "" {
  n, err := strconv.Atoi(v)
  if err != nil || n < 1 || n > 1000 { log.Fatalf("conn pool must be in [1, max]") }
}

Prevention

When it happens

Trigger: Setting the GCS gRPC connection pool env var to 0, a negative number, or a value above the documented maximum.

Common situations: Oversizing the pool 'for safety' after performance tuning; copy-pasting a different module's pool size; leaving 0 in a generated values file.

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 weaviate/weaviate@75aa4b6d11 (2026-09-04). Data as JSON: /api/errors/a08b1a6879c73400. Report an issue: GitHub.