puppetlabs/puppet · error · Puppet::Settings::ValidationError
Invalid value '%{value}' for boolean parameter: %{name}
Error message
Invalid value '%{value}' for boolean parameter: %{name} What it means
Puppet::Settings::BooleanSetting#munge accepts exactly true, 'true', false, 'false'; any other value — integers 1/0, 'yes'/'no'/'on'/'off', symbols, nil — raises Puppet::Settings::ValidationError naming the parameter. This is the read-time normalization for every boolean setting (report, strict_variables, ...).
Source
Thrown at lib/puppet/settings/boolean_setting.rb:27
else
[["--#{name}", GetoptLong::NO_ARGUMENT], ["--no-#{name}", GetoptLong::NO_ARGUMENT]]
end
end
def optparse_args
if short
["--[no-]#{name}", "-#{short}", desc, :NONE]
else
["--[no-]#{name}", desc, :NONE]
end
end
def munge(value)
case value
when true, "true"; true
when false, "false"; false
else
raise Puppet::Settings::ValidationError, _("Invalid value '%{value}' for boolean parameter: %{name}") % { value: value.inspect, name: @name }
end
end
def type
:boolean
end
end
View on GitHub (pinned to e227c27540)
Solutions
- Use the literals true or false (unquoted in puppet.conf) for boolean settings.
- Coerce in your template/wrapper: value ? 'true' : 'false' before writing config.
- Audit generated puppet.conf files for yes/no/on/off/1/0 in boolean keys.
Example fix
# before (puppet.conf [agent]) report = yes # after report = true
Defensive patterns
Strategy: type-guard
Validate before calling
raise Puppet::Settings::ValidationError, "expected true/false, got #{v.inspect}" unless [true, 'true', false, 'false'].include?(v)
Puppet.settings[:report] = v Type guard
boolish = ->(v) { [true, 'true', false, 'false'].include?(v) } Try / catch
begin
Puppet.settings[:report] = v
rescue Puppet::Settings::ValidationError => e
raise unless e.message.include?('boolean parameter')
Puppet.settings[:report] = %w[true 1 yes on].include?(v.to_s.downcase) # normalize then retry
end Prevention
- Template boolean settings with value ? 'true' : 'false'
- Reject yes/no/on/off/1/0 at the config-generation layer
- Unquoted literal true/false is the only safe spelling in puppet.conf
When it happens
Trigger: puppet.conf `report = yes` or `report = 1`; YAML-generated config injecting real integers/booleans from a template that formats them wrongly; CLI `--report on`; ERB writing <%= value %> where value is an unquoted integer.
Common situations: Config management templating puppet.conf with systemd/nginx-style truthiness ('yes'/'on'/'1'); heterogeneous sources where one writer emits 0/1; Ansible/Hiera variables typed as integers.
Related errors
- Invalid run mode '#{mode}'
- Expected an Array or String, got a %{klass}
- Invalid autosign value %{value}: must be 'true'/'false' or a
- Invalid certificate revocation value %{value}: must be one o
- Invalid duration format '%{value}' for parameter: %{name}
AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21).
Data as JSON: /api/errors/a43e2d4184af0f41.
Report an issue: GitHub.