nopSolutions/nopCommerce · error · ArgumentException
No product attribute combination found with the specified id
Error message
No product attribute combination found with the specified id
What it means
First stage of ProductAttributeCombinationDelete (POST): GetProductAttributeCombinationByIdAsync(id) returns null. The combination id must identify an existing ProductAttributeCombination row; otherwise the delete cannot proceed and the action throws ArgumentException before loading the owning product.
Source
Thrown at src/Presentation/Nop.Web/Areas/Admin/Controllers/ProductController.cs:3794
//a vendor should have access only to his products
var currentVendor = await _workContext.GetCurrentVendorAsync();
if (currentVendor != null && product.VendorId != currentVendor.Id)
return Content("This is not your product");
//prepare model
var model = await _productModelFactory.PrepareProductAttributeCombinationListModelAsync(searchModel, product);
return Json(model);
}
[HttpPost]
[CheckPermission(StandardPermission.Catalog.PRODUCTS_CREATE_EDIT_DELETE)]
public virtual async Task<IActionResult> ProductAttributeCombinationDelete(int id)
{
//try to get a combination with the specified id
var combination = await _productAttributeService.GetProductAttributeCombinationByIdAsync(id)
?? throw new ArgumentException("No product attribute combination found with the specified id");
//try to get a product with the specified id
var product = await _productService.GetProductByIdAsync(combination.ProductId)
?? throw new ArgumentException("No product found with the specified id");
//a vendor should have access only to his products
var currentVendor = await _workContext.GetCurrentVendorAsync();
if (currentVendor != null && product.VendorId != currentVendor.Id)
return Content("This is not your product");
await _productAttributeService.DeleteProductAttributeCombinationAsync(combination);
return new NullJsonResult();
}
[CheckPermission(StandardPermission.Catalog.PRODUCTS_CREATE_EDIT_DELETE)]
public virtual async Task<IActionResult> ProductAttributeCombinationCreatePopup(int productId)
{View on GitHub (pinned to 64bdf2ff08)
Solutions
- Refresh the combinations grid and confirm the row still exists before deleting.
- Guard against double-submission on the delete button (disable after first click).
- Avoid regenerating combinations concurrently with manual deletes.
- Verify the id from the request matches a current combination via a preflight lookup.
Example fix
// before
var combination = await _productAttributeService.GetProductAttributeCombinationByIdAsync(id)
?? throw new ArgumentException("No product attribute combination found with the specified id");
// after
var combination = await _productAttributeService.GetProductAttributeCombinationByIdAsync(id);
if (combination == null)
return new NullJsonResult(); // already gone - idempotent success Defensive patterns
Strategy: validation
Validate before calling
var combination = await _productAttributeService.GetProductAttributeCombinationByIdAsync(id); if (combination == null) return new NullJsonResult(); // idempotent
Type guard
// N/A
Try / catch
catch (ArgumentException ex) when (ex.Message.Contains("No product attribute combination"))
{ return new NullJsonResult(); } Prevention
- Make combination deletes idempotent (missing = success).
- Prevent double-click on the delete button.
- Refresh the combinations grid before deleting after a regeneration.
When it happens
Trigger: Posting a delete for an already-removed combination; double-click on the delete button where the first call succeeds; tampered grid row id; combination removed by an automatic regeneration of attribute combinations.
Common situations: User clicks delete twice; another admin regenerates combinations (GenerateAllAttributeCombinations) which clears prior ones; restored DB lacking the referenced row.
Related errors
- No return request reason found with the specified id
- No return request action found with the specified id
- No specification attribute option found with the specified i
- No tax category found with the specified id
- No vendor attribute value found with the specified id
AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13).
Data as JSON: /api/errors/00f54cdd447ca1f0.
Report an issue: GitHub.