puppetlabs/puppet · error · ArgumentError

Unknown injection

Error message

Unknown injection %{injection_name}

What it means

Dispatch#weave encountered an injection keyword that is not one Puppet knows how to supply (scope, pal_script_compiler, cache, pal_catalog_compiler, pal_compiler), so it cannot build the argument.

Solutions

  1. Correct the injection keyword in the dispatcher's weaving declaration
  2. Use one of the supported injections: :scope, :pal_script_compiler, :cache, :pal_catalog_compiler, :pal_compiler
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at lib/puppet/pops/functions/dispatch.rb:91 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/9c6ec1615fb9599c. Report an issue: GitHub.

Appendix: source

Thrown at lib/puppet/pops/functions/dispatch.rb:91

    else
      new_args = []
      @weaving.each do |knit|
        if knit.is_a?(Array)
          injection_name = @injections[knit[0]]
          new_args <<
            case injection_name
            when :scope
              scope
            when :pal_script_compiler
              Puppet.lookup(:pal_script_compiler)
            when :cache
              Puppet::Pops::Adapters::ObjectIdCacheAdapter.adapt(scope.compiler)
            when :pal_catalog_compiler
              Puppet.lookup(:pal_catalog_compiler)
            when :pal_compiler
              Puppet.lookup(:pal_compiler)
            else
              raise ArgumentError, _("Unknown injection %{injection_name}") % { injection_name: injection_name }
            end
        elsif knit < 0
          # Careful so no new nil arguments are added since they would override default
          # parameter values in the received
          idx = -knit - 1
          new_args += args[idx..] if idx < args.size
        elsif knit < args.size
          new_args << args[knit]
        end
      end
      new_args
    end
  end
end
end
end

View on GitHub (pinned to e227c27540)