{"record":{"id":"f83b59b9a7f259f1","repo":"nats-io/nats-server","slug":"rollup-not-permitted","errorCode":null,"errorMessage":"rollup not permitted","messagePattern":"rollup not permitted","errorType":"error_code","errorClass":"JSStreamRollupFailedError","httpStatus":null,"severity":"error","filePath":"server/stream.go","lineNumber":6925,"sourceCode":"\n\t\t// Expected last msgId.\n\t\tif lmsgId := getExpectedLastMsgId(hdr); lmsgId != _EMPTY_ {\n\t\t\tif lmsgId != mset.lmsgId {\n\t\t\t\tlast := mset.lmsgId\n\t\t\t\tbumpCLFS()\n\t\t\t\tif canRespond {\n\t\t\t\t\tresp.PubAck = &PubAck{Stream: name}\n\t\t\t\t\tresp.Error = NewJSStreamWrongLastMsgIDError(last)\n\t\t\t\t\tb, _ := json.Marshal(resp)\n\t\t\t\t\toutq.sendMsg(reply, b)\n\t\t\t\t}\n\t\t\t\treturn fmt.Errorf(\"last msgid mismatch: %q vs %q\", lmsgId, last)\n\t\t\t}\n\t\t}\n\t\t// Check for any rollups.\n\t\tif rollup := getRollup(hdr); rollup != _EMPTY_ {\n\t\t\tif canConsistencyCheck && !allowRollupPurge && !sourced {\n\t\t\t\terr := errors.New(\"rollup not permitted\")\n\t\t\t\tif canRespond {\n\t\t\t\t\tresp.PubAck = &PubAck{Stream: name}\n\t\t\t\t\tresp.Error = NewJSStreamRollupFailedError(err)\n\t\t\t\t\tb, _ := json.Marshal(resp)\n\t\t\t\t\toutq.sendMsg(reply, b)\n\t\t\t\t}\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tswitch rollup {\n\t\t\tcase JSMsgRollupSubject:\n\t\t\t\trollupSub = true\n\t\t\tcase JSMsgRollupAll:\n\t\t\t\trollupAll = true\n\t\t\tdefault:\n\t\t\t\tif canConsistencyCheck {\n\t\t\t\t\terr := fmt.Errorf(\"rollup value invalid: %q\", rollup)\n\t\t\t\t\tif canRespond {\n\t\t\t\t\t\tresp.PubAck = &PubAck{Stream: name}","sourceCodeStart":6907,"sourceCodeEnd":6943,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/stream.go#L6907-L6943","documentation":"The publish carries a Rollup header but the stream does not permit rollups (AllowRollup not enabled, or rollup purge disallowed such as for sourced streams under consistency checking), so the publish is rejected after the header is parsed.","triggerScenarios":"Thrown at server/stream.go:6925 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enable allow_rollup_hdrs on the stream configuration","Remove the Nats-Rollup header from the publish","For sourced/mirror streams, apply rollups on the origin stream only"],"exampleFix":null,"handlingStrategy":"validation","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"}