{"record":{"id":"fed5ee6bfed81b00","repo":"nopSolutions/nopCommerce","slug":"admin-catalog-products-import-manufacturersdontexi","errorCode":null,"errorMessage":"Admin.Catalog.Products.Import.ManufacturersDontExist","messagePattern":"Admin\\.Catalog\\.Products\\.Import\\.ManufacturersDontExist","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Libraries/Nop.Services/ExportImport/ImportManager.cs","lineNumber":1437,"sourceCode":"                if (!string.IsNullOrEmpty(requiredProductIds))\r\n                    requiredProductsData.TryAdd(sku, requiredProductIds);\r\n            }\r\n\r\n            //counting the number of products\r\n            productsInFile.Add(endRow);\r\n\r\n            endRow++;\r\n        }\r\n\r\n        //performance optimization, the check for the existence of the categories in one SQL request\r\n        var notExistingCategories = await _categoryService.GetNotExistingCategoriesAsync(allCategories.ToArray());\r\n        if (notExistingCategories.Any())\r\n            throw new ArgumentException(string.Format(await _localizationService.GetResourceAsync(\"Admin.Catalog.Products.Import.CategoriesDontExist\"), string.Join(\", \", notExistingCategories)));\r\n\r\n        //performance optimization, the check for the existence of the manufacturers in one SQL request\r\n        var notExistingManufacturers = await _manufacturerService.GetNotExistingManufacturersAsync(allManufacturers.ToArray());\r\n        if (notExistingManufacturers.Any())\r\n            throw new ArgumentException(string.Format(await _localizationService.GetResourceAsync(\"Admin.Catalog.Products.Import.ManufacturersDontExist\"), string.Join(\", \", notExistingManufacturers)));\r\n\r\n        //performance optimization, the check for the existence of the product attributes in one SQL request\r\n        var notExistingProductAttributes = await _productAttributeService.GetNotExistingAttributesAsync(allAttributeIds.ToArray());\r\n        if (notExistingProductAttributes.Any())\r\n            throw new ArgumentException(string.Format(await _localizationService.GetResourceAsync(\"Admin.Catalog.Products.Import.ProductAttributesDontExist\"), string.Join(\", \", notExistingProductAttributes)));\r\n\r\n        //performance optimization, the check for the existence of the specification attribute options in one SQL request\r\n        var notExistingSpecificationAttributeOptions = await _specificationAttributeService.GetNotExistingSpecificationAttributeOptionsAsync(allSpecificationAttributeOptionIds.Where(saoId => saoId != 0).ToArray());\r\n        if (notExistingSpecificationAttributeOptions.Any())\r\n            throw new ArgumentException($\"The following specification attribute option ID(s) don't exist - {string.Join(\", \", notExistingSpecificationAttributeOptions)}\");\r\n\r\n        //performance optimization, the check for the existence of the stores in one SQL request\r\n        var notExistingStores = await _storeService.GetNotExistingStoresAsync(allStores.ToArray());\r\n        if (notExistingStores.Any())\r\n            throw new ArgumentException(string.Format(await _localizationService.GetResourceAsync(\"Admin.Catalog.Products.Import.StoresDontExist\"), string.Join(\", \", notExistingStores)));\r\n\r\n        return new ImportProductMetadata\r\n        {\r","sourceCodeStart":1419,"sourceCodeEnd":1455,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Libraries/Nop.Services/ExportImport/ImportManager.cs#L1419-L1455","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Create the missing manufacturers in Catalog > Manufacturers using the exact names from the error, then re-run the import.","Export current manufacturers and diff against the spreadsheet to catch typos/whitespace/casing.","Remove or fix the manufacturer cells for rows referencing non-existent manufacturers.","If a semicolon-delimited multi-manufacturer cell is used, ensure every entry in the list exists."],"exampleFix":"// before\nawait _importManager.ImportProductsFromXlsxAsync(stream);\n\n// after — verify manufacturers exist first\nvar existingMfrs = (await _manufacturerService.GetAllManufacturersAsync(showHidden: true)).Select(m => m.Name).ToHashSet(StringComparer.OrdinalIgnoreCase);\nvar missingMfrs = spreadsheetManufacturers.Where(n => !existingMfrs.Contains(n.Trim())).ToList();\nif (missingMfrs.Any())\n    return BadRequest($\"Create these manufacturers first: {string.Join(\", \", missingMfrs)}\");\nawait _importManager.ImportProductsFromXlsxAsync(stream);","handlingStrategy":"validation","validationCode":"// Pre-validate that every manufacturer name in the import file exists\nvar existing = (await _manufacturerService.GetAllManufacturersAsync(showHidden: true))\n    .Select(m => m.Name.Trim()).ToHashSet(StringComparer.OrdinalIgnoreCase);\nvar missing = importManufacturerNames.Where(n => !existing.Contains(n.Trim())).ToList();\nif (missing.Any())\n    return BadRequest($\"Create these manufacturers first: {string.Join(\", \", missing)}\");\nawait _importManager.ImportProductsFromXlsxAsync(stream);","typeGuard":null,"tryCatchPattern":"try { await _importManager.ImportProductsFromXlsxAsync(stream); }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"ManufacturersDontExist\") || ex.Message.Contains(\"manufacturer\"))\n{ /* surface the missing manufacturer names to the user */ }","preventionTips":["Create manufacturers before importing products that reference them.","Reconcile manufacturer names (case/whitespace) between export and import.","When a cell holds multiple manufacturers, ensure every entry exists."],"tags":["import","catalog","manufacturers","nopcommerce"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}