weaviate/weaviate · error

references involving a multi-tenancy enabled class requires

Error message

references involving a multi-tenancy enabled class requires class name in the source beacon url

What it means

Thrown by getReferenceClasses when the source beacon URL does not contain a class name even though multi-tenancy is involved. For multi-tenancy enabled classes Weaviate must resolve the source class explicitly to run tenant validation, so a class-less beacon form is rejected.

Source

Thrown at usecases/objects/batch_references_add.go:351

	// no cross-tenant references can be made
	if sourceEnabled && targetEnabled {
		if err := validateTenantRefObject(ctx, repo, sourceClass, source.TargetID, tenant); err != nil {
			return 0, fmt.Errorf("source: %w", err)
		}
		if err := validateTenantRefObject(ctx, repo, targetClass, target.TargetID, tenant); err != nil {
			return 0, fmt.Errorf("target: %w", err)
		}
	}

	return schemaVersion, nil
}

func getReferenceClasses(ctx context.Context,
	principal *models.Principal, schemaManager schemaManager,
	classFrom, fromProperty, toClassName string, fetchedClasses map[string]versioned.Class,
) (sourceClass *models.Class, targetClass *models.Class, schemaVersion uint64, err error) {
	if classFrom == "" {
		err = fmt.Errorf("references involving a multi-tenancy enabled class " +
			"requires class name in the source beacon url")
		return sourceClass, targetClass, schemaVersion, err
	}

	fromClass := fetchedClasses[classFrom]
	if fromClass.Class == nil {
		err = fmt.Errorf("source class %q not found in schema", classFrom)
		return sourceClass, targetClass, schemaVersion, err
	}

	sourceClass = fromClass.Class
	schemaVersion = fromClass.Version

	// we can auto-detect the to class from the schema if it is a single target reference
	if toClassName == "" {
		refProp, err2 := schema.GetPropertyByName(sourceClass, fromProperty)
		if err2 != nil {
			err = fmt.Errorf("get source refprop %q: %w", classFrom, err2)

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Include the class name in the source beacon: "weaviate://localhost/<ClassName>/<uuid>".
  2. Check the from field construction in your client code for string formatting bugs.
  3. If targeting an older Weaviate, upgrade both client and server to MT-consistent versions.

Example fix

// before
"from": "weaviate://localhost/1a2b3c4d-..."
// after
"from": "weaviate://localhost/Article/1a2b3c4d-..."
Defensive patterns

Strategy: validation

Validate before calling

const beacon = `weaviate://localhost/${className}/${uuid}`
if (!/^weaviate:\/\/localhost\/[^/]+\/[0-9a-f-]{36}$/i.test(beacon)) throw new Error('beacon must include class name and uuid')

Type guard

function hasClassNameInBeacon(beacon) { const parts = beacon.split('/'); return parts.length >= 5 && parts[4].length > 0 }

Try / catch

try { await addReference(ref) } catch (e) {
  if (String(e).includes('requires class name in the source beacon url')) { /* rebuild beacon with class */ }
}

Prevention

When it happens

Trigger: Submitting a batch reference whose 'from' beacon omits the class segment (e.g. "weaviate://localhost/<uuid>" instead of "weaviate://localhost/Article/<uuid>") for a multi-tenancy enabled class.

Common situations: Older clients or scripts written before multi-tenancy that used class-less beacons; hand-built beacon strings; migrations from single-tenant setups.

Related errors


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