{"record":{"id":"b74026e0fb9cb9f9","repo":"puppetlabs/puppet","slug":"filename","errorCode":null,"errorMessage":"--- #{filename}","messagePattern":"--- #\\{filename\\}","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/puppet/face/epp.rb","lineNumber":394,"sourceCode":"      if show_filename && options[:header]\n        output << \"--- #{filename}\\n\"\n      end\n      fmt = options[:format]\n      if fmt.nil? || fmt == 'old'\n        output << Puppet::Pops::Model::ModelTreeDumper.new.dump(parse_result) << \"\\n\"\n      else\n        require_relative '../../puppet/pops/pn'\n        pn = Puppet::Pops::Model::PNTransformer.transform(parse_result)\n        case fmt\n        when 'json'\n          options[:pretty] ? JSON.pretty_unparse(pn.to_data) : JSON.dump(pn.to_data)\n        else\n          pn.format(options[:pretty] ? Puppet::Pops::PN::Indent.new('  ') : nil, output)\n        end\n      end\n    rescue Puppet::ParseError => detail\n      if show_filename\n        Puppet.err(\"--- #{filename}\")\n      end\n      Puppet.err(detail.message)\n      \"\"\n    end\n  end\n\n  def get_values(compiler, options)\n    template_values = nil\n    values_file = options[:values_file]\n    if values_file\n      begin\n        case values_file\n        when /\\.yaml$/\n          template_values = Puppet::Util::Yaml.safe_load_file(values_file, [Symbol])\n        when /\\.pp$/\n          evaluating_parser = Puppet::Pops::Parser::EvaluatingParser.new\n          template_values = evaluating_parser.evaluate_file(compiler.topscope, values_file)\n        else","sourceCodeStart":376,"sourceCodeEnd":412,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/epp.rb#L376-L412","documentation":"Printed by the `puppet epp validate` face while validating several templates: when a file raises Puppet::ParseError and show_filename is on, Puppet.err emits '--- <filename>' as a header, then the parse error message, and that file's result becomes ''. It is the multi-file error banner for EPP syntax failures, not an error in itself.","triggerScenarios":"`puppet epp validate a.epp b.epp c.epp` (or a glob of templates) where at least one template has invalid EPP: unbalanced <%= %>, invalid Puppet expressions inside tags, or a stray %>.","commonSituations":"Hand-edited or ERB-converted templates; CI running epp validate over a module's templates; templates using syntax only valid in newer Puppet versions.","solutions":["Read the line printed right after the header — it carries the actual parse error and its position","Open the named template and fix the EPP syntax","Iterate with `puppet epp validate <single file>` until clean, then rerun the batch","Add `puppet epp validate` to module CI so broken templates never land"],"exampleFix":"# before (bad.epp)\n<%= 1 + \n\n# after\n<%= 1 + 1 %>","handlingStrategy":"try-catch","validationCode":"require 'puppet/pops/parser/evaluating_parser'\n\nparser = Puppet::Pops::Parser::EvaluatingParser::EvaluatingEppParser.new\nbegin\n  parser.parse_file('template.epp')\n  puts 'template OK'\nrescue Puppet::ParseError => e\n  puts \"#{e.file}:#{e.line} #{e.message}\"\nend","typeGuard":null,"tryCatchPattern":"files.each do |f|\n  begin\n    validate_template(f)\n  rescue Puppet::ParseError => e\n    Puppet.err \"--- #{f}\"      # same convention the face uses\n    Puppet.err e.message\n    bad << f                    # keep going, collect failures for the summary\n  end\nend","preventionTips":["Run `puppet epp validate` over module templates in CI","Pre-validate templates in deploy scripts before batch operations","Use editor syntax support for EPP while authoring"],"tags":["ruby","puppet","epp","template","validation","syntax"],"backgroundTag":"template-parse-error","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}