{"record":{"id":"81bdd87376fc62fc","repo":"puppetlabs/puppet","slug":"could-not-find-package-name-81bdd8","errorCode":null,"errorMessage":"Could not find package %{name}","messagePattern":"Could not find package %(.+?)","errorType":"exception","errorClass":"Puppet::ExecutionFailure","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/package/rug.rb","lineNumber":29,"sourceCode":"\n  # Install a package using 'rug'.\n  def install\n    should = @resource.should(:ensure)\n    debug \"Ensuring => #{should}\"\n    wanted = @resource[:name]\n\n    # XXX: We don't actually deal with epochs here.\n    case should\n    when true, false, Symbol\n      # pass\n    else\n      # Add the package version\n      wanted += \"-#{should}\"\n    end\n    rug \"--quiet\", :install, \"-y\", wanted\n\n    unless query\n      raise Puppet::ExecutionFailure, _(\"Could not find package %{name}\") % { name: name }\n    end\n  end\n\n  # What's the latest package version available?\n  def latest\n    # rug can only get a list of *all* available packages?\n    output = rug \"list-updates\"\n\n    if output =~ /#{Regexp.escape @resource[:name]}\\s*\\|\\s*([^\\s|]+)/\n      Regexp.last_match(1)\n    else\n      # rug didn't find updates, pretend the current\n      # version is the latest\n      @property_hash[:ensure]\n    end\n  end\n\n  def update","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/package/rug.rb#L11-L47","documentation":"The rug (SUSE) provider runs 'rug --quiet install -y <name>' and then re-queries; if the package still is not found it raises Puppet::ExecutionFailure 'Could not find package'. The post-install query uses the rpm parent provider, so whatever rug installed must be visible to 'rpm -q <name>' afterwards, and the --quiet flag hides rug's own explanation.","triggerScenarios":"ensure => installed (or a pinned name-<should> string, since epochs are not handled) with provider => rug where rug exits without installing: name absent from the configured ZENworks/zmd catalog, zmd service down, or stale catalog metadata.","commonSituations":"SLES 9/10 boxes with the zmd daemon stopped; typo'd package names; pinned versions missing release suffixes; rug catalogs never refreshed.","solutions":["Run 'rug install -y <name>' manually to see the real reason (--quiet hides it from Puppet logs)","Fix the catalog source: 'rczmd status' and restart the zmd service so rug has a working catalog","Refresh metadata with 'rug refresh' and retry the puppet run","On SLES 10 SP2+/11+ prefer the zypper provider, which is the maintained code path"],"exampleFix":"// before\npackage { 'apache2':\n  ensure   => '2.2.3-20.18',\n  provider => rug,\n}\n// after - unversioned ensure on the maintained zypper provider\npackage { 'apache2':\n  ensure   => installed,\n  provider => zypper,\n}","handlingStrategy":"validation","validationCode":"# Ruby: confirm rug can see the package before the run\ndef rug_knows_package?(name)\n  out = Puppet::Util::Execution.execute(['/usr/bin/rug', 'search', name], failonfail: false).to_s\n  out =~ /^#{Regexp.escape(name)}\\b/\nend","typeGuard":null,"tryCatchPattern":"retries ||= 0\nbegin\n  provider.install\nrescue Puppet::ExecutionFailure => e\n  raise unless e.message =~ /Could not find package/ && (retries += 1) == 1\n  Puppet::Util::Execution.execute(['/usr/bin/rug', 'refresh'], failonfail: false)\n  retry\nend","preventionTips":["Keep the zmd service running so rug has a live catalog","Pin versions including the release suffix, and remember epochs are not handled","Prefer the zypper provider on SLES 10 SP2+ and newer"],"tags":["suse","rug","package-not-found","sles","package-provider"],"backgroundTag":"package-not-found","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}