{"record":{"id":"e83d8e1b6aa96cb3","repo":"nopSolutions/nopCommerce","slug":"a-theme-descriptor-descriptionfile-has-no-syst","errorCode":null,"errorMessage":"A theme descriptor '{descriptionFile}' has no system name","messagePattern":"A theme descriptor '(.+?)' has no system name","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Libraries/Nop.Services/Themes/ThemeProvider.cs","lineNumber":46,"sourceCode":"\n        var fileProvider = CommonHelper.DefaultFileProvider;\n\n        //load all theme descriptors\n        _themeDescriptors = new Dictionary<string, ThemeDescriptor>(StringComparer.InvariantCultureIgnoreCase);\n\n        var themeDirectoryPath = fileProvider.MapPath(NopThemeDefaults.ThemesPath);\n        foreach (var descriptionFile in fileProvider.GetFiles(themeDirectoryPath, NopThemeDefaults.ThemeDescriptionFileName, false))\n        {\n            var text = await fileProvider.ReadAllTextAsync(descriptionFile, Encoding.UTF8);\n            if (string.IsNullOrEmpty(text))\n                continue;\n\n            //get theme descriptor\n            var themeDescriptor = GetThemeDescriptorFromText(text);\n\n            //some validation\n            if (string.IsNullOrEmpty(themeDescriptor?.SystemName))\n                throw new Exception($\"A theme descriptor '{descriptionFile}' has no system name\");\n\n            _themeDescriptors.TryAdd(themeDescriptor.SystemName, themeDescriptor);\n        }\n    }\n\n    /// <summary>\n    /// Get theme descriptor from the description text\n    /// </summary>\n    /// <param name=\"text\">Description text</param>\n    /// <returns>Theme descriptor</returns>\n    public ThemeDescriptor GetThemeDescriptorFromText(string text)\n    {\n        //get theme description from the JSON file\n        var themeDescriptor = JsonConvert.DeserializeObject<ThemeDescriptor>(text);\n\n        //some validation\n        if (_themeDescriptors.ContainsKey(themeDescriptor.SystemName))\n            throw new Exception($\"A theme with '{themeDescriptor.SystemName}' system name is already defined\");","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Libraries/Nop.Services/Themes/ThemeProvider.cs#L28-L64","documentation":"Thrown by ThemeProvider while scanning theme description files: for each themeDescription.json file under the themes directory it parses the descriptor and throws if themeDescriptor.SystemName is null/empty. Parsing a JSON file that omits or blanks the 'SystemName' field triggers it.","triggerScenarios":"A theme folder under wwwroot/themes (or the configured themes path) contains a themeDescription.json whose SystemName property is missing, empty, or whitespace. Thrown during theme initialization at app startup or first theme enumeration.","commonSituations":"Copying a theme folder and forgetting to set a unique SystemName; hand-editing themeDescription.json and dropping the field; a theme package with a malformed descriptor.","solutions":["Open the offending file at the path in the error message and add a non-empty unique SystemName.","Ensure SystemName is unique across all themes (see error 168).","Remove the half-installed theme folder if it is not meant to be used."],"exampleFix":"// before (themeDescription.json)\n{ \"FriendlyName\": \"My Theme\" }\n// after\n{ \"SystemName\": \"MyTheme\", \"FriendlyName\": \"My Theme\" }","handlingStrategy":"validation","validationCode":"var desc = JsonConvert.DeserializeObject<ThemeDescriptor>(text);\nif (string.IsNullOrWhiteSpace(desc?.SystemName))\n    // skip/fix this file rather than letting ThemeProvider throw at startup","typeGuard":"static bool HasValidSystemName(string json)\n{\n    var d = JsonConvert.DeserializeObject<ThemeDescriptor>(json);\n    return !string.IsNullOrWhiteSpace(d?.SystemName);\n}","tryCatchPattern":"try { await _themeProvider.InitializeAsync(); }\ncatch (Exception ex) when (ex.Message.Contains(\"no system name\"))\n{ logger.Error($\"Invalid theme descriptor: {ex.Message}\", ex); }","preventionTips":["Validate themeDescription.json before deploying a theme.","Keep a theme template with a required SystemName placeholder.","Run a startup theme validation in dev."],"tags":["themes","config","validation","json","startup"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}