hashicorp/nomad · info
Nomad Enterprise only endpoint
Error message
Nomad Enterprise only endpoint
What it means
This error is returned by LicenseGet in the Nomad HTTP API client when the server responds with HTTP 204 No Content. The license endpoint only exists in Nomad Enterprise; an OSS Nomad server answers with 204 to signal there is no license payload. The client converts that status into this explicit error instead of returning an empty license.
Source
Thrown at api/operator.go:399
return wm, nil
}
func (op *Operator) LicenseGet(q *QueryOptions) (*LicenseReply, *QueryMeta, error) {
req, err := op.c.newRequest("GET", "/v1/operator/license")
if err != nil {
return nil, nil, err
}
req.setQueryOptions(q)
var reply LicenseReply
rtt, resp, err := op.c.doRequest(req) //nolint:bodyclose
if err != nil {
return nil, nil, err
}
defer resp.Body.Close()
if resp.StatusCode == http.StatusNoContent {
return nil, nil, errors.New("Nomad Enterprise only endpoint")
}
if resp.StatusCode != http.StatusOK {
return nil, nil, newUnexpectedResponseError(
fromHTTPResponse(resp),
withExpectedStatuses([]int{http.StatusOK, http.StatusNoContent}),
)
}
err = json.NewDecoder(resp.Body).Decode(&reply)
if err != nil {
return nil, nil, err
}
qm := &QueryMeta{}
parseQueryMeta(resp, qm)
qm.RequestTime = rtt
View on GitHub (pinned to 482b49bf1a)
Solutions
- Only call LicenseGet against Nomad Enterprise agents (check build via Agent().Specialization or /v1/agent/self 'Build.Enterprise').
- Treat a 204/this error as 'no license' rather than a failure and skip license logic for OSS clusters.
- Check the error message for 'Nomad Enterprise only endpoint' and branch accordingly.
- Upgrade to Nomad Enterprise if you actually need license visibility.
Example fix
// before
lic, _, err := operator.LicenseGet(nil)
if err != nil { return err }
// after
lic, _, err := operator.LicenseGet(nil)
if err != nil {
if strings.Contains(err.Error(), "Nomad Enterprise only endpoint") {
return nil // OSS cluster: no license to fetch
}
return err
} Defensive patterns
Strategy: try-catch
Validate before calling
var spec string
agentSelf, _, _ := client.Agent().Self()
if m, ok := agentSelf.Config["Enterprise"]; ok { spec, _ = m.(string) }
canQueryLicense := spec != "" // non-empty on Enterprise builds Type guard
func isEnterpriseOnlyEndpointErr(err error) bool {
return err != nil && strings.Contains(err.Error(), "Nomad Enterprise only endpoint")
} Try / catch
lic, _, err := operator.LicenseGet(nil)
if err != nil {
if isEnterpriseOnlyEndpointErr(err) {
return nil // OSS cluster, skip license handling
}
return err
} Prevention
- Gate LicenseGet calls behind an Enterprise build check from /v1/agent/self.
- Treat 204/Nomad-Enterprise-only errors as 'no license' in monitoring code.
- Avoid blanket license checks in fleet-wide tooling that also manages OSS clusters.
When it happens
Trigger: Calling client.Operator().LicenseGet(q) against a Nomad OSS (open-source) agent, or any agent older/newer than the endpoint, which replies 204 instead of 200 with a license body.
Common situations: Scripts or dashboards that inspect cluster licensing run against a community-edition Nomad cluster; automated license-expiry checks deployed fleet-wide hit OSS agents; upgrading/downgrading between OSS and Enterprise builds.
Related errors
- Unknown log level
- failed querying self endpoint: %s
- failed joining: %s
- invalid digest format
- unsupported checksum format
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/aefefe917ce03b27.
Report an issue: GitHub.