puppetlabs/puppet · error · Puppet::ParseError
vals.to_s
Error message
vals.to_s
What it means
This is the fail() function's sole purpose: it aborts compilation with a Puppet::ParseError whose message is the stringified concatenation of its arguments.
Solutions
- Fix the condition that caused the fail() call in the manifest
- Wrap the fail() call in a conditional so it only triggers on genuinely invalid states
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at lib/puppet/parser/functions/fail.rb:12 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21).
Data as JSON: /api/errors/f5f43f1fb83400cc.
Report an issue: GitHub.
Appendix: source
Thrown at lib/puppet/parser/functions/fail.rb:12
# frozen_string_literal: true
Puppet::Parser::Functions.newfunction(
:fail,
:arity => -1,
:doc => <<~DOC
Fail with a parse error. Any parameters will be stringified,
concatenated, and passed to the exception-handler.
DOC
) do |vals|
vals = vals.collect(&:to_s).join(" ") if vals.is_a? Array
raise Puppet::ParseError, vals.to_s
end
View on GitHub (pinned to e227c27540)