hashicorp/nomad · warning

empty AZ Environment value

Error message

empty AZ Environment value

What it means

The Azure environment fingerprint queries the Azure Instance Metadata Service for the compute/azEnvironment value to confirm the node runs in Azure and record which environment (e.g. AzurePublicCloud). azureProbe rejects the value when it is missing or only whitespace, since a valid Azure node always reports an AZ environment string.

Source

Thrown at client/fingerprint/env_azure.go:230

	}

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

	response.Detected = true
	return nil
}

func (f *EnvAzureFingerprint) azureProbe() error {
	v, err := f.Get("compute/azEnvironment", "text")
	if err != nil {
		return err
	}

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

	return nil
}

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

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Verify the metadata endpoint returns a non-empty azEnvironment (curl the IMDS and inspect compute/azEnvironment)
  2. If the host is not Azure, disable the env_azure fingerprint in client config
  3. Check the configured metadata base URL/headers match your environment (Azure Stack may need a custom endpoint)
  4. Upgrade Nomad if your cloud returns a new environment name the old fingerprint does not handle

Example fix

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

Strategy: validation

Validate before calling

// Pre-check before relying on Azure attributes
resp, _ := http.Get("http://169.254.169.254/metadata/instance/compute/azEnvironment?api-version=2021-02-01&format=text")
body, _ := io.ReadAll(resp.Body)
if strings.TrimSpace(string(body)) == "" {
    // missing azEnvironment: disable env_azure 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 Azure IMDS responded but the compute/azEnvironment field was absent, empty, or whitespace-only — e.g. non-Azure hosts with something listening on the metadata address, or partial metadata responses.

Common situations: Hybrid environments where a metadata proxy or wrong URL returns JSON without the azEnvironment key, Azure Stack / sovereign clouds with unusual environment names, or connectivity issues truncating responses.

Related errors


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