{"record":{"id":"b9d26c3e6c9c04ac","repo":"hashicorp/nomad","slug":"consul-gateway-proxy-envoy-dns-discovery-type-must","errorCode":null,"errorMessage":"Consul Gateway Proxy Envoy DNS Discovery type must be %s or %s","messagePattern":"Consul Gateway Proxy Envoy DNS Discovery type must be (.+?) or (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/services.go","lineNumber":2170,"sourceCode":"\tstrictDNS  = \"STRICT_DNS\"\n\tlogicalDNS = \"LOGICAL_DNS\"\n)\n\nfunc (p *ConsulGatewayProxy) Validate() error {\n\tif p == nil {\n\t\treturn nil\n\t}\n\n\tif p.ConnectTimeout == nil {\n\t\treturn fmt.Errorf(\"Consul Gateway Proxy connection_timeout must be set\")\n\t}\n\n\tswitch p.EnvoyDNSDiscoveryType {\n\tcase \"\", strictDNS, logicalDNS:\n\t\t// Consul defaults to logical DNS, suitable for large scale workloads.\n\t\t// https://www.envoyproxy.io/docs/envoy/v1.16.1/intro/arch_overview/upstream/service_discovery\n\tdefault:\n\t\treturn fmt.Errorf(\"Consul Gateway Proxy Envoy DNS Discovery type must be %s or %s\", strictDNS, logicalDNS)\n\t}\n\n\tfor _, bindAddr := range p.EnvoyGatewayBindAddresses {\n\t\tif err := bindAddr.Validate(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// ConsulGatewayTLSSDSConfig is used to configure the gateway's TLS listener to\n// load certificates from an external Secret Discovery Service (SDS)\ntype ConsulGatewayTLSSDSConfig struct {\n\n\t// ClusterName specifies the name of the SDS cluster where Consul should\n\t// retrieve certificates.\n\tClusterName string","sourceCodeStart":2152,"sourceCodeEnd":2188,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/services.go#L2152-L2188","documentation":"ConsulGatewayProxy.Validate rejected the envoy_dns_discovery_type: only STRICT_DNS and LOGICAL_DNS are accepted (empty string defaults to Consul's logical DNS). Any other value in the proxy stanza fails here.","triggerScenarios":"Thrown at nomad/structs/services.go:2170 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set envoy_dns_discovery_type to STRICT_DNS or LOGICAL_DNS","Omit envoy_dns_discovery_type to use the default LOGICAL_DNS"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}