puppetlabs/puppet · error · ArgumentError

inline_epp(): the first argument must be a String with the e

Error message

inline_epp(): the first argument must be a String with the epp source text, got a %{class_name}

What it means

Error "inline_epp(): the first argument must be a String with the epp source text, got a %{class_name}" thrown in puppetlabs/puppet.

Source

Thrown at lib/puppet/pops/evaluator/epp_evaluator.rb:9

# frozen_string_literal: true

# Handler of Epp call/evaluation from the epp and inline_epp functions
#
class Puppet::Pops::Evaluator::EppEvaluator
  def self.inline_epp(scope, epp_source, template_args = nil)
    unless epp_source.is_a?(String)
      # TRANSLATORS 'inline_epp()' is a method name and 'epp' refers to 'Embedded Puppet (EPP) template' and should not be translated
      raise ArgumentError, _("inline_epp(): the first argument must be a String with the epp source text, got a %{class_name}") %
                           { class_name: epp_source.class }
    end

    # Parse and validate the source
    parser = Puppet::Pops::Parser::EvaluatingParser::EvaluatingEppParser.new
    begin
      result = parser.parse_string(epp_source, 'inlined-epp-text')
    rescue Puppet::ParseError => e
      # TRANSLATORS 'inline_epp()' is a method name and 'EPP' refers to 'Embedded Puppet (EPP) template' and should not be translated
      raise ArgumentError, _("inline_epp(): Invalid EPP: %{detail}") % { detail: e.message }
    end

    # Evaluate (and check template_args)
    evaluate(parser, 'inline_epp', scope, false, result, template_args)
  end

  def self.epp(scope, file, env_name, template_args = nil)
    unless file.is_a?(String)

View on GitHub (pinned to e227c27540)

When it happens

Trigger: Thrown at lib/puppet/pops/evaluator/epp_evaluator.rb:9 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/f9388c15cfe2cac3. Report an issue: GitHub.