{"record":{"id":"604b6bea3cacac60","repo":"hashicorp/nomad","slug":"acl-auth-method-not-found","errorCode":null,"errorMessage":"ACL auth method not found","messagePattern":"ACL auth method not found","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store_acl_sso.go","lineNumber":146,"sourceCode":"\n\t// Update the index table to indicate an update has occurred.\n\tif err := txn.Insert(tableIndex, &IndexEntry{TableACLAuthMethods, index}); err != nil {\n\t\treturn fmt.Errorf(\"index update failed: %v\", err)\n\t}\n\n\treturn txn.Commit()\n}\n\n// deleteACLAuthMethodTxn deletes a single ACL method name from the state store\n// using the provided write transaction. It is the responsibility of the caller\n// to update the index table.\nfunc (s *StateStore) deleteACLAuthMethodTxn(txn *txn, methodName string) error {\n\texisting, err := txn.First(TableACLAuthMethods, indexID, methodName)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"ACL auth method lookup failed: %v\", err)\n\t}\n\tif existing == nil {\n\t\treturn errors.New(\"ACL auth method not found\")\n\t}\n\n\t// Delete the existing entry from the table.\n\tif err := txn.Delete(TableACLAuthMethods, existing); err != nil {\n\t\treturn fmt.Errorf(\"ACL auth method deletion failed: %v\", err)\n\t}\n\treturn nil\n}\n\n// GetACLAuthMethods returns an iterator that contains all ACL auth methods\n// stored within state.\nfunc (s *StateStore) GetACLAuthMethods(ws memdb.WatchSet) (memdb.ResultIterator, error) {\n\ttxn := s.db.ReadTxn()\n\n\t// Walk the entire table to get all ACL auth methods.\n\titer, err := txn.Get(TableACLAuthMethods, indexID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ACL auth method lookup failed: %v\", err)","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store_acl_sso.go#L128-L164","documentation":"deleteACLAuthMethodTxn looks up an ACL auth method by name in the acl_auth_methods table before deletion. If no record matches, it returns \"ACL auth method not found\", aborting the delete so callers get an explicit error instead of a silent no-op. It backs the DeleteACLAuthMethods bulk path and the ACLAuthMethod.Delete RPC.","triggerScenarios":"ACLAuthMethod.Delete RPC (nomad acl auth-method delete <name>) with a method name that is not in the state store; duplicate concurrent deletes; deleting on the wrong cluster/region.","commonSituations":"Terraform or scripts tearing down SSO config that was already removed; name typo (auth methods are keyed by name, not UUID); environment drift between staging and production.","solutions":["Verify the method name with nomad acl auth-method list.","Handle the error as success if your desired state is 'method removed'.","Ensure the delete targets the same cluster where the auth method was created."],"exampleFix":"// before\nclient.ACLAuthMethods().Delete(\"oidc\", nil)\n// after: tolerate already-deleted\nif err := client.ACLAuthMethods().Delete(\"oidc\", nil); err != nil && !strings.Contains(err.Error(), \"not found\") {\n    return err\n}","handlingStrategy":"try-catch","validationCode":"_, _, err := client.ACLAuthMethods().Get(methodName, nil)\nif err != nil {\n    return nil // method already removed\n}","typeGuard":null,"tryCatchPattern":"err := client.ACLAuthMethods().Delete(methodName, nil)\nif err != nil && strings.Contains(err.Error(), \"ACL auth method not found\") {\n    return nil // already deleted\n}","preventionTips":["Auth methods are name-keyed: keep names in a single source of truth for IaC.","Run `nomad acl auth-method list` before manual deletes.","Environment-separate configs to avoid cross-env name mistakes."],"tags":["nomad","acl","sso","delete-not-found"],"backgroundTag":"resource-not-found","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"}