go-redis/redis · error

redis: BLOOM.INFO unexpected key %s

Error message

redis: BLOOM.INFO unexpected key %s

What it means

Error "redis: BLOOM.INFO unexpected key %s" thrown in go-redis/redis.

Source

Thrown at probabilistic.go:357

	// Create a mapping from key names to pointers of struct fields
	respMapping := map[string]*int64{
		"Capacity":                 &result.Capacity,
		"CAPACITY":                 &result.Capacity,
		"Size":                     &result.Size,
		"SIZE":                     &result.Size,
		"Number of filters":        &result.Filters,
		"FILTERS":                  &result.Filters,
		"Number of items inserted": &result.ItemsInserted,
		"ITEMS":                    &result.ItemsInserted,
		"Expansion rate":           &result.ExpansionRate,
		"EXPANSION":                &result.ExpansionRate,
	}

	// Helper function to read and assign a value based on the key
	readAndAssignValue := func(key string) error {
		fieldPtr, exists := respMapping[key]
		if !exists {
			return fmt.Errorf("redis: BLOOM.INFO unexpected key %s", key)
		}

		// Read the integer and assign to the field via pointer dereferencing
		val, err := rd.ReadInt()
		if err != nil {
			return err
		}
		*fieldPtr = val
		return nil
	}

	readType, err := rd.PeekReplyType()
	if err != nil {
		return err
	}

	if len(cmd.args) > 2 && readType == proto.RespArray {
		n, err := rd.ReadArrayLen()

View on GitHub (pinned to 36d97525cd)

Solutions

  1. Handle the unexpected key in the error by extending the BLOOM.INFO parsing switch
  2. Check the RedisBloom version for new info fields

When it happens

Trigger: Thrown at probabilistic.go:357 when the library encounters an invalid state.

Common situations: Tolerate unknown info keys by ignoring them rather than erroring, or pin module versions.


AI-assisted analysis of go-redis/redis@36d97525cd (2026-08-06). Data as JSON: /data/errors/6ee6327f18f7ec5b.json. Report an issue: GitHub.