chocolatey/choco · error · ApplicationException
No configuration value by the name '{0}'
Error message
No configuration value by the name '{0}' What it means
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.
Source
Thrown at src/chocolatey/infrastructure.app/services/ChocolateyConfigSettingsService.cs:508
else
{
if (!configuration.RegularOutput && configuration.IncludeHeaders && !hasHeaderRowBeenOutput)
{
OutputHelpers.LimitedOutput("Name", "Value", "Description");
hasHeaderRowBeenOutput = true;
}
OutputHelpers.LimitedOutput(config.Key, config.Value, config.Description);
}
}
}
public void GetConfig(ChocolateyConfiguration configuration)
{
var config = GetConfigValue(configuration.ConfigCommand.Name);
if (config == null)
{
throw new ApplicationException("No configuration value by the name '{0}'".FormatWith(configuration.ConfigCommand.Name));
}
this.Log().Info("{0}".FormatWith(config.Value));
}
public ConfigFileConfigSetting GetConfigValue(string configKeyName)
{
var config = ConfigFileSettings.ConfigSettings.FirstOrDefault(p => p.Key.IsEqualTo(configKeyName));
if (config == null)
{
return null;
}
return config;
}
public void SetConfig(ChocolateyConfiguration configuration)
{
View on GitHub (pinned to 0d5abdd10c)
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
Example fix
// before choco config get --name=cache // after (correct key name) choco config get --name=cacheLocation // discover names: choco config list
Defensive patterns
Strategy: validation
Validate before calling
// Validate config key exists before calling GetConfig
var knownKeys = configFileSettings.ConfigSettings.Select(c => c.Key).ToList();
if (!knownKeys.Any(k => k.Equals(keyName, StringComparison.OrdinalIgnoreCase)))
{
Console.Error.WriteLine($"Config '{keyName}' not found. Available: {string.Join(", ", knownKeys)}");
return;
} Type guard
public static bool ConfigKeyExists(ConfigFileSettings settings, string keyName)
{
return settings.ConfigSettings.Any(c => c.Key.Equals(keyName, StringComparison.OrdinalIgnoreCase));
} Try / catch
try
{
configService.GetConfig(configuration);
}
catch (ApplicationException ex) when (ex.Message.Contains("No configuration value"))
{
logger.Error($"Config key '{configuration.ConfigCommand.Name}' not found. Run 'choco config list'.");
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- No feature value by the name '{0}'
- Feature '{0}' not found
- A single config command must be listed. Please see the help
- When specifying the subcommand '{0}', you must also specify
- When specifying the subcommand '{0}', you must also specify
AI-assisted analysis of chocolatey/choco@0d5abdd10c (2026-08-13).
Data as JSON: /api/errors/5d04710a8bfee354.
Report an issue: GitHub.