{"record":{"id":"bec92dc2ee8e3c63","repo":"puppetlabs/puppet","slug":"could-not-find-template-file","errorCode":null,"errorMessage":"Could not find template '%{file}'","messagePattern":"Could not find template '%(.+?)'","errorType":"exception","errorClass":"Puppet::ParseError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/evaluator/epp_evaluator.rb","lineNumber":41,"sourceCode":"    evaluate(parser, 'inline_epp', scope, false, result, template_args)\n  end\n\n  def self.epp(scope, file, env_name, template_args = nil)\n    unless file.is_a?(String)\n      # TRANSLATORS 'epp()' is a method name and should not be translated\n      raise ArgumentError, _(\"epp(): the first argument must be a String with the filename, got a %{class_name}\") % { class_name: file.class }\n    end\n\n    unless Puppet::FileSystem.exist?(file)\n      unless file =~ /\\.epp$/\n        file += \".epp\"\n      end\n    end\n\n    scope.debug \"Retrieving epp template #{file}\"\n    template_file = Puppet::Parser::Files.find_template(file, env_name)\n    if template_file.nil? || !Puppet::FileSystem.exist?(template_file)\n      raise Puppet::ParseError, _(\"Could not find template '%{file}'\") % { file: file }\n    end\n\n    # Parse and validate the source\n    parser = Puppet::Pops::Parser::EvaluatingParser::EvaluatingEppParser.new\n    begin\n      result = parser.parse_file(template_file)\n    rescue Puppet::ParseError => e\n      # TRANSLATORS 'epp()' is a method name and 'EPP' refers to 'Embedded Puppet (EPP) template' and should not be translated\n      raise ArgumentError, _(\"epp(): Invalid EPP: %{detail}\") % { detail: e.message }\n    end\n\n    # Evaluate (and check template_args)\n    evaluate(parser, 'epp', scope, true, result, template_args)\n  end\n\n  def self.evaluate(parser, func_name, scope, use_global_scope_only, parse_result, template_args)\n    template_args, template_args_set = handle_template_args(func_name, template_args)\n","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/epp_evaluator.rb#L23-L59","documentation":"Error \"Could not find template '%{file}'\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/evaluator/epp_evaluator.rb:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}