weaviate/weaviate · error

%w: expected %q to contain strings, found %T: %+v

Error message

%w: expected %q to contain strings, found %T: %+v

What it means

Config validation for ref2vec-centroid's referenceProperties array: an individual element of the array is not a string (e.g. a number, object, or boolean was placed in the list). All reference property names must be strings so they can be matched against the class schema; the offending element's Go type and value are included in the error.

Source

Thrown at modules/ref2vec-centroid/config/validation.go:44

		return fmt.Errorf("%w: must have at least one value in the %q field",
			errInvalidConfig, referencePropertiesField)
	}

	propSlice, ok := refProps.([]interface{})
	if !ok {
		return fmt.Errorf("%w: expected array for field %q, got %T",
			errInvalidConfig, referencePropertiesField, refProps)
	}

	if len(propSlice) == 0 {
		return fmt.Errorf("%w: must have at least one value in the %q field",
			errInvalidConfig, referencePropertiesField)
	}

	// all provided property names must be strings
	for _, prop := range propSlice {
		if _, ok := prop.(string); !ok {
			return fmt.Errorf("%w: expected %q to contain strings, found %T: %+v",
				errInvalidConfig, referencePropertiesField, prop, refProps)
		}
	}

	_, err := cfg.CalculationMethod()
	if err != nil {
		return err
	}

	return nil
}

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Edit referenceProperties so every entry is a quoted string, e.g. ["hasArticle", "mentions"]
  2. Remove stray non-string entries such as nested objects or numbers
  3. Re-validate the class configuration after the fix
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/ref2vec-centroid/config/validation.go:44 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04). Data as JSON: /api/errors/b38e7e47f6641cbd. Report an issue: GitHub.