hashicorp/nomad · error

variable quota lookup failed

Error message

variable quota lookup failed: %v

What it means

While writing a variable, reading the namespace's variables quota entry from memdb failed; the wrapped quota lookup error prevents enforcing the storage quota and aborts the set.

Solutions

  1. Retry the variable write
  2. Inspect server logs for state store errors
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at nomad/state/state_store_variables.go:210 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/139f0a0836273d1b. Report an issue: GitHub.

Appendix: source

Thrown at nomad/state/state_store_variables.go:210

	// If we made it this far, we should perform the set.
	return s.varSetTxn(tx, idx, req)
}

// varSetTxn is used to insert or update a variable in the state
// store. It is the inner method used and handles only the actual storage.
func (s *StateStore) varSetTxn(tx WriteTxn, idx uint64, req *structs.VarApplyStateRequest) *structs.VarApplyStateResponse {
	sv := req.Var
	existingRaw, err := tx.First(TableVariables, indexID, sv.Namespace, sv.Path)
	if err != nil {
		return req.ErrorResponse(idx, fmt.Errorf("failed sve lookup: %s", err))
	}

	existing, _ := existingRaw.(*structs.VariableEncrypted)

	existingQuota, err := tx.First(TableVariablesQuotas, indexID, sv.Namespace)
	if err != nil {
		return req.ErrorResponse(idx, fmt.Errorf("variable quota lookup failed: %v", err))
	}

	var quotaChange int64
	// Set the CreateIndex and CreateTime
	if existing != nil {

		// If the variable is locked, it can only be updated by providing the correct
		// lock ID.
		if isLocked(existing.Lock, req) {
			zeroVal := &structs.VariableEncrypted{
				VariableMetadata: structs.VariableMetadata{
					Namespace: sv.Namespace,
					Path:      sv.Path,
				},
			}
			return req.ConflictResponse(idx, zeroVal)
		}

View on GitHub (pinned to 482b49bf1a)