nopSolutions/nopCommerce · error · Exception
Archive '{NopCommonDefaults.LocalePatternArchiveName}' to re
Error message
Archive '{NopCommonDefaults.LocalePatternArchiveName}' to retrieve localization patterns not found. What it means
Thrown by UploadService when initializing localization patterns: it builds zipLocalePatternPath from NopCommonDefaults.LocalePatternPath + LocalePatternArchiveName and throws if _fileProvider.GetFileExtension of that PATH string is not '.zip'. The message says 'not found' but the actual guard is an extension check on the configured archive name/path, not a real FileExists call.
Source
Thrown at src/Libraries/Nop.Services/Plugins/UploadService.cs:438
public virtual Task UploadLocalePatternAsync(CultureInfo cultureInfo = null)
{
string getPath(string dirPath, string dirName)
{
return _fileProvider.GetAbsolutePath(string.Format(dirPath, dirName));
}
bool checkDirectoryExists(string dirPath, string dirName)
{
return _fileProvider.DirectoryExists(getPath(dirPath, dirName));
}
var tempFolder = "temp";
try
{
//1. check if the archive with localization of templates is in its place
var zipLocalePatternPath = getPath(NopCommonDefaults.LocalePatternPath, NopCommonDefaults.LocalePatternArchiveName);
if (!_fileProvider.GetFileExtension(zipLocalePatternPath)?.Equals(".zip", StringComparison.InvariantCultureIgnoreCase) ?? true)
throw new Exception($"Archive '{NopCommonDefaults.LocalePatternArchiveName}' to retrieve localization patterns not found.");
var currentCulture = cultureInfo ?? CultureInfo.CurrentCulture;
//2. Check if there is already an unpacked folder with locales for the current culture in the lib directory, if not then
if (!(checkDirectoryExists(NopCommonDefaults.LocalePatternPath, currentCulture.Name) ||
checkDirectoryExists(NopCommonDefaults.LocalePatternPath, currentCulture.TwoLetterISOLanguageName)))
{
var cultureToUse = string.Empty;
//3. Unpack the archive into a temporary folder
ZipFile.ExtractToDirectory(zipLocalePatternPath, getPath(NopCommonDefaults.LocalePatternPath, tempFolder));
//4. Search in the temp unpacked archive a folder with locales by culture
var sourceLocalePath = _fileProvider.Combine(getPath(NopCommonDefaults.LocalePatternPath, tempFolder), currentCulture.Name);
if (_fileProvider.DirectoryExists(sourceLocalePath))
cultureToUse = currentCulture.Name;
var sourceLocaleISOPath = _fileProvider.Combine(getPath(NopCommonDefaults.LocalePatternPath, tempFolder), currentCulture.TwoLetterISOLanguageName);View on GitHub (pinned to 64bdf2ff08)
Solutions
- Ensure the locale pattern archive file named by NopCommonDefaults.LocalePatternArchiveName exists in NopCommonDefaults.LocalePatternPath and ends in '.zip'.
- If you intentionally changed the archive format, update the default constant to keep the '.zip' extension.
- Redeploy the missing archive from a clean nopCommerce distribution package.
Example fix
// before: archive name lacks .zip public const string LocalePatternArchiveName = "locale_patterns"; // after: public const string LocalePatternArchiveName = "locale_patterns.zip";
Defensive patterns
Strategy: validation
Validate before calling
var archivePath = Path.Combine(NopCommonDefaults.LocalePatternPath, NopCommonDefaults.LocalePatternArchiveName);
if (!string.Equals(Path.GetExtension(archivePath), ".zip", StringComparison.OrdinalIgnoreCase)
|| !_fileProvider.FileExists(archivePath))
// deploy/fix archive before invoking localization init Type guard
static bool LocaleArchiveReady(INopFileProvider fp)
{
var p = Path.Combine(NopCommonDefaults.LocalePatternPath, NopCommonDefaults.LocalePatternArchiveName);
return string.Equals(Path.GetExtension(p), ".zip", StringComparison.OrdinalIgnoreCase) && fp.FileExists(p);
} Try / catch
try { await uploadService.EnsureLocalePatternsAsync(culture); }
catch (Exception ex) when (ex.Message.Contains("LocalePatternArchiveName"))
{ logger.Error("Locale pattern archive missing/invalid: " + ex.Message); } Prevention
- Keep LocalePatternArchiveName ending in .zip in defaults.
- Deploy the locale archive as part of CI.
- Add a FileExists check, which the current guard omits.
When it happens
Trigger: The LocalePatternArchiveName default no longer ends in '.zip' (e.g. changed to .nupkg), the path is misconfigured, or the archive file is missing AND the configured name lacks a .zip extension. Reachable during a culture/locale initialization path that unpacks locale templates.
Common situations: A custom build strips or renames the locale pattern archive; an upgrade changes NopCommonDefaults.LocalePatternArchiveName; the file was never deployed to wwwroot/lib.
Related errors
- Only zip archives are supported (*.zip)
- Only icons are supported (*.ico)
- Plugins.ExchangeRate.EcbExchange.Error
- Facebook authentication module cannot be loaded
- Facebook authentication module not configured
AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13).
Data as JSON: /api/errors/75f21c5e81432ba0.
Report an issue: GitHub.