{"record":{"id":"1676d2d48574ca53","repo":"puppetlabs/puppet","slug":"epp-template-name","errorCode":null,"errorMessage":"--- #{epp_template_name}","messagePattern":"--- #\\{epp_template_name\\}","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/puppet/face/epp.rb","lineNumber":471,"sourceCode":"    begin\n      if show_filename && options[:header]\n        output << \"\\n\" unless file_nbr == 1\n        output << \"--- #{epp_template_name}\\n\"\n      end\n      # Change to an absolute file only if reference is to a an existing file. Note that an absolute file must be used\n      # or the template must be found on the module path when calling the epp evaluator.\n      template_file = Puppet::Parser::Files.find_template(epp_template_name, compiler.environment)\n      if template_file.nil? && Puppet::FileSystem.exist?(epp_template_name)\n        epp_template_name = File.expand_path(epp_template_name)\n      end\n      result = Puppet::Pops::Evaluator::EppEvaluator.epp(compiler.topscope, epp_template_name, compiler.environment, template_args)\n      if result.instance_of?(Puppet::Pops::Types::PSensitiveType::Sensitive)\n        output << result.unwrap\n      else\n        output << result\n      end\n    rescue Puppet::ParseError => detail\n      Puppet.err(\"--- #{epp_template_name}\") if show_filename\n      raise detail\n    end\n    output\n  end\n\n  # @api private\n  def validate_template(template)\n    parser = Puppet::Pops::Parser::EvaluatingParser::EvaluatingEppParser.new()\n    parser.parse_file(template)\n    true\n  rescue => detail\n    Puppet.log_exception(detail)\n    false\n  end\n\n  # @api private\n  def validate_template_string(source)\n    parser = Puppet::Pops::Parser::EvaluatingParser::EvaluatingEppParser.new()","sourceCodeStart":453,"sourceCodeEnd":489,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/epp.rb#L453-L489","documentation":"Printed by the `puppet epp render` face while rendering several templates: on Puppet::ParseError for one template, with show_filename on, '--- <template>' is printed as a header and the original ParseError is re-raised, aborting the whole render run at the first broken template.","triggerScenarios":"`puppet epp render a.epp b.epp` where any listed template (or one resolved from the module path) contains invalid EPP that EppEvaluator.epp cannot parse.","commonSituations":"Batch-rendering module templates in CI after a refactor; templates referencing removed Puppet functions; templates valid only under a different Puppet version.","solutions":["Fix the parse error reported in the raised detail right after the header (it names file and line)","Pre-validate the batch first: `puppet epp validate a.epp b.epp`","Keep `puppet epp validate` as a CI gate so render batches never include broken templates"],"exampleFix":"# before (tpl.epp)\n<%= $data.map |$x| { $x  %>\n\n# after\n<%= $data.map |$x| { $x } %>","handlingStrategy":"try-catch","validationCode":"require 'puppet/pops/parser/evaluating_parser'\n\ntemplates.each do |t|\n  Puppet::Pops::Parser::EvaluatingParser::EvaluatingEppParser.new.parse_file(t)\nrescue Puppet::ParseError => e\n  abort \"#{t}: #{e.message}\"\nend","typeGuard":null,"tryCatchPattern":"templates.each do |t|\n  begin\n    out << render_template(t)\n  rescue Puppet::ParseError => e\n    Puppet.err \"--- #{t}\"\n    raise e                 # face aborts at first bad template; or collect and continue\n  end\nend","preventionTips":["Gate batch renders behind `puppet epp validate`","Keep module templates covered by CI so parse errors surface before deploy"],"tags":["ruby","puppet","epp","template","render","syntax"],"backgroundTag":"template-parse-error","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}