hashicorp/nomad · error

cannot be empty

Error message

cannot be empty

What it means

NodeIntroductionConfig.Validate was invoked on a nil receiver; the validate entrypoint guards against a missing node introduction configuration block.

Source

Thrown at nomad/structs/node.go:921

	// caller and allows operators a method to limit TTL requests.
	MaxIdentityTTL time.Duration
}

// Copy creates a copy of the node introduction configuration block.
func (n *NodeIntroductionConfig) Copy() *NodeIntroductionConfig {
	if n == nil {
		return nil
	}

	newCI := *n
	return &newCI
}

// Validate checks that the node introduction configuration is valid.
func (n *NodeIntroductionConfig) Validate() error {

	if n == nil {
		return fmt.Errorf("cannot be empty")
	}

	var mErr *multierror.Error

	switch n.Enforcement {
	case NodeIntroductionEnforcementNone,
		NodeIntroductionEnforcementWarn,
		NodeIntroductionEnforcementStrict:
	default:
		mErr = multierror.Append(mErr, fmt.Errorf("invalid enforcement %q", n.Enforcement))
	}

	if n.DefaultIdentityTTL < 1 {
		mErr = multierror.Append(mErr, errors.New("default_identity_ttl must be greater than 0"))
	}

	if n.MaxIdentityTTL < 1 {
		mErr = multierror.Append(mErr, errors.New("max_identity_ttl must be greater than 0"))

View on GitHub (pinned to 482b49bf1a)

Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at nomad/structs/node.go:921 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/b45bbdf203866ba1. Report an issue: GitHub.