{"record":{"id":"88a43550c0afe35a","repo":"caddyserver/caddy","slug":"route-d-v","errorCode":null,"errorMessage":"route %d: %v","messagePattern":"route (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/caddyhttp/routes.go","lineNumber":215,"sourceCode":"\n// Provision sets up both the matchers and handlers in the routes.\nfunc (routes RouteList) Provision(ctx caddy.Context) error {\n\terr := routes.ProvisionMatchers(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn routes.ProvisionHandlers(ctx, nil)\n}\n\n// ProvisionMatchers sets up all the matchers by loading the\n// matcher modules. Only call this method directly if you need\n// to set up matchers and handlers separately without having\n// to provision a second time; otherwise use Provision instead.\nfunc (routes RouteList) ProvisionMatchers(ctx caddy.Context) error {\n\tfor i := range routes {\n\t\terr := routes[i].ProvisionMatchers(ctx)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"route %d: %v\", i, err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// ProvisionHandlers sets up all the handlers by loading the\n// handler modules. Only call this method directly if you need\n// to set up matchers and handlers separately without having\n// to provision a second time; otherwise use Provision instead.\nfunc (routes RouteList) ProvisionHandlers(ctx caddy.Context, metrics *Metrics) error {\n\tfor i := range routes {\n\t\terr := routes[i].ProvisionHandlers(ctx, metrics)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"route %d: %v\", i, err)\n\t\t}\n\t}\n\treturn nil\n}","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/modules/caddyhttp/routes.go#L197-L233","documentation":"Aggregation error from RouteList.ProvisionMatchers: it provisions matchers for every route in a list and, on the first failure, returns the failing route's 0-based index with the underlying error. It is purely positional context — the real problem is in the wrapped matcher-loading error (see 524).","triggerScenarios":"A subroute or route array where route N has an invalid/unknown matcher; provisioning stops at the first bad route and reports its index.","commonSituations":"Large generated route tables (e.g. from caddyfile adaptation of many site blocks) where one block has a bad matcher; the index tells you which block to fix.","solutions":["Use the reported route index to locate the offending entry in the routes array","Follow the wrapped error to fix the specific matcher (unknown name, bad value)","Re-run 'caddy adapt' then 'caddy validate' on the fixed config"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// nothing route-specific; validate whole config:\n// caddy validate --config Caddyfile --adapter caddyfile\n// The 'route %d:' prefix then maps directly to the index in the JSON routes array.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep route lists small and generated, so indices stay meaningful","When adapting from Caddyfile, the failing index corresponds to the site block order"],"tags":["caddy","config","matchers","routing","wrapper-error"],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}