{"record":{"id":"ad3edcb927b022d0","repo":"caddyserver/caddy","slug":"invalid-matcher-factory-must-be-celmatcherfactory","errorCode":null,"errorMessage":"invalid matcher factory, must be CELMatcherFactory or CELMatcherWithErrorFactory: %T","messagePattern":"invalid matcher factory, must be CELMatcherFactory or CELMatcherWithErrorFactory: %T","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/caddyhttp/celmatcher.go","lineNumber":548,"sourceCode":"\t\t\t\tfunc(args ...ref.Val) ref.Val {\n\t\t\t\t\t// The request value, guaranteed to be of type celHTTPRequest\n\t\t\t\t\tcelReq := args[0]\n\t\t\t\t\t// If needed this call could be changed to convert the value\n\t\t\t\t\t// to a *http.Request using CEL's ConvertToNative method.\n\t\t\t\t\thttpReq := celReq.Value().(celHTTPRequest)\n\t\t\t\t\tif m, ok := matcher.(RequestMatcherWithError); ok {\n\t\t\t\t\t\tmatch, err := m.MatchWithError(httpReq.Request)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn types.WrapErr(err)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn types.Bool(match)\n\t\t\t\t\t}\n\t\t\t\t\treturn types.Bool(matcher.Match(httpReq.Request))\n\t\t\t\t},\n\t\t\t), nil\n\t\t}\n\n\t\treturn nil, fmt.Errorf(\"invalid matcher factory, must be CELMatcherFactory or CELMatcherWithErrorFactory: %T\", fac)\n\t}\n}\n\n// CELMatcherRuntimeFunction creates a function binding for when the input to the matcher\n// is dynamically resolved rather than a set of static constant values.\nfunc CELMatcherRuntimeFunction(funcName string, fac any) functions.BinaryOp {\n\treturn func(celReq, matcherData ref.Val) ref.Val {\n\t\tif factory, ok := fac.(CELMatcherWithErrorFactory); ok {\n\t\t\tmatcher, err := factory(matcherData)\n\t\t\tif err != nil {\n\t\t\t\treturn types.WrapErr(err)\n\t\t\t}\n\t\t\thttpReq := celReq.Value().(celHTTPRequest)\n\t\t\tmatch, err := matcher.MatchWithError(httpReq.Request)\n\t\t\tif err != nil {\n\t\t\t\treturn types.WrapErr(err)\n\t\t\t}\n\t\t\treturn types.Bool(match)","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/modules/caddyhttp/celmatcher.go#L530-L566","documentation":"Error \"invalid matcher factory, must be CELMatcherFactory or CELMatcherWithErrorFactory: %T\" thrown in caddyserver/caddy.","triggerScenarios":"Thrown at modules/caddyhttp/celmatcher.go:548 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["This is an internal error; ensure the CEL matcher factory is one of the supported factory types. Report it if it occurs with stock configuration."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}