{"record":{"id":"e8f886b71f991874","repo":"nopSolutions/nopCommerce","slug":"no-address-attribute-value-found-with-the-specifie","errorCode":null,"errorMessage":"No address attribute value found with the specified id","messagePattern":"No address attribute value found with the specified id","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"warning","filePath":"src/Presentation/Nop.Web/Areas/Admin/Controllers/AddressAttributeController.cs","lineNumber":351,"sourceCode":"            ViewBag.RefreshPage = true;\n\n            return View(model);\n        }\n\n        //prepare model\n        model = await _addressAttributeModelFactory.PrepareAddressAttributeValueModelAsync(model, addressAttribute, addressAttributeValue, true);\n\n        //if we got this far, something failed, redisplay form\n        return View(model);\n    }\n\n    [HttpPost]\n    [CheckPermission(StandardPermission.Configuration.MANAGE_SETTINGS)]\n    public virtual async Task<IActionResult> ValueDelete(int id)\n    {\n        //try to get an address attribute value with the specified id\n        var addressAttributeValue = await _addressAttributeService.GetAttributeValueByIdAsync(id)\n            ?? throw new ArgumentException(\"No address attribute value found with the specified id\", nameof(id));\n\n        await _addressAttributeService.DeleteAttributeValueAsync(addressAttributeValue);\n\n        //activity log\n        await _customerActivityService.InsertActivityAsync(\"DeleteAddressAttributeValue\",\n            string.Format(await _localizationService.GetResourceAsync(\"ActivityLog.DeleteAddressAttributeValue\"), addressAttributeValue.Id),\n            addressAttributeValue);\n\n        return new NullJsonResult();\n    }\n\n    #endregion\n}","sourceCodeStart":333,"sourceCodeEnd":364,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Presentation/Nop.Web/Areas/Admin/Controllers/AddressAttributeController.cs#L333-L364","documentation":"Thrown by AddressAttributeController.ValueDelete (permission: MANAGE_SETTINGS). It fetches the address attribute value by id and throws ArgumentException if missing — the value was already deleted or the id is invalid.","triggerScenarios":"POST ValueDelete with an id absent from the DB: double-click, stale grid after a prior delete, or a value removed by another admin.","commonSituations":"Concurrent edits to address attribute values; rapid repeated clicks on the delete action; retention cleanup removing the value between grid load and delete.","solutions":["Refresh the value grid and only delete rows that still appear.","Make ValueDelete idempotent (no-op + success when the row is gone).","On the client, disable the delete button after first click and handle missing-row responses gracefully."],"exampleFix":"// before\nvar addressAttributeValue = await _addressAttributeService.GetAttributeValueByIdAsync(id)\n    ?? throw new ArgumentException(\"No address attribute value found with the specified id\", nameof(id));\n\n// after\nvar addressAttributeValue = await _addressAttributeService.GetAttributeValueByIdAsync(id);\nif (addressAttributeValue == null)\n    return new NullJsonResult();\n","handlingStrategy":"fallback","validationCode":"// Idempotent value delete.\nvar value = await _addressAttributeService.GetAttributeValueByIdAsync(id);\nif (value == null) return new NullJsonResult();","typeGuard":"static bool AttributeValueExists(AddressAttributeValue v) => v is not null;","tryCatchPattern":"try { /* ValueDelete body */ }\ncatch (ArgumentException ex) when (ex.ParamName == nameof(id))\n{\n    return new NullJsonResult();\n}","preventionTips":["Refresh the value grid before deleting.","Make deletes idempotent.","Disable the delete control after first click."],"tags":["nopcommerce","admin","address-attribute","not-found","concurrency"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}