High severity beginner · Fix: 2-5 min

WeaviateStartUpError

weaviate.exceptions.WeaviateStartUpError

What this error means
The Weaviate client query failed because the specified class does not exist in the Weaviate schema.

Stack trace

traceback
weaviate.exceptions.WeaviateStartUpError: Class 'MyVectorClass' not found in Weaviate schema
  File "/app/query_weaviate.py", line 42, in query_vector
    response = client.query.get('MyVectorClass', ['text']).with_near_vector(near_vector).do()
  File "/usr/local/lib/python3.9/site-packages/weaviate/client.py", line 123, in get
    raise WeaviateStartUpError(f"Class '{class_name}' not found in schema")
QUICK FIX
Check and correct the class name in your query to exactly match a class defined in the Weaviate schema.

Why it happens

This error occurs when the Weaviate client attempts to query a class that is not registered in the Weaviate instance's schema. The class name must exactly match a class defined in the schema, including case sensitivity. If the class was never created or was deleted, the query will fail with this error.

Detection

Check the Weaviate schema before querying by calling client.schema.get() and verify the class exists. Log the schema classes at startup to catch missing or misspelled class names early.

Causes & fixes

1

The class name used in the query does not exist in the Weaviate schema.

✓ Fix

Verify the class name by fetching the schema with client.schema.get() and use the exact class name in your query.

2

The class was never created or was deleted from the Weaviate instance.

✓ Fix

Create the class in the Weaviate schema before querying using client.schema.create_class() or via the Weaviate dashboard.

3

Typo or case mismatch in the class name string used in the query.

✓ Fix

Ensure the class name string matches exactly the schema class name, including capitalization.

4

Querying before the Weaviate instance is fully initialized or schema is loaded.

✓ Fix

Add a schema existence check or delay queries until the schema is confirmed loaded.

Code: broken vs fixed

Broken - triggers the error
python
import os
import weaviate

client = weaviate.Client(url=os.environ['WEAVIATE_URL'],
                        auth_client_secret=weaviate.AuthApiKey(api_key=os.environ['WEAVIATE_API_KEY']))

near_vector = {"vector": [0.1, 0.2, 0.3], "certainty": 0.7}

# This line triggers the error because 'MyVectorClass' does not exist
response = client.query.get('MyVectorClass', ['text']).with_near_vector(near_vector).do()
print(response)
Fixed - works correctly
python
import os
import weaviate

client = weaviate.Client(url=os.environ['WEAVIATE_URL'],
                        auth_client_secret=weaviate.AuthApiKey(api_key=os.environ['WEAVIATE_API_KEY']))

# Verify schema classes before querying
schema = client.schema.get()
class_names = [cls['class'] for cls in schema.get('classes', [])]
assert 'MyVectorClass' in class_names, "Class 'MyVectorClass' not found in schema"

near_vector = {"vector": [0.1, 0.2, 0.3], "certainty": 0.7}

response = client.query.get('MyVectorClass', ['text']).with_near_vector(near_vector).do()  # Fixed: class verified
print(response)
Added a schema check to confirm 'MyVectorClass' exists before querying, preventing the class not found error.

Workaround

Wrap the query call in try/except WeaviateStartUpError, and if caught, fetch the schema and log available classes to diagnose missing class issues dynamically.

Prevention

Implement schema validation at app startup and before queries, and automate schema creation or migration scripts to ensure all required classes exist in Weaviate.

Python 3.9+ · weaviate-client >=3.0.0 · tested on 3.5.x
Verified 2026-04
Verify ↗

Community Notes

No notes yetBe the first to share a version-specific fix or tip.