hashicorp/nomad · error

variables can store a maximum of %d bytes of encrypted data

Error message

variables can store a maximum of %d bytes of encrypted data per namespace

What it means

Writing the variable would push the namespace's total encrypted variable storage past the configured quota (or overflow the size counter); varSetTxn enforces a per-namespace byte limit on encrypted variable data.

Source

Thrown at nomad/state/state_store_variables.go:268

	}

	// Track quota usage
	var quotaUsed *structs.VariablesQuota
	if existingQuota != nil {
		quotaUsed = existingQuota.(*structs.VariablesQuota)
		quotaUsed = quotaUsed.Copy()
	} else {
		quotaUsed = &structs.VariablesQuota{
			Namespace:   sv.Namespace,
			CreateIndex: idx,
		}
	}

	if quotaChange > math.MaxInt64-quotaUsed.Size {
		// this limit is actually shared across all namespaces in the region's
		// quota (if there is one), but we need this check here to prevent
		// overflow as well
		return req.ErrorResponse(idx, fmt.Errorf("variables can store a maximum of %d bytes of encrypted data per namespace", math.MaxInt))
	}

	if quotaChange > 0 {
		quotaUsed.Size += quotaChange
	} else if quotaChange < 0 {
		quotaUsed.Size -= min(quotaUsed.Size, -quotaChange)
	}

	err = s.enforceVariablesQuota(idx, tx, sv.Namespace, quotaChange)
	if err != nil {
		return req.ErrorResponse(idx, err)
	}

	// we check enforcement above even if there's no change because another
	// namespace may have used up quota to make this no longer valid, but we
	// only update the table if this namespace has changed
	if quotaChange != 0 {
		quotaUsed.ModifyIndex = idx

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Reduce the size of variables in the namespace (delete or shrink entries)
  2. Raise the variables quota in the namespace/region configuration
  3. Split large data out of variables into an external store
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at nomad/state/state_store_variables.go:268 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/49f0dd1b9d09a331. Report an issue: GitHub.