{"record":{"id":"3134728304594d11","repo":"hashicorp/nomad","slug":"one-consul-gateway-configuration-must-be-set","errorCode":null,"errorMessage":"One Consul Gateway Configuration must be set","messagePattern":"One Consul Gateway Configuration must be set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/services.go","lineNumber":2007,"sourceCode":"\t}\n\n\tif err := g.Mesh.Validate(); err != nil {\n\t\treturn err\n\t}\n\n\t// Exactly 1 of ingress/terminating/mesh must be set.\n\tcount := 0\n\tif g.Ingress != nil {\n\t\tcount++\n\t}\n\tif g.Terminating != nil {\n\t\tcount++\n\t}\n\tif g.Mesh != nil {\n\t\tcount++\n\t}\n\tif count != 1 {\n\t\treturn fmt.Errorf(\"One Consul Gateway Configuration must be set\")\n\t}\n\treturn nil\n}\n\n// ConsulGatewayBindAddress is equivalent to Consul's api/catalog.go ServiceAddress\n// struct, as this is used to encode values to pass along to Envoy (i.e. via\n// JSON encoding).\ntype ConsulGatewayBindAddress struct {\n\tAddress string\n\tPort    int\n}\n\nfunc (a *ConsulGatewayBindAddress) Equal(o *ConsulGatewayBindAddress) bool {\n\tif a == nil || o == nil {\n\t\treturn a == o\n\t}\n\n\tif a.Address != o.Address {","sourceCodeStart":1989,"sourceCodeEnd":2025,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/services.go#L1989-L2025","documentation":"ConsulGateway.Validate counts the ingress, terminating, and mesh config blocks; exactly one must be present per gateway. This error means zero (or more than one) of them was set, so the gateway type is ambiguous or absent.","triggerScenarios":"Thrown at nomad/structs/services.go:2007 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add exactly one of ingress, terminating, or mesh inside the gateway block","Remove extra gateway config blocks so only one remains"],"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"}