crowdsecurity/crowdsec · error
unknown schema option %q
Error message
unknown schema option %q
What it means
parseSchemaOptions hit a map key that is not one of the recognized schema option names (on_route_not_found, on_method_not_allowed, on_unsupported_security_scheme, ...). The option name is echoed; it is a typo or an option from a newer/older crowdsec version.
Source
Thrown at pkg/appsec/appsec.go:1933
return w.RequestValidator.RegisterBodyDecoder(contentType, decoderName)
}
func parseSchemaOptions(opts map[string]any) (*apivalidation.SchemaOptions, error) {
out := &apivalidation.SchemaOptions{}
for k, v := range opts {
s, ok := v.(string)
if !ok {
return nil, fmt.Errorf("schema option %q must be a string, got %T", k, v)
}
switch k {
case "on_route_not_found":
out.OnRouteNotFound = apivalidation.Policy(s)
case "on_method_not_allowed":
out.OnMethodNotAllowed = apivalidation.Policy(s)
case "on_unsupported_security_scheme":
out.OnUnsupportedSecurityScheme = apivalidation.Policy(s)
default:
return nil, fmt.Errorf("unknown schema option %q", k)
}
}
return out, nil
}
// validationErrorVarKeys lists the keys published into state.HookVars by
// ValidateRequestWithSchema. Keeping them centralized makes it easy to reset
// them all at the start of each validation call.
var validationErrorVarKeys = []string{
"validation_error",
"validation_error_reason",
"validation_error_field",
"validation_error_message",
"validation_error_value",
"validation_error_expected",
}
// ValidateRequestWithSchema validates r against the OpenAPI schema registeredView on GitHub (pinned to 909b515798)
Solutions
- Fix or remove the unknown key in the appsec api_validation schema options block
- Check the documented option names for the installed crowdsec version — misspellings are the common cause
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at pkg/appsec/appsec.go:1933 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of crowdsecurity/crowdsec@909b515798 (2026-09-06).
Data as JSON: /api/errors/a507c3f052461c01.
Report an issue: GitHub.