{"record":{"id":"db4482a44b36c6a2","repo":"puppetlabs/puppet","slug":"epp-the-first-argument-must-be-a-string-with-th","errorCode":null,"errorMessage":"epp(): the first argument must be a String with the filename, got a %{class_name}","messagePattern":"epp\\(\\): the first argument must be a String with the filename, got a %(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/evaluator/epp_evaluator.rb","lineNumber":29,"sourceCode":"    end\n\n    # Parse and validate the source\n    parser = Puppet::Pops::Parser::EvaluatingParser::EvaluatingEppParser.new\n    begin\n      result = parser.parse_string(epp_source, 'inlined-epp-text')\n    rescue Puppet::ParseError => e\n      # TRANSLATORS 'inline_epp()' is a method name and 'EPP' refers to 'Embedded Puppet (EPP) template' and should not be translated\n      raise ArgumentError, _(\"inline_epp(): Invalid EPP: %{detail}\") % { detail: e.message }\n    end\n\n    # Evaluate (and check template_args)\n    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)","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/epp_evaluator.rb#L11-L47","documentation":"Error \"epp(): the first argument must be a String with the filename, got a %{class_name}\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/evaluator/epp_evaluator.rb:29 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"}