{"record":{"id":"309c0758c195f92c","repo":"caddyserver/caddy","slug":"server-block-v-compiling-matcher-sets-v","errorCode":null,"errorMessage":"server block %v: compiling matcher sets: %v","messagePattern":"server block (.+?): compiling matcher sets: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"caddyconfig/httpcaddyfile/httptype.go","lineNumber":770,"sourceCode":"\t\t\t\t\tname := names[0]\n\t\t\t\t\tnames = names[1:]\n\t\t\t\t\tif _, ok := srv.NamedRoutes[name]; ok {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif configuredNamedRoutes[name] == nil {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\"cannot invoke named route '%s', which was not defined\", name)\n\t\t\t\t\t}\n\t\t\t\t\tsrv.NamedRoutes[name] = configuredNamedRoutes[name]\n\t\t\t\t\tnames = append(names, namedRouteInvokes[name]...)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// create a subroute for each site in the server block\n\t\tfor _, sblock := range p.serverBlocks {\n\t\t\tmatcherSetsEnc, err := st.compileEncodedMatcherSets(sblock)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"server block %v: compiling matcher sets: %v\", sblock.block.Keys, err)\n\t\t\t}\n\n\t\t\thosts := sblock.hostsFromKeys(false)\n\n\t\t\t// emit warnings if user put unspecified IP addresses; they probably want the bind directive\n\t\t\tfor _, h := range hosts {\n\t\t\t\tif h == \"0.0.0.0\" || h == \"::\" {\n\t\t\t\t\tcaddy.Log().Named(\"caddyfile\").Warn(\"Site block has an unspecified IP address which only matches requests having that Host header; you probably want the 'bind' directive to configure the socket\", zap.String(\"address\", h))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// collect hosts that are forced to be automated\n\t\t\tforceAutomatedNames := make(map[string]struct{})\n\t\t\tif _, ok := sblock.pile[\"tls.force_automate\"]; ok {\n\t\t\t\tfor _, host := range hosts {\n\t\t\t\t\tforceAutomatedNames[host] = struct{}{}\n\t\t\t\t}\n\t\t\t}","sourceCodeStart":752,"sourceCodeEnd":788,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/caddyconfig/httpcaddyfile/httptype.go#L752-L788","documentation":"Error \"server block %v: compiling matcher sets: %v\" thrown in caddyserver/caddy.","triggerScenarios":"Thrown at caddyconfig/httpcaddyfile/httptype.go:770 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the matcher configuration in the referenced server block; the wrapped error identifies the specific matcher problem."],"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"}