weaviate/weaviate · error

IdToIdentifier %q already exists in a different namespace

Error message

IdToIdentifier %q already exists in a different namespace

What it means

Namespace stripping found two entries in the IdToIdentifier map from different namespaces that reduce to the same stripped internal ID. The guard blocks the strip because one internal user ID would map to two identifiers (or overwrite), corrupting the identifier lookup after restore.

Source

Thrown at usecases/auth/authentication/apikey/db_users.go:920

		}
		if newID != id {
			cp.Id = newID
			cp.Namespace = ""
		}
		out.Users[newID] = cp
	}

	for id, v := range src.SecureKeyStorageById {
		newID := namespacing.StripQualification(id)
		if _, exists := out.SecureKeyStorageById[newID]; exists {
			return dbUserdata{}, fmt.Errorf("SecureKeyStorageById %q already exists in a different namespace", id)
		}
		out.SecureKeyStorageById[newID] = v
	}
	for id, v := range src.IdToIdentifier {
		newID := namespacing.StripQualification(id)
		if _, exists := out.IdToIdentifier[newID]; exists {
			return dbUserdata{}, fmt.Errorf("IdToIdentifier %q already exists in a different namespace", id)
		}
		out.IdToIdentifier[newID] = v
	}
	for id := range src.UserKeyRevoked {
		newID := namespacing.StripQualification(id)
		if _, exists := out.UserKeyRevoked[newID]; exists {
			return dbUserdata{}, fmt.Errorf("UserKeyRevoked %q already exists in a different namespace", id)
		}
		out.UserKeyRevoked[newID] = struct{}{}
	}
	// IdentifierToId is keyed by user id; rewrite the value.
	for identifier, id := range src.IdentifierToId {
		out.IdentifierToId[identifier] = namespacing.StripQualification(id)
	}

	return out, nil
}

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Inspect IdToIdentifier in the snapshot for the colliding internal IDs
  2. Rename or drop one of the colliding dynamic users
  3. Restore without namespace stripping
  4. Fix the source data and re-take the snapshot
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at usecases/auth/authentication/apikey/db_users.go:920 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/854daf1643c1fb30. Report an issue: GitHub.