{"record":{"id":"7638aacd2a5b7fb2","repo":"caddyserver/caddy","slug":"missing-req-argument","errorCode":null,"errorMessage":"missing 'req' argument","messagePattern":"missing 'req' argument","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/caddyhttp/celmatcher.go","lineNumber":481,"sourceCode":"}\n\n// CELMatcherDecorator matches a call overload generated by a CEL macro\n// that takes a single argument, and optimizes the implementation to precompile\n// the matcher and return a function that references the precompiled and\n// provisioned matcher.\nfunc CELMatcherDecorator(funcName string, fac any) interpreter.InterpretableDecorator {\n\treturn func(i interpreter.Interpretable) (interpreter.Interpretable, error) {\n\t\tcall, ok := i.(interpreter.InterpretableCall)\n\t\tif !ok {\n\t\t\treturn i, nil\n\t\t}\n\t\tif call.OverloadID() != funcName {\n\t\t\treturn i, nil\n\t\t}\n\t\tcallArgs := call.Args()\n\t\treqAttr, ok := callArgs[0].(interpreter.InterpretableAttribute)\n\t\tif !ok {\n\t\t\treturn nil, errors.New(\"missing 'req' argument\")\n\t\t}\n\t\tnsAttr, ok := reqAttr.Attr().(interpreter.NamespacedAttribute)\n\t\tif !ok {\n\t\t\treturn nil, errors.New(\"missing 'req' argument\")\n\t\t}\n\t\tvarNames := nsAttr.CandidateVariableNames()\n\t\tif len(varNames) != 1 || len(varNames) == 1 && varNames[0] != CELRequestVarName {\n\t\t\treturn nil, errors.New(\"missing 'req' argument\")\n\t\t}\n\t\tmatcherData, ok := callArgs[1].(interpreter.InterpretableConst)\n\t\tif !ok {\n\t\t\t// If the matcher arguments are not constant, then this means\n\t\t\t// they contain a Caddy placeholder reference and the evaluation\n\t\t\t// and matcher provisioning should be handled at dynamically.\n\t\t\treturn i, nil\n\t\t}\n\n\t\tif factory, ok := fac.(CELMatcherWithErrorFactory); ok {","sourceCodeStart":463,"sourceCodeEnd":499,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/modules/caddyhttp/celmatcher.go#L463-L499","documentation":"While rotating an ECH key, Caddy marks the old config's metadata as Replaced and json.Marshal of that metadata (echConfigMeta, which includes publication history maps with time.Time values) failed. Marshal failures here are practically impossible with well-formed structs — this indicates memory corruption or an unsupported dynamic value, and mainly serves as a defensive error path.","triggerScenarios":"json.Marshal(ech.configs[publicName][i].meta) returns an error, e.g. an unmarshalable type injected into the meta struct, or a NaN/unsupported value in publication history timestamps.","commonSituations":"Almost never seen in practice; would surface only from a bug in Caddy or a plugin writing invalid values into echConfigMeta. If seen, suspect a corrupted build or memory issue.","solutions":["Treat as a bug: collect the wrapped error and report it upstream with the Caddy version.","Restart the instance; rotation will re-attempt and re-derive metadata.","If persistent, reset the ech/configs storage folder to regenerate clean metadata."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := rotateECHKeys(...); err != nil { if strings.Contains(err.Error(), \"marshaling updated ECH config metadata\") { /* defensive path: log details, restart to rebuild state */ } }","preventionTips":["Treat occurrence as a bug: record version + error and report upstream.","Restart to rebuild metadata from persisted state.","Keep Caddy updated; defensive marshal paths are revised with fixes."],"tags":["caddy","caddytls","ech","json","rotation"],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}