weaviate/weaviate · error

auto-schema: create collection: %w

Error message

auto-schema: create collection: %w

What it means

Auto-schema attempted to create a new collection for an unknown class and the schemaManager.AddClass call failed. The wrapped error is the schema/raft rejection (name conflict, validation, or consensus issue).

Source

Thrown at usecases/objects/auto_schema.go:124

		vclass := classes[object.Class]

		schemaClass := vclass.Class
		schemaVersion := vclass.Version

		if schemaClass == nil && !allowCreateClass {
			return 0, ErrInvalidUserInput{"given class does not exist"}
		}
		properties, err := m.getProperties(object, principal)
		if err != nil {
			return 0, err
		}

		if schemaClass == nil {
			// it returns the newly created class and version
			schemaClass, schemaVersion, err = m.createClass(ctx, principal, namespacing.StripOwnNamespace(principal, object.Class), properties)
			if err != nil {
				return 0, fmt.Errorf("auto-schema: create collection: %w", err)
			}

			classes[object.Class] = versioned.Class{Class: schemaClass, Version: schemaVersion}
			classcache.RemoveClassFromContext(ctx, object.Class)
		} else {
			if newProperties := schema.DedupProperties(schemaClass.Properties, properties); len(newProperties) > 0 {
				var err error
				schemaClass, schemaVersion, err = m.schemaManager.AddClassProperty(ctx,
					principal, namespacing.StripOwnNamespace(principal, schemaClass.Class), true, newProperties...)
				if err != nil {
					return 0, fmt.Errorf("auto-schema: update collection: %w", err)
				}
				classes[object.Class] = versioned.Class{Class: schemaClass, Version: schemaVersion}
				classcache.RemoveClassFromContext(ctx, object.Class)
			}
		}

		maxSchemaVersion = max(maxSchemaVersion, schemaVersion)

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Inspect the wrapped error for the schema rejection reason
  2. Create the collection manually and retry the insert
  3. Check cluster/raft health if AddClass fails persistently
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at usecases/objects/auto_schema.go:124 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/74029f28fba19220. Report an issue: GitHub.