weaviate/weaviate · error

index for collection %q not found

Error message

index for collection %q not found

What it means

EditOpBucketsForShards fails when a requested shard cannot be found in the shard map at all — not merely unloaded, but absent (deactivated tenant removed, lazy shard not present locally). Callers treat this as 'some shards not locally available' and defer work for those shards to later sweeps.

Source

Thrown at adapters/repos/db/drop_vector_index_wiring.go:39

	"github.com/weaviate/weaviate/adapters/repos/db/helpers"
	"github.com/weaviate/weaviate/entities/models"
	"github.com/weaviate/weaviate/entities/modelsext"
	entschema "github.com/weaviate/weaviate/entities/schema"
	"github.com/weaviate/weaviate/usecases/schema"
)

// EditOpBucketsForShards resolves the edit-ops objects buckets for the given
// local shards by direct map lookup — O(requested), not O(collection) — so a
// bounded round on a huge MT collection does not pay a full shard-map walk. A
// shard absent from the result is not locally available (a deactivated
// tenant, or a lazy shard that failed to load). Lazy shards are loaded
// explicitly with the error surfaced — never via Store()'s panicking mustLoad
// — acceptable for a drop, a rare operator-initiated action that must touch
// every shard once anyway.
func (db *DB) EditOpBucketsForShards(ctx context.Context, collection string, shardNames []string) (map[string]editOpBucket, error) {
	idx := db.GetIndex(entschema.ClassName(collection))
	if idx == nil {
		return nil, fmt.Errorf("index for collection %q not found", collection)
	}
	buckets := make(map[string]editOpBucket, len(shardNames))
	for _, name := range shardNames {
		s := idx.shards.Load(name)
		if s == nil {
			continue
		}
		if lazy, ok := s.(*LazyLoadShard); ok {
			if err := lazy.Load(ctx); err != nil {
				db.logger.WithField("collection", collection).WithField("shard", name).
					Warnf("drop-vector: load lazy shard: %v", err)
				continue // absent from result; the unit fails instead of panicking
			}
		}
		if b := s.Store().Bucket(helpers.ObjectsBucketLSM); b != nil {
			buckets[name] = b
		}
	}

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Treat missing shards as deferred work — the periodic cleanup sweep retries on next load
  2. Activate the tenant/shard if its edit op must be deleted immediately
  3. Verify the shard name and collection state in the schema
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at adapters/repos/db/drop_vector_index_wiring.go:39 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/d2595a58ff076950. Report an issue: GitHub.