{"record":{"id":"139f0a0836273d1b","repo":"hashicorp/nomad","slug":"variable-quota-lookup-failed-v","errorCode":null,"errorMessage":"variable quota lookup failed: %v","messagePattern":"variable quota lookup failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store_variables.go","lineNumber":210,"sourceCode":"\n\t// If we made it this far, we should perform the set.\n\treturn s.varSetTxn(tx, idx, req)\n}\n\n// varSetTxn is used to insert or update a variable in the state\n// store. It is the inner method used and handles only the actual storage.\nfunc (s *StateStore) varSetTxn(tx WriteTxn, idx uint64, req *structs.VarApplyStateRequest) *structs.VarApplyStateResponse {\n\tsv := req.Var\n\texistingRaw, err := tx.First(TableVariables, indexID, sv.Namespace, sv.Path)\n\tif err != nil {\n\t\treturn req.ErrorResponse(idx, fmt.Errorf(\"failed sve lookup: %s\", err))\n\t}\n\n\texisting, _ := existingRaw.(*structs.VariableEncrypted)\n\n\texistingQuota, err := tx.First(TableVariablesQuotas, indexID, sv.Namespace)\n\tif err != nil {\n\t\treturn req.ErrorResponse(idx, fmt.Errorf(\"variable quota lookup failed: %v\", err))\n\t}\n\n\tvar quotaChange int64\n\t// Set the CreateIndex and CreateTime\n\tif existing != nil {\n\n\t\t// If the variable is locked, it can only be updated by providing the correct\n\t\t// lock ID.\n\t\tif isLocked(existing.Lock, req) {\n\t\t\tzeroVal := &structs.VariableEncrypted{\n\t\t\t\tVariableMetadata: structs.VariableMetadata{\n\t\t\t\t\tNamespace: sv.Namespace,\n\t\t\t\t\tPath:      sv.Path,\n\t\t\t\t},\n\t\t\t}\n\t\t\treturn req.ConflictResponse(idx, zeroVal)\n\t\t}\n","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store_variables.go#L192-L228","documentation":"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.","triggerScenarios":"Thrown at nomad/state/state_store_variables.go:210 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the variable write","Inspect server logs for state store errors"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}