JuliusBrussee/caveman · error · ErrInvalidRule

redact: invalid redaction rule

Error message

redact: invalid redaction rule

What it means

Error "redact: invalid redaction rule" thrown in JuliusBrussee/caveman.

Source

Thrown at shared/platform/redact/payload.go:72

	RuleTypeJSONPath = "json_path"
	RuleTypeHeader   = "header"
	RuleTypeBuiltin  = "builtin"
)

// Origin values distinguish the built-in floor from operator-supplied rules in
// the report.
const (
	OriginBuiltin = "builtin"
	OriginOrg     = "org"
)

var (
	// ErrBodyTooLarge means the body exceeded MaxPayloadBytes.
	ErrBodyTooLarge = errors.New("redact: payload exceeds redaction size limit")
	// ErrInvalidRule means a rule could not be compiled or was structurally
	// unusable (empty name/pattern, or a pattern that matches the empty
	// string and would therefore rewrite the entire body).
	ErrInvalidRule = errors.New("redact: invalid redaction rule")
	// ErrRuleUnsupported means the rule's type is not implementable against an
	// opaque body by this pass.
	ErrRuleUnsupported = errors.New("redact: unsupported redaction rule type")
)

// Rule is one enabled row of the redaction_rules table, minus the columns that
// are the caller's business. Field names and JSON tags are pinned to that
// table's columns so the two cannot drift.
//
// Deliberately absent:
//   - id / organization_id / project_id — tenancy is the caller's concern.
//   - enabled — filtering disabled rows is the caller's concern; a rule that
//     reaches Payload is a rule that runs.
//
// A row with rule_type='builtin' is accepted and treated as a no-op reference:
// the built-in floor is unconditional, so such a row can neither add to nor
// subtract from it.
type Rule struct {

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Fix the redaction rule (name/pattern).

When it happens

Trigger: Thrown at shared/platform/redact/payload.go:72 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15). Data as JSON: /api/errors/b2bbbb255f643c5b. Report an issue: GitHub.