weaviate/weaviate · critical

init shard %s of index %s: %w

Error message

init shard %s of index %s: %w

What it means

Wraps an error from NewShard when eagerly loading a shard during startup. The shard (its LSM store, vector index, inverted index, checkpoints) failed to initialize for the given shard name, and the whole index boot fails with the shard and index names included.

Source

Thrown at adapters/repos/db/index.go:653

				// avoid footprint of empty shards
				if i.partitioningEnabled && i.unloadedShardIsEmpty(shardName) {
					i.shards.Store(shardName, NewLazyLoadShard(ctx, promMetrics, shardName, i, class,
						i.centralJobQueue, i.indexCheckpoints, i.allocChecker, i.shardLoadLimiter,
						i.shardReindexer, false, i.bitmapBufPool))
					startupShards.lazy.Add(1)
					return nil
				}
				// default behavior is to load all shards immediately
				if err := i.shardLoadLimiter.Acquire(ctx); err != nil {
					return fmt.Errorf("acquiring permit to load shard: %w", err)
				}
				defer i.shardLoadLimiter.Release()

				newShard, err := NewShard(ctx, promMetrics, shardName, i, class, i.centralJobQueue, i.scheduler,
					i.indexCheckpoints, i.shardReindexer, false, i.bitmapBufPool,
					monitoring.ShardRegistrationEager)
				if err != nil {
					return fmt.Errorf("init shard %s of index %s: %w", shardName, i.ID(), err)
				}

				promMetrics.NewLoadedShard()
				newShard.metricsRegistered.Store(true)
				i.shards.Store(shardName, newShard)
				startupShards.eager.Add(1)
				return nil
			}
		}, shardName)
	}

	if err := eg.Wait(); err != nil {
		return err
	}

	if !i.Config.EnableLazyLoadShards {
		i.allShardsReady.Store(true)
		return nil

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Read the wrapped inner error (%w) for the concrete NewShard failure and fix that first
  2. Check disk health/space and permissions for the shard directory under the index path
  3. If segments are corrupt, restore the shard from backup or remove the shard dir and re-sync replication/re-import
  4. Verify you did not downgrade past a storage-format change; upgrade instead
  5. Check memory limits (alloc checker) and raise MEMORY_LIMIT or reduce caches
Defensive patterns

Strategy: retry

Try / catch

shard, err := NewShard(ctx, ...)
if err != nil {
  // inspect wrapped cause; attempt reload once before failing boot
  shard, err = NewShard(ctx, ...)
  if err != nil { return fmt.Errorf("init shard %s of index %s: %w", name, idxID, err) }
}

Prevention

When it happens

Trigger: NewShard returns an error during the startup shard loop: corrupt LSM segments, unreadable/mismatched sharding state files, disk I/O errors, memory limits (alloc checker), incompatible index files from an older version, or a vector index consistency error.

Common situations: Disk corruption or truncated WAL after a hard crash (OOM-kill/power loss); downgrade attempts to an older Weaviate version; insufficient memory limits hitting the allocation checker; NFS/network storage flakiness; orphaned shard directories not matching the sharding state.

Related errors


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