hashicorp/nomad · error

Consul Linked Service requires Name

Error message

Consul Linked Service requires Name

What it means

ConsulLinkedService.Validate found an empty Name on a linked service in a terminating gateway (or ingress TLS-linked) config. The name identifies the Consul service the gateway proxies to and is mandatory.

Source

Thrown at nomad/structs/services.go:2633

		return false
	case s.CertFile != o.CertFile:
		return false
	case s.KeyFile != o.KeyFile:
		return false
	case s.SNI != o.SNI:
		return false
	}

	return true
}

func (s *ConsulLinkedService) Validate() error {
	if s == nil {
		return nil
	}

	if s.Name == "" {
		return fmt.Errorf("Consul Linked Service requires Name")
	}

	caSet := s.CAFile != ""
	certSet := s.CertFile != ""
	keySet := s.KeyFile != ""
	sniSet := s.SNI != ""

	if (certSet || keySet) && !caSet {
		return fmt.Errorf("Consul Linked Service TLS requires CAFile")
	}

	if certSet != keySet {
		return fmt.Errorf("Consul Linked Service TLS Cert and Key must both be set")
	}

	if sniSet && !caSet {
		return fmt.Errorf("Consul Linked Service TLS SNI requires CAFile")
	}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Set the name of the Consul service to link in each service block
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at nomad/structs/services.go:2633 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/bab82ffae78b3628. Report an issue: GitHub.