puppetlabs/puppet · error · Puppet::ParseError

Failed to parse inline template

Error message

Failed to parse inline template: %{detail}

What it means

TemplateWrapper#result raised while rendering an inline ERB template string; the generic exception is rescued and re-raised as Puppet::ParseError with the detail.

Solutions

  1. Fix the Ruby syntax or undefined variable in the inline template string
  2. Check the variables referenced are set in the enclosing scope
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at lib/puppet/parser/functions/inline_template.rb:25 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21). Data as JSON: /api/errors/88b17f939b9c7f1e. Report an issue: GitHub.

Appendix: source

Thrown at lib/puppet/parser/functions/inline_template.rb:25

  output is all concatenated and returned as the output of the function.") do |vals|
  if Puppet[:tasks]
    raise Puppet::ParseErrorWithIssue.from_issue_and_stack(
      Puppet::Pops::Issues::FEATURE_NOT_SUPPORTED_WHEN_SCRIPTING,
      { :feature => 'ERB inline_template' }
    )
  end

  require 'erb'

  vals.collect do |string|
    # Use a wrapper, so the template can't get access to the full
    # Scope object.

    wrapper = Puppet::Parser::TemplateWrapper.new(self)
    begin
      wrapper.result(string)
    rescue => detail
      raise Puppet::ParseError, _("Failed to parse inline template: %{detail}") % { detail: detail }, detail.backtrace
    end
  end.join("")
end

View on GitHub (pinned to e227c27540)