hashicorp/nomad · warning

empty region value

Error message

empty region value

What it means

The DigitalOcean environment fingerprint fetches the region attribute from the DigitalOcean metadata service to confirm the node runs in DigitalOcean. digitalOceanProbe rejects the value when it is missing or whitespace-only, because a real DigitalOcean droplet always reports a region slug (e.g. nyc1).

Source

Thrown at client/fingerprint/env_digitalocean.go:180

	}

	// populate Links
	if id, ok := response.Attributes["unique.platform.digitalocean.id"]; ok {
		response.AddLink("digitalocean", id)
	}

	response.Detected = true
	return nil
}

func (f *EnvDigitalOceanFingerprint) digitalOceanProbe() error {
	v, err := f.Get("region", "text")
	if err != nil {
		return err
	}

	if v = strings.TrimSpace(v); v == "" {
		return errors.New("empty region value")
	}
	return nil
}

// Reload is a no-op but implements ReloadableFingerprint
func (f *EnvDigitalOceanFingerprint) Reload() {}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Verify the metadata endpoint returns a non-empty region (curl the metadata URL for region)
  2. If the host is not DigitalOcean, disable the env_digitalocean fingerprint in client config
  3. Remove stale /etc/hosts entries or proxies that answer for the DigitalOcean metadata hostname
  4. Retry fingerprinting after fixing connectivity (the fingerprint is reloadable)

Example fix

// before
client { }
// after
client {
  fingerprint {
    "env_digitalocean" { disabled = true }
  }
}
Defensive patterns

Strategy: validation

Validate before calling

// Pre-check before relying on DigitalOcean attributes
resp, _ := http.Get("https://169.254.169.254/metadata/v1/region")
body, _ := io.ReadAll(resp.Body)
if strings.TrimSpace(string(body)) == "" {
    // missing region: disable env_digitalocean fingerprint or fix metadata access
}

Type guard

func hasNonEmptyMetadata(body []byte) bool {
    return len(strings.TrimSpace(string(body))) > 0
}

Prevention

When it happens

Trigger: Fingerprinting a Nomad client where the DigitalOcean metadata endpoint answered but the region field was empty or absent — typically on non-DigitalOcean hosts where something intercepts the metadata request, or truncated/partial responses.

Common situations: Migrated Nomad clients that previously ran on DigitalOcean but now run elsewhere with stale metadata interception, proxies returning empty region fields, or DNS/hosts entries pointing metadata URLs at the wrong server.

Related errors


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