{"record":{"id":"20fe434554676d98","repo":"weaviate/weaviate","slug":"init-shard-s-of-index-s-w","errorCode":null,"errorMessage":"init shard %s of index %s: %w","messagePattern":"init shard (.+?) of index (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"adapters/repos/db/index.go","lineNumber":653,"sourceCode":"\t\t\t\t// avoid footprint of empty shards\n\t\t\t\tif i.partitioningEnabled && i.unloadedShardIsEmpty(shardName) {\n\t\t\t\t\ti.shards.Store(shardName, NewLazyLoadShard(ctx, promMetrics, shardName, i, class,\n\t\t\t\t\t\ti.centralJobQueue, i.indexCheckpoints, i.allocChecker, i.shardLoadLimiter,\n\t\t\t\t\t\ti.shardReindexer, false, i.bitmapBufPool))\n\t\t\t\t\tstartupShards.lazy.Add(1)\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\t// default behavior is to load all shards immediately\n\t\t\t\tif err := i.shardLoadLimiter.Acquire(ctx); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"acquiring permit to load shard: %w\", err)\n\t\t\t\t}\n\t\t\t\tdefer i.shardLoadLimiter.Release()\n\n\t\t\t\tnewShard, err := NewShard(ctx, promMetrics, shardName, i, class, i.centralJobQueue, i.scheduler,\n\t\t\t\t\ti.indexCheckpoints, i.shardReindexer, false, i.bitmapBufPool,\n\t\t\t\t\tmonitoring.ShardRegistrationEager)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"init shard %s of index %s: %w\", shardName, i.ID(), err)\n\t\t\t\t}\n\n\t\t\t\tpromMetrics.NewLoadedShard()\n\t\t\t\tnewShard.metricsRegistered.Store(true)\n\t\t\t\ti.shards.Store(shardName, newShard)\n\t\t\t\tstartupShards.eager.Add(1)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}, shardName)\n\t}\n\n\tif err := eg.Wait(); err != nil {\n\t\treturn err\n\t}\n\n\tif !i.Config.EnableLazyLoadShards {\n\t\ti.allShardsReady.Store(true)\n\t\treturn nil","sourceCodeStart":635,"sourceCodeEnd":671,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/index.go#L635-L671","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"shard, err := NewShard(ctx, ...)\nif err != nil {\n  // inspect wrapped cause; attempt reload once before failing boot\n  shard, err = NewShard(ctx, ...)\n  if err != nil { return fmt.Errorf(\"init shard %s of index %s: %w\", name, idxID, err) }\n}","preventionTips":["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"],"tags":["shard","startup","storage"],"backgroundTag":"shard-init-failed","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}