{"record":{"id":"c408853cf88a01d5","repo":"caddyserver/caddy","slug":"resolver-address-must-have-exactly-one-address-ca","errorCode":null,"errorMessage":"resolver address must have exactly one address; cannot call %v","messagePattern":"resolver address must have exactly one address; cannot call (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/caddyhttp/reverseproxy/upstreams.go","lineNumber":547,"sourceCode":"\t// It accepts [network addresses](/docs/conventions#network-addresses)\n\t// with port range of only 1. If the host is an IP address, it will be dialed directly to resolve the upstream server.\n\t// If the host is not an IP address, the addresses are resolved using the [name resolution convention](https://golang.org/pkg/net/#hdr-Name_Resolution) of the Go standard library.\n\t// If the array contains more than 1 resolver address, one is chosen at random.\n\tAddresses []string `json:\"addresses,omitempty\"`\n\tnetAddrs  []caddy.NetworkAddress\n}\n\n// ParseAddresses parses all the configured network addresses\n// and ensures they're ready to be used.\nfunc (u *UpstreamResolver) ParseAddresses() error {\n\tu.netAddrs = make([]caddy.NetworkAddress, 0, len(u.Addresses))\n\tfor _, v := range u.Addresses {\n\t\taddr, err := caddy.ParseNetworkAddressWithDefaults(v, \"udp\", 53)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif addr.PortRangeSize() != 1 {\n\t\t\treturn fmt.Errorf(\"resolver address must have exactly one address; cannot call %v\", addr)\n\t\t}\n\t\tu.netAddrs = append(u.netAddrs, addr)\n\t}\n\treturn nil\n}\n\nfunc allNew(upstreams []Upstream) []*Upstream {\n\tresults := make([]*Upstream, len(upstreams))\n\tfor i := range upstreams {\n\t\tresults[i] = &Upstream{Dial: upstreams[i].Dial}\n\t}\n\treturn results\n}\n\nvar (\n\tsrvs   = make(map[string]srvLookup)\n\tsrvsMu sync.RWMutex\n","sourceCodeStart":529,"sourceCodeEnd":565,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/modules/caddyhttp/reverseproxy/upstreams.go#L529-L565","documentation":"Error \"resolver address must have exactly one address; cannot call %v\" thrown in caddyserver/caddy.","triggerScenarios":"Thrown at modules/caddyhttp/reverseproxy/upstreams.go:547 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a single resolver address (host:port) without port ranges or multiple addresses."],"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-15T22:17:37.221Z"}