puppetlabs/puppet · error · Puppet::Settings::ValidationError
Invalid autosign value %{value}: must be 'true'/'false' or a
Error message
Invalid autosign value %{value}: must be 'true'/'false' or an absolute path What it means
Puppet::Settings::AutosignSetting#munge validates the `autosign` setting (certificate autosigning): true/'true' map to true, false/'false'/nil map to false, and any other value must satisfy Puppet::Util.absolute_path? (an absolute path to an autosign script or conf); everything else raises Puppet::Settings::ValidationError at config load.
Source
Thrown at lib/puppet/settings/autosign_setting.rb:20
require_relative '../../puppet/settings/base_setting'
# A specialization of the file setting to allow boolean values.
#
# The autosign value can be either a boolean or a file path, and if the setting
# is a file path then it may have a owner/group/mode specified.
#
# @api private
class Puppet::Settings::AutosignSetting < Puppet::Settings::FileSetting
def munge(value)
if ['true', true].include? value
true
elsif ['false', false, nil].include? value
false
elsif Puppet::Util.absolute_path?(value)
value
else
raise Puppet::Settings::ValidationError, _("Invalid autosign value %{value}: must be 'true'/'false' or an absolute path") % { value: value }
end
end
end
View on GitHub (pinned to e227c27540)
Solutions
- Use the literal booleans true/false, or an absolute path such as /etc/puppetlabs/puppet/autosign.conf.
- Fix relative paths to absolute ones (prefix $confdir's real value).
- On Windows use a drive-absolute path form the OS accepts.
Example fix
# before (puppet.conf [server]) autosign = yes # after autosign = /etc/puppetlabs/puppet/autosign.conf # or simply: autosign = true
Defensive patterns
Strategy: validation
Validate before calling
ok = [true, 'true'].include?(v) || [false, 'false', nil].include?(v) || Puppet::Util.absolute_path?(v)
raise Puppet::Settings::ValidationError, "autosign must be true/false or an absolute path (got #{v.inspect})" unless ok Type guard
valid_autosign = ->(v) { [true, 'true'].include?(v) || [false, 'false', nil].include?(v) || Puppet::Util.absolute_path?(v) } Try / catch
begin
Puppet.settings[:autosign] = v
rescue Puppet::Settings::ValidationError => e
raise unless e.message.include?('autosign')
Puppet.err("#{e.message} — use true/false or /abs/path/autosign.conf")
raise
end Prevention
- Write booleans as literal true/false in puppet.conf
- Always use absolute paths for the autosign script/conf
- Validate generated configs with `puppet config print autosign` before deployment
When it happens
Trigger: puppet.conf `autosign = yes` or `autosign = on`; a relative path like `autosign = autosign.conf`; empty-ish junk values; on Windows a non-drive-absolute path (must be like C:/path or \\server\share, depending on absolute_path? support).
Common situations: Copying tutorials that use yes/no booleans; moving configs between Unix and Windows where path conventions differ; deploy tooling writing relative paths.
Related errors
- Invalid run mode '#{mode}'
- Invalid value '%{value}' for boolean parameter: %{name}
- Invalid certificate revocation value %{value}: must be one o
- Invalid duration format '%{value}' for parameter: %{name}
- The certificate for '%{name}' has not yet been signed
AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21).
Data as JSON: /api/errors/3945acc0cee49a42.
Report an issue: GitHub.