nopSolutions/nopCommerce · warning · ArgumentException
No checkout attribute value found with the specified id
Error message
No checkout attribute value found with the specified id
What it means
Thrown by CheckoutAttributeController.ValueDelete (permission: CHECKOUT_ATTRIBUTES_CREATE_EDIT_DELETE). It fetches the checkout attribute value by id and throws ArgumentException if missing — the value was already deleted or the id is invalid.
Source
Thrown at src/Presentation/Nop.Web/Areas/Admin/Controllers/CheckoutAttributeController.cs:486
ViewBag.RefreshPage = true;
return View(model);
}
//prepare model
model = await _checkoutAttributeModelFactory.PrepareCheckoutAttributeValueModelAsync(model, checkoutAttribute, checkoutAttributeValue, true);
//if we got this far, something failed, redisplay form
return View(model);
}
[HttpPost]
[CheckPermission(StandardPermission.Catalog.CHECKOUT_ATTRIBUTES_CREATE_EDIT_DELETE)]
public virtual async Task<IActionResult> ValueDelete(int id)
{
//try to get a checkout attribute value with the specified id
var checkoutAttributeValue = await _checkoutAttributeService.GetAttributeValueByIdAsync(id)
?? throw new ArgumentException("No checkout attribute value found with the specified id", nameof(id));
await _checkoutAttributeService.DeleteAttributeValueAsync(checkoutAttributeValue);
return new NullJsonResult();
}
#endregion
}View on GitHub (pinned to 64bdf2ff08)
Solutions
- Refresh the value grid and delete only rows that still appear.
- Make ValueDelete idempotent (return success when the row is already gone).
- Disable the delete control after first click and handle missing-row responses.
Example fix
// before
var checkoutAttributeValue = await _checkoutAttributeService.GetAttributeValueByIdAsync(id)
?? throw new ArgumentException("No checkout attribute value found with the specified id", nameof(id));
// after
var checkoutAttributeValue = await _checkoutAttributeService.GetAttributeValueByIdAsync(id);
if (checkoutAttributeValue == null)
return new NullJsonResult();
Defensive patterns
Strategy: fallback
Validate before calling
// Idempotent checkout attribute value delete. var value = await _checkoutAttributeService.GetAttributeValueByIdAsync(id); if (value == null) return new NullJsonResult();
Type guard
static bool CheckoutAttributeValueExists(CheckoutAttributeValue v) => v is not null;
Try / catch
try { /* ValueDelete body */ }
catch (ArgumentException ex) when (ex.ParamName == nameof(id))
{
return new NullJsonResult();
} Prevention
- Refresh the value grid before deleting.
- Make deletes idempotent.
- Disable the delete control after first click.
When it happens
Trigger: POST ValueDelete with an id absent from the DB — double delete, stale grid, or another admin removed the value first.
Common situations: Re-clicking delete on an already-removed value; concurrent edits to checkout attribute values; retention cleanup removing the row.
Related errors
- No activity log found with the specified id
- No address attribute value found with the specified id
- No comment found with the specified id
- No product category mapping found with the specified id
- No checkout attribute found with the specified id
AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13).
Data as JSON: /api/errors/83dc2f49c089e612.
Report an issue: GitHub.