puppetlabs/puppet · error · Puppet::ParseError

%{name}() can only be called using the 4.x function API. See

Error message

%{name}() can only be called using the 4.x function API. See Scope#call_function

What it means

Error "%{name}() can only be called using the 4.x function API. See Scope#call_function" thrown in puppetlabs/puppet.

Source

Thrown at lib/puppet/parser/functions.rb:321

  class << self
    private

    def merged_functions(environment)
      root = environment_module(Puppet.lookup(:root_environment))
      env = environment_module(environment)

      root.all_function_info.merge(env.all_function_info)
    end

    def get_function(name, environment)
      environment_module(environment).get_function_info(name.intern) || environment_module(Puppet.lookup(:root_environment)).get_function_info(name.intern)
    end
  end

  class Error
    def self.is4x(name)
      raise Puppet::ParseError, _("%{name}() can only be called using the 4.x function API. See Scope#call_function") % { name: name }
    end
  end
end

View on GitHub (pinned to e227c27540)

When it happens

Trigger: Thrown at lib/puppet/parser/functions.rb:321 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21). Data as JSON: /api/errors/8ede20136b8f375a. Report an issue: GitHub.