nats-io/nats-server · error · JSStreamRollupFailedError
rollup not permitted
Error message
rollup not permitted
What it means
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.
Source
Thrown at server/stream.go:6925
// Expected last msgId.
if lmsgId := getExpectedLastMsgId(hdr); lmsgId != _EMPTY_ {
if lmsgId != mset.lmsgId {
last := mset.lmsgId
bumpCLFS()
if canRespond {
resp.PubAck = &PubAck{Stream: name}
resp.Error = NewJSStreamWrongLastMsgIDError(last)
b, _ := json.Marshal(resp)
outq.sendMsg(reply, b)
}
return fmt.Errorf("last msgid mismatch: %q vs %q", lmsgId, last)
}
}
// Check for any rollups.
if rollup := getRollup(hdr); rollup != _EMPTY_ {
if canConsistencyCheck && !allowRollupPurge && !sourced {
err := errors.New("rollup not permitted")
if canRespond {
resp.PubAck = &PubAck{Stream: name}
resp.Error = NewJSStreamRollupFailedError(err)
b, _ := json.Marshal(resp)
outq.sendMsg(reply, b)
}
return err
}
switch rollup {
case JSMsgRollupSubject:
rollupSub = true
case JSMsgRollupAll:
rollupAll = true
default:
if canConsistencyCheck {
err := fmt.Errorf("rollup value invalid: %q", rollup)
if canRespond {
resp.PubAck = &PubAck{Stream: name}View on GitHub (pinned to 3a66a489d2)
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
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at server/stream.go:6925 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of nats-io/nats-server@3a66a489d2 (2026-09-02).
Data as JSON: /api/errors/f83b59b9a7f259f1.
Report an issue: GitHub.