{"record":{"id":"678c0ecc0ed842f1","repo":"puppetlabs/puppet","slug":"function-class-name-unknown-function-fun","errorCode":null,"errorMessage":"Function %{class_name}(): Unknown function: '%{function_name}'","messagePattern":"Function %(.+?)\\(\\): Unknown function: '%(.+?)'","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/functions/function.rb","lineNumber":125,"sourceCode":"    the_loader = loader\n    unless the_loader\n      raise ArgumentError, _(\"Function %{class_name}(): cannot call function '%{function_name}' - no loader specified\") %\n                           { class_name: self.class.name, function_name: function_name }\n    end\n\n    func = the_loader.load(:function, function_name)\n    if func\n      Puppet::Util::Profiler.profile(function_name, [:functions, function_name]) do\n        return func.call(scope, *args, &block)\n      end\n    end\n\n    # Check if a 3x function is present. Raise a generic error if it's not to allow upper layers to fill in the details\n    # about where in a puppet manifest this error originates. (Such information is not available here).\n    loader_scope = closure_scope\n    func_3x = Puppet::Parser::Functions.function(function_name, loader_scope.environment) if loader_scope.is_a?(Puppet::Parser::Scope)\n    unless func_3x\n      raise ArgumentError, _(\"Function %{class_name}(): Unknown function: '%{function_name}'\") %\n                           { class_name: self.class.name, function_name: function_name }\n    end\n\n    # Call via 3x API\n    # Arguments must be mapped since functions are unaware of the new and magical creatures in 4x.\n    # NOTE: Passing an empty string last converts nil/:undef to empty string\n    result = scope.send(func_3x, Puppet::Pops::Evaluator::Runtime3FunctionArgumentConverter.map_args(args, loader_scope, ''), &block)\n\n    # Prevent non r-value functions from leaking their result (they are not written to care about this)\n    Puppet::Parser::Functions.rvalue?(function_name) ? result : nil\n  end\nend\n","sourceCodeStart":107,"sourceCodeEnd":138,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/functions/function.rb#L107-L138","documentation":"Error \"Function %{class_name}(): Unknown function: '%{function_name}'\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/functions/function.rb:125 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"}