puppetlabs/puppet · error · Puppet::Error

Provider %{name} package command '%{cmd}' does not exist on

Error message

Provider %{name} package command '%{cmd}' does not exist on this host

What it means

The companion check to the nil-command error: validate_command found a command string but File.file?(cmd) returned false - the binary is not present at that path on this host. The message names both the provider and the offending absolute path, so it tells you exactly which file is missing.

Source

Thrown at lib/puppet/provider/package_targetable.rb:61

  end

  # Returns the resource command or provider command.

  def resource_or_provider_command
    resource.original_parameters[:command] || self.class.provider_command
  end

  # Targetable providers use has_command/is_optional to defer validation of provider suitability.
  # Evaluate provider suitability here and now by validating that the command is defined and exists.
  #
  # cmd: the full path to the package command.

  def self.validate_command(cmd)
    unless cmd
      raise Puppet::Error, _("Provider %{name} package command is not functional on this host") % { name: name }
    end
    unless File.file?(cmd)
      raise Puppet::Error, _("Provider %{name} package command '%{cmd}' does not exist on this host") % { name: name, cmd: cmd }
    end
  end

  # Return information about the package, its provider, and its (optional) command.

  def to_s
    cmd = resource[:command] || :default
    "#{@resource}(provider=#{self.class.name})(command=#{cmd})"
  end
end

View on GitHub (pinned to e227c27540)

Solutions

  1. Check the path named in the message with 'ls -l <cmd>'; install the package providing it or correct the path
  2. Set the resource's command attribute to the absolute path that exists on this node (e.g. command => '/usr/local/bin/gem')
  3. Remove the forced provider and let automatic selection pick a suitable provider for the node
  4. In modules, derive command paths from facts instead of hard-coding them

Example fix

// before - hard-coded AIO path absent on this node
package { 'r10k':
  ensure   => installed,
  provider => gem,
  command  => '/opt/puppetlabs/puppet/bin/gem',
}
// after - existing path selected per node
package { 'r10k':
  ensure   => installed,
  provider => gem,
  command  => $facts['aio_gem_path'] ? {
    undef   => '/usr/local/bin/gem',
    default => $facts['aio_gem_path'],
  },
}
Defensive patterns

Strategy: validation

Validate before calling

# Ruby: assert the command path exists before the provider validates it
def command_path_exists?(cmd)
  !cmd.nil? && File.file?(cmd) && File.executable?(cmd)
end

Prevention

When it happens

Trigger: A resource sets command => '/opt/puppetlabs/bin/puppetserver' (or the provider's fixed provider_command path) on a node where that file does not exist: different install prefix, puppetserver not installed, or a container image without the package.

Common situations: AIO packages vs distro gem paths; profiles shared between agent and server nodes; gem command moving across puppet-agent upgrades; minimal container images.

Related errors


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