larksuite/cli · error

event catalog rejected:

Error message

event catalog rejected:
  

What it means

This error is produced by Compile when the event catalog has validation problems: all collected problem strings are joined into one aggregated message ('event catalog rejected:\n <problem>\n <problem>'). Compile is a guard so an invalid or inconsistent catalog (bad declarations, placeholder schemas, credential-redaction violations) never becomes a Snapshot. The message enumerates each concrete problem after a two-space bullet.

Source

Thrown at internal/event/catalog/compile.go:110

			capability: Capability{
				Preparation:    preparation,
				BufferSize:     def.BufferSize,
				Workers:        def.Workers,
				SingleConsumer: def.SingleConsumer,
			},
			binding: RuntimeBinding{
				NormalizeParams: def.NormalizeParams,
				Match:           def.Match,
				Process:         def.Process,
				PreConsume:      def.PreConsume,
			},
			canonical: def,
		}
		keys = append(keys, def.Key)
	}

	if len(problems) > 0 {
		return nil, errors.New("event catalog rejected:\n  " + strings.Join(problems, "\n  "))
	}

	sort.Strings(keys)
	return &Snapshot{entries: entries, keys: keys}, nil
}

// jqRootPath states where consumers address output fields from: native keys
// deliver the V2 envelope (fields under .event), processed keys deliver the
// processor's flat shape (fields at the root).
func jqRootPath(mode OutputMode) string {
	if mode == OutputNative {
		return ".event"
	}
	return "."
}

// validateDefinition runs the per-declaration contract checks. It reports
// every violation instead of stopping at the first.

View on GitHub (pinned to 7fd6ef3c07)

Solutions

  1. Read each bullet line in the error — it lists every failing declaration and reason
  2. Fix the offending spec: give the schema a real Type or Raw, or redact credential-like params
  3. Re-run compile/tests (e.g. TestBotMenuRegistersCleanly) to confirm the catalog is clean

Example fix

// before
Schema: &catalog.Schema{} // placeholder: empty document
// after
Schema: &catalog.Schema{Type: "object", Properties: ...}
Defensive patterns

Strategy: validation

Validate before calling

snap, err := catalog.Compile(spec)
if err != nil {
    for _, problem := range strings.Split(err.Error(), "\n  ")[1:] { fmt.Println(problem) }
}

Try / catch

snap, err := catalog.Compile(spec)
if err != nil {
    // err lists every problem prefixed 'event catalog rejected:' — fix each bullet
}

Prevention

When it happens

Trigger: Calling event/catalog Compile (including compileCatalog/compileTestSnapshot in tests) with a spec whose declarations fail validation — e.g. schemas that decode to empty/placeholder documents or parameters containing unredacted credentials (see the redaction-guard test).

Common situations: Adding a new event declaration with an empty object schema; renaming a field but leaving stale placeholder schemas; registering a bot menu or catalog entry whose params embed raw credential values.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of larksuite/cli@7fd6ef3c07 (2026-09-04). Data as JSON: /api/errors/44f7477fd6fc8bc8. Report an issue: GitHub.