{"record":{"id":"5d04710a8bfee354","repo":"chocolatey/choco","slug":"no-configuration-value-by-the-name-0","errorCode":null,"errorMessage":"No configuration value by the name '{0}'","messagePattern":"No configuration value by the name '(.+?)'","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"src/chocolatey/infrastructure.app/services/ChocolateyConfigSettingsService.cs","lineNumber":508,"sourceCode":"                else\r\n                {\r\n                    if (!configuration.RegularOutput && configuration.IncludeHeaders && !hasHeaderRowBeenOutput)\r\n                    {\r\n                        OutputHelpers.LimitedOutput(\"Name\", \"Value\", \"Description\");\r\n                        hasHeaderRowBeenOutput = true;\r\n                    }\r\n\r\n                    OutputHelpers.LimitedOutput(config.Key, config.Value, config.Description);\r\n                }\r\n            }\r\n        }\r\n\r\n        public void GetConfig(ChocolateyConfiguration configuration)\r\n        {\r\n            var config = GetConfigValue(configuration.ConfigCommand.Name);\r\n            if (config == null)\r\n            {\r\n                throw new ApplicationException(\"No configuration value by the name '{0}'\".FormatWith(configuration.ConfigCommand.Name));\r\n            }\r\n\r\n            this.Log().Info(\"{0}\".FormatWith(config.Value));\r\n        }\r\n\r\n        public ConfigFileConfigSetting GetConfigValue(string configKeyName)\r\n        {\r\n            var config = ConfigFileSettings.ConfigSettings.FirstOrDefault(p => p.Key.IsEqualTo(configKeyName));\r\n            if (config == null)\r\n            {\r\n                return null;\r\n            }\r\n\r\n            return config;\r\n        }\r\n\r\n        public void SetConfig(ChocolateyConfiguration configuration)\r\n        {\r","sourceCodeStart":490,"sourceCodeEnd":526,"githubUrl":"https://github.com/chocolatey/choco/blob/0d5abdd10cc177a141e69547cad6935b419b6c17/src/chocolatey/infrastructure.app/services/ChocolateyConfigSettingsService.cs#L490-L526","documentation":"Thrown by ChocolateyConfigSettingsService.GetConfig when the config key name in configuration.ConfigCommand.Name does not match any ConfigFileConfigSetting in ConfigFileSettings.ConfigSettings (case-insensitive via IsEqualTo). This occurs during 'choco config get --name=<x>' when <x> is not a known configuration key. Unlike features (which are boolean toggles), config settings are key-value pairs like cacheLocation or commandExecutionTimeoutSeconds.","triggerScenarios":"Running 'choco config get --name=nonexistent'. Typo in the config key name. The setting was removed or renamed in a newer Chocolatey version. User confuses a feature name with a config setting name. Config file was manually edited and settings were deleted.","commonSituations":"User mixes up 'feature' names (boolean toggles) with 'config' names (key-value settings). Outdated documentation references a renamed setting. Misspelling the long config key name. Fresh install where the setting hasn't been registered yet.","solutions":["Run 'choco config list' to see all available config keys and their current values","Use the exact key name from the list output","Check whether the setting is a 'feature' (use 'choco feature') vs a 'config' (use 'choco config')","Consult current documentation for renamed settings"],"exampleFix":"// before\nchoco config get --name=cache\n\n// after (correct key name)\nchoco config get --name=cacheLocation\n// discover names:\nchoco config list","handlingStrategy":"validation","validationCode":"// Validate config key exists before calling GetConfig\nvar knownKeys = configFileSettings.ConfigSettings.Select(c => c.Key).ToList();\nif (!knownKeys.Any(k => k.Equals(keyName, StringComparison.OrdinalIgnoreCase)))\n{\n    Console.Error.WriteLine($\"Config '{keyName}' not found. Available: {string.Join(\", \", knownKeys)}\");\n    return;\n}","typeGuard":"public static bool ConfigKeyExists(ConfigFileSettings settings, string keyName)\n{\n    return settings.ConfigSettings.Any(c => c.Key.Equals(keyName, StringComparison.OrdinalIgnoreCase));\n}","tryCatchPattern":"try\n{\n    configService.GetConfig(configuration);\n}\ncatch (ApplicationException ex) when (ex.Message.Contains(\"No configuration value\"))\n{\n    logger.Error($\"Config key '{configuration.ConfigCommand.Name}' not found. Run 'choco config list'.\");\n}","preventionTips":["Run 'choco config list' to see all available config keys and values","Remember config settings (key-value) differ from features (boolean toggles)","Copy exact key names from the list output","Check whether a setting belongs to 'config' or 'feature' before querying"],"tags":["config","config-settings","not-found","command-args"],"backgroundTag":null,"analyzedSha":"0d5abdd10cc177a141e69547cad6935b419b6c17","analyzedAt":"2026-08-13T18:33:03.301Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}