nopSolutions/nopCommerce · error · ArgumentException

Admin.Catalog.Products.Import.ManufacturersDontExist

Error message

Admin.Catalog.Products.Import.ManufacturersDontExist

What it means

Thrown during product XLSX import when one or more manufacturer names referenced in the spreadsheet do not exist in the database. nopCommerce batches all referenced manufacturers into a single SQL existence check (GetNotExistingManufacturersAsync) and aborts the entire import with an ArgumentException if any are missing.

Source

Thrown at src/Libraries/Nop.Services/ExportImport/ImportManager.cs:1437

                if (!string.IsNullOrEmpty(requiredProductIds))
                    requiredProductsData.TryAdd(sku, requiredProductIds);
            }

            //counting the number of products
            productsInFile.Add(endRow);

            endRow++;
        }

        //performance optimization, the check for the existence of the categories in one SQL request
        var notExistingCategories = await _categoryService.GetNotExistingCategoriesAsync(allCategories.ToArray());
        if (notExistingCategories.Any())
            throw new ArgumentException(string.Format(await _localizationService.GetResourceAsync("Admin.Catalog.Products.Import.CategoriesDontExist"), string.Join(", ", notExistingCategories)));

        //performance optimization, the check for the existence of the manufacturers in one SQL request
        var notExistingManufacturers = await _manufacturerService.GetNotExistingManufacturersAsync(allManufacturers.ToArray());
        if (notExistingManufacturers.Any())
            throw new ArgumentException(string.Format(await _localizationService.GetResourceAsync("Admin.Catalog.Products.Import.ManufacturersDontExist"), string.Join(", ", notExistingManufacturers)));

        //performance optimization, the check for the existence of the product attributes in one SQL request
        var notExistingProductAttributes = await _productAttributeService.GetNotExistingAttributesAsync(allAttributeIds.ToArray());
        if (notExistingProductAttributes.Any())
            throw new ArgumentException(string.Format(await _localizationService.GetResourceAsync("Admin.Catalog.Products.Import.ProductAttributesDontExist"), string.Join(", ", notExistingProductAttributes)));

        //performance optimization, the check for the existence of the specification attribute options in one SQL request
        var notExistingSpecificationAttributeOptions = await _specificationAttributeService.GetNotExistingSpecificationAttributeOptionsAsync(allSpecificationAttributeOptionIds.Where(saoId => saoId != 0).ToArray());
        if (notExistingSpecificationAttributeOptions.Any())
            throw new ArgumentException($"The following specification attribute option ID(s) don't exist - {string.Join(", ", notExistingSpecificationAttributeOptions)}");

        //performance optimization, the check for the existence of the stores in one SQL request
        var notExistingStores = await _storeService.GetNotExistingStoresAsync(allStores.ToArray());
        if (notExistingStores.Any())
            throw new ArgumentException(string.Format(await _localizationService.GetResourceAsync("Admin.Catalog.Products.Import.StoresDontExist"), string.Join(", ", notExistingStores)));

        return new ImportProductMetadata
        {

View on GitHub (pinned to 64bdf2ff08)

Solutions

  1. Create the missing manufacturers in Catalog > Manufacturers using the exact names from the error, then re-run the import.
  2. Export current manufacturers and diff against the spreadsheet to catch typos/whitespace/casing.
  3. Remove or fix the manufacturer cells for rows referencing non-existent manufacturers.
  4. If a semicolon-delimited multi-manufacturer cell is used, ensure every entry in the list exists.

Example fix

// before
await _importManager.ImportProductsFromXlsxAsync(stream);

// after — verify manufacturers exist first
var existingMfrs = (await _manufacturerService.GetAllManufacturersAsync(showHidden: true)).Select(m => m.Name).ToHashSet(StringComparer.OrdinalIgnoreCase);
var missingMfrs = spreadsheetManufacturers.Where(n => !existingMfrs.Contains(n.Trim())).ToList();
if (missingMfrs.Any())
    return BadRequest($"Create these manufacturers first: {string.Join(", ", missingMfrs)}");
await _importManager.ImportProductsFromXlsxAsync(stream);
Defensive patterns

Strategy: validation

Validate before calling

// Pre-validate that every manufacturer name in the import file exists
var existing = (await _manufacturerService.GetAllManufacturersAsync(showHidden: true))
    .Select(m => m.Name.Trim()).ToHashSet(StringComparer.OrdinalIgnoreCase);
var missing = importManufacturerNames.Where(n => !existing.Contains(n.Trim())).ToList();
if (missing.Any())
    return BadRequest($"Create these manufacturers first: {string.Join(", ", missing)}");
await _importManager.ImportProductsFromXlsxAsync(stream);

Try / catch

try { await _importManager.ImportProductsFromXlsxAsync(stream); }
catch (ArgumentException ex) when (ex.Message.Contains("ManufacturersDontExist") || ex.Message.Contains("manufacturer"))
{ /* surface the missing manufacturer names to the user */ }

Prevention

When it happens

Trigger: Calling the product-import path with an XLSX whose Manufacturer column references manufacturer names not present in the DB. Fires after the worksheet scan and the category check, before ImportProductMetadata is returned.

Common situations: Spreadsheet exported from another store whose manufacturers were not migrated; typos or whitespace in manufacturer names; manufacturers were deleted/archived after the export; importing against a fresh catalog DB.

Related errors


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