{"record":{"id":"5fdc712e57724da4","repo":"nats-io/nats-server","slug":"partial-cache-slot-index-d-is-less-than-cache-bu","errorCode":null,"errorMessage":"Partial cache: slot index %d is less than cache buffer len %d","messagePattern":"Partial cache: slot index (.+?) is less than cache buffer len (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/filestore.go","lineNumber":9144,"sourceCode":"\t\treturn nil, errNoCache\n\t}\n\t// Check partial cache status.\n\tif seq < mb.cache.fseq {\n\t\tmb.fs.warn(\"Partial cache: seq %d is less than cache fseq %d\", seq, mb.cache.fseq)\n\t\treturn nil, errPartialCache\n\t}\n\n\tbi, _, hashChecked, err := mb.slotInfo(int(seq - mb.cache.fseq))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Update cache activity.\n\tmb.llts = ats.AccessTime()\n\n\tli := int(bi)\n\tif li >= len(mb.cache.buf) {\n\t\tmb.fs.warn(\"Partial cache: slot index %d is less than cache buffer len %d\", li, len(mb.cache.buf))\n\t\treturn nil, errPartialCache\n\t}\n\tbuf := mb.cache.buf[li:]\n\n\t// We use the high bit to denote we have already checked the checksum.\n\tvar hh *highwayhash.Digest64\n\tif !hashChecked {\n\t\thh = mb.hh // This will force the hash check in msgFromBuf.\n\t}\n\n\t// Parse from the raw buffer.\n\tfsm, err := mb.msgFromBufEx(buf, sm, hh, doCopy)\n\tif err != nil || fsm == nil {\n\t\treturn nil, err\n\t}\n\n\t// Deleted messages that are decoded return a 0 for sequence.\n\tif fsm.seq == 0 {","sourceCodeStart":9126,"sourceCodeEnd":9162,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/filestore.go#L9126-L9162","documentation":"A warning logged when the block-offset byte index derived from a sequence (seq - cache.fseq) points past the end of the partial cache buffer. This is an internal consistency guard: the lookup cannot be resolved from the partial cache, errPartialCache is returned, and the caller falls back to reading the block from disk.","triggerScenarios":"Thrown at server/filestore.go:9144 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Usually harmless: caller loads the block from disk as fallback","If persistent, check for cache corruption; restart the server to rebuild caches","Report to maintainers if reproducible, as it may indicate index/buffer drift"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}