{"record":{"id":"21057ec6661edbb5","repo":"hashicorp/nomad","slug":"consul-ingress-listener-requires-protocol-of-s-g","errorCode":null,"errorMessage":"Consul Ingress Listener requires protocol of %s, got %q","messagePattern":"Consul Ingress Listener requires protocol of (.+?), got %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/services.go","lineNumber":2497,"sourceCode":"\tif l.Protocol != o.Protocol {\n\t\treturn false\n\t}\n\n\treturn ingressServicesEqual(l.Services, o.Services)\n}\n\nfunc (l *ConsulIngressListener) Validate() error {\n\tif l == nil {\n\t\treturn nil\n\t}\n\n\tif l.Port <= 0 {\n\t\treturn fmt.Errorf(\"Consul Ingress Listener requires valid Port\")\n\t}\n\n\tprotocols := []string{\"tcp\", \"http\", \"http2\", \"grpc\"}\n\tif !slices.Contains(protocols, l.Protocol) {\n\t\treturn fmt.Errorf(`Consul Ingress Listener requires protocol of %s, got %q`, strings.Join(protocols, \", \"), l.Protocol)\n\t}\n\n\tif len(l.Services) == 0 {\n\t\treturn fmt.Errorf(\"Consul Ingress Listener requires one or more services\")\n\t}\n\n\tfor _, service := range l.Services {\n\t\tif err := service.Validate(l.Protocol); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc ingressServicesEqual(a, b []*ConsulIngressService) bool {\n\treturn helper.ElementsEqual(a, b)\n}","sourceCodeStart":2479,"sourceCodeEnd":2515,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/services.go#L2479-L2515","documentation":"ConsulIngressListener.Validate found a protocol outside the supported set {tcp, http, http2, grpc} on an ingress listener; the listener protocol must match one of Consul's supported L4/L7 protocols.","triggerScenarios":"Thrown at nomad/structs/services.go:2497 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the listener protocol to one of tcp, http, http2, or grpc"],"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"}