{"record":{"id":"fffc15f72b61aa17","repo":"hashicorp/nomad","slug":"consul-connect-group-q-with-service-q-must-not-c","errorCode":null,"errorMessage":"Consul Connect group %q with service %q must not contain uppercase characters","messagePattern":"Consul Connect group %q with service %q must not contain uppercase characters","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/job_endpoint_hook_connect.go","lineNumber":668,"sourceCode":"\treturn fmt.Errorf(\"%s: %w: group %q uses network mode %q; must be %s\",\n\t\terrorPrefix, ErrConnectInvalidNetworkMode, g.Name, mode, allowed)\n}\n\nfunc groupConnectSidecarValidate(g *structs.TaskGroup, s *structs.Service) error {\n\tif err := groupConnectNetworkModeValidate(g, \"connect sidecar\", false); err != nil {\n\t\treturn err\n\t}\n\n\t// We must enforce lowercase characters on group and service names for connect\n\t// sidecar proxies, because Consul assumes this invariant without validating it.\n\t// https://github.com/hashicorp/consul/blob/v1.9.5/command/connect/proxy/proxy.go#L235\n\n\tif s.Name != strings.ToLower(s.Name) {\n\t\treturn fmt.Errorf(\"Consul Connect service name %q in group %q must not contain uppercase characters\", s.Name, g.Name)\n\t}\n\n\tif g.Name != strings.ToLower(g.Name) {\n\t\treturn fmt.Errorf(\"Consul Connect group %q with service %q must not contain uppercase characters\", g.Name, s.Name)\n\t}\n\n\treturn nil\n}\n\nfunc groupConnectNativeValidate(g *structs.TaskGroup, s *structs.Service) error {\n\t// note that network mode is not enforced for connect native services\n\n\tif _, err := getNamedTaskForNativeService(g, s.Name, s.TaskName); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc groupConnectGatewayValidate(g *structs.TaskGroup) error {\n\t// note that gateways can run in host network mode\n\treturn groupConnectNetworkModeValidate(g, \"connect gateway\", true)\n}","sourceCodeStart":650,"sourceCodeEnd":686,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/job_endpoint_hook_connect.go#L650-L686","documentation":"Same lowercase invariant as the service name, applied to the task group name: a connect group whose group name contains uppercase characters is rejected, because Consul derives the proxy ID from group and service names and assumes lowercase.","triggerScenarios":"Submitting a job where a task group containing a connect sidecar service is named with any uppercase letters, e.g. `group \"Web\"` with a connect service, in groupConnectSidecarValidate.","commonSituations":"Group names mirroring capitalized app or team names; templating that injects job/group names from uppercase sources; users converting legacy jobs with capitalized group names to use connect.","solutions":["Rename the task group to all lowercase (e.g. group \"web\").","Ensure any templated job/group names are lowercased before submission.","If the service has no connect block, remove it to bypass this validation."],"exampleFix":"// before\ngroup \"WebApp\" {\n  service {\n    name = \"web\"\n    connect { sidecar_service {} }\n  }\n}\n// after\ngroup \"webapp\" {\n  service {\n    name = \"web\"\n    connect { sidecar_service {} }\n  }\n}","handlingStrategy":"validation","validationCode":"function validateConnectGroupName(group) {\n  const hasConnect = (group.services || []).some(s => s.connect);\n  if (hasConnect && group.name !== group.name.toLowerCase()) {\n    throw new Error(`connect group name \"${group.name}\" must be lowercase`);\n  }\n}","typeGuard":"function isLowercase(s) { return typeof s === 'string' && s === s.toLowerCase(); }","tryCatchPattern":null,"preventionTips":["Name all task groups in lowercase, especially those using connect.","Lowercase group names when generating jobs from templates or external sources.","Lint job HCL for uppercase group/service names in connect-enabled groups."],"tags":["nomad","consul-connect","naming","job-validation"],"backgroundTag":"connect-name-uppercase","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"}