{"record":{"id":"17bbac8491b6fe1e","repo":"puppetlabs/puppet","slug":"provider-name-package-command-cmd-does-not","errorCode":null,"errorMessage":"Provider %{name} package command '%{cmd}' does not exist on this host","messagePattern":"Provider %(.+?) package command '%(.+?)' does not exist on this host","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/package_targetable.rb","lineNumber":61,"sourceCode":"  end\n\n  # Returns the resource command or provider command.\n\n  def resource_or_provider_command\n    resource.original_parameters[:command] || self.class.provider_command\n  end\n\n  # Targetable providers use has_command/is_optional to defer validation of provider suitability.\n  # Evaluate provider suitability here and now by validating that the command is defined and exists.\n  #\n  # cmd: the full path to the package command.\n\n  def self.validate_command(cmd)\n    unless cmd\n      raise Puppet::Error, _(\"Provider %{name} package command is not functional on this host\") % { name: name }\n    end\n    unless File.file?(cmd)\n      raise Puppet::Error, _(\"Provider %{name} package command '%{cmd}' does not exist on this host\") % { name: name, cmd: cmd }\n    end\n  end\n\n  # Return information about the package, its provider, and its (optional) command.\n\n  def to_s\n    cmd = resource[:command] || :default\n    \"#{@resource}(provider=#{self.class.name})(command=#{cmd})\"\n  end\nend\n","sourceCodeStart":43,"sourceCodeEnd":72,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/package_targetable.rb#L43-L72","documentation":"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.","triggerScenarios":"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.","commonSituations":"AIO packages vs distro gem paths; profiles shared between agent and server nodes; gem command moving across puppet-agent upgrades; minimal container images.","solutions":["Check the path named in the message with 'ls -l <cmd>'; install the package providing it or correct the path","Set the resource's command attribute to the absolute path that exists on this node (e.g. command => '/usr/local/bin/gem')","Remove the forced provider and let automatic selection pick a suitable provider for the node","In modules, derive command paths from facts instead of hard-coding them"],"exampleFix":"// before - hard-coded AIO path absent on this node\npackage { 'r10k':\n  ensure   => installed,\n  provider => gem,\n  command  => '/opt/puppetlabs/puppet/bin/gem',\n}\n// after - existing path selected per node\npackage { 'r10k':\n  ensure   => installed,\n  provider => gem,\n  command  => $facts['aio_gem_path'] ? {\n    undef   => '/usr/local/bin/gem',\n    default => $facts['aio_gem_path'],\n  },\n}","handlingStrategy":"validation","validationCode":"# Ruby: assert the command path exists before the provider validates it\ndef command_path_exists?(cmd)\n  !cmd.nil? && File.file?(cmd) && File.executable?(cmd)\nend","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Source command paths from facts or hiera per node type instead of hard-coding","Ensure container images include the package binaries their profiles manage","After puppet-agent or puppetserver upgrades, re-verify gem/puppetserver binary locations"],"tags":["targetable-provider","missing-executable","file-not-found","provider-selection"],"backgroundTag":"provider-command-missing","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}