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.

Solutions

  1. Refresh the combinations grid and confirm the row still exists before deleting.
  2. Guard against double-submission on the delete button (disable after first click).
  3. Avoid regenerating combinations concurrently with manual deletes.
  4. 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

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


AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13). Data as JSON: /api/errors/00f54cdd447ca1f0. Report an issue: GitHub.

Appendix: 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)