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 nilView on GitHub (pinned to 75aa4b6d11)
Solutions
- Read the wrapped inner error (%w) for the concrete NewShard failure and fix that first
- Check disk health/space and permissions for the shard directory under the index path
- If segments are corrupt, restore the shard from backup or remove the shard dir and re-sync replication/re-import
- Verify you did not downgrade past a storage-format change; upgrade instead
- 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
- Monitor disk health and use durable (non-NFS) storage
- Always back up before upgrades; never downgrade across storage-format changes
- Set memory limits compatible with alloc-checker reservations
- Schedule regular backups and verify restore-ability
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
- init shard %q
- Unable to load shard %s: %v
- init index %q: %w
- local shard object search %s: %w
- delete local object: shard=%q: %w
AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04).
Data as JSON: /api/errors/20fe434554676d98.
Report an issue: GitHub.