weaviate/weaviate · error

vectorizing object with corpus '%+v': %w

Error message

vectorizing object with corpus '%+v': %w

What it means

Generic fallback in Object(): when VectorForCorpi fails with any error other than ErrNoUsableWords (network failure, non-200 from the contextionary inference container, invalid API key to the module, malformed response), the error is wrapped as 'vectorizing object with corpus ...: %w'. The original error is preserved for errors.As/Is inspection.

Source

Thrown at modules/text2vec-contextionary/vectorizer/vectorizer.go:134

				"options:\n\n1.) Make sure that the schema class name or the set properties are "+
				"a contextionary-valid term and include them in vectorization using the "+
				"'vectorizeClassName' or 'vectorizePropertyName' setting. In this case the vector position "+
				"will be composed of both the class/property names and the values for those fields. "+
				"Even if no property values are contextionary-valid, the overall word corpus is still valid "+
				"due to the contextionary-valid class/property names."+
				"\n\n2.) Alternatively, if you do not want to include schema class/property names "+
				"in vectorization, you must make sure that at least one text/string property contains "+
				"at least one contextionary-valid word."+
				"\n\n3.) If the word corpus weaviate extracted from your object "+
				"(see below) does contain enough meaning to build a vector position, but the contextionary "+
				"did not recognize the words, you can extend the contextionary using the "+
				"REST API. This is the case	when you use mostly industry-specific terms which are "+
				"not known to the common language contextionary. Once extended, simply reimport this object."+
				"\n\nThe following words were extracted from your object: %v"+
				"\n\nTo learn more about the contextionary and how it behaves, check out: https://www.semi.technology/documentation/weaviate/current/contextionary.html"+
				"\n\nOriginal error: %v", corpi, err)
		default:
			return nil, nil, fmt.Errorf("vectorizing object with corpus '%+v': %w", corpi, err)
		}
	}

	return vector, ie, nil
}

// Corpi takes any list of strings and builds a common vector for all of them
func (v *Vectorizer) Corpi(ctx context.Context, corpi []string,
) ([]float32, error) {
	// can be written to concurrently if multiple named vectors are used
	corpiTmp := make([]string, len(corpi))
	for i, corpus := range corpi {
		corpiTmp[i] = camelCaseToLower(corpus)
	}

	vector, _, err := v.client.VectorForCorpi(ctx, corpiTmp, nil)
	if err != nil {
		return nil, fmt.Errorf("vectorizing corpus '%+v': %w", corpiTmp, err)

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Check that the contextionary inference container is running (docker compose ps) and reachable at the configured INFERENCE_URL
  2. Inspect the wrapped cause in the error chain for the actual transport/HTTP failure
  3. Retry the import once the inference service is healthy

Example fix

// debug the wrapped cause
var target error
if errors.As(err, &target) { log.Printf("root cause: %v", target) }
Defensive patterns

Strategy: retry

Validate before calling

// health-check the inference service before import
resp, err := http.Get(inferenceURL + "/meta")
if err != nil || resp.StatusCode != 200 {
	return fmt.Errorf("contextionary inference unavailable")
}

Type guard

func isInferenceUnavailable(err error) bool {
	return err != nil && strings.Contains(err.Error(), "vectorizing object with corpus")
}

Try / catch

obj, err := client.Data().Creator().WithObject(o).Do(ctx)
if err != nil {
	if strings.Contains(err.Error(), "vectorizing object with corpus") {
		// retry with backoff; the inference service may be transiently down
	}
}

Prevention

When it happens

Trigger: Object import where the remote contextionary/inference service is unreachable, returns a non-200 status, times out, or otherwise errors — anything that isn't an ErrNoUsableWords.

Common situations: text2vec-contextionary/transformer inference container down or restarting, wrong INFERENCE_URL in docker-compose, network partition between Weaviate and the module, OOM-killed inference container.

Related errors


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