puppetlabs/puppet · error · Puppet::Error

detail

Error message

detail

What it means

`self.instances` (lib/puppet/provider/package/portage.rb:63) enumerates Gentoo packages by running `eix --installed` (and `eix-update` first when the eix cache is stale relative to the portage timestamp). Any Puppet::ExecutionFailure from those commands is rescued and re-raised as Puppet::Error carrying the raw detail, so the message text is whatever eix/eix-update printed.

Source

Thrown at lib/puppet/provider/package/portage.rb:63

      end

      packages = []
      search_output.each_line do |search_result|
        match = result_format.match(search_result)

        next unless match

        package = {}
        result_fields.zip(match.captures) do |field, value|
          package[field] = value unless !value or value.empty?
        end
        package[:provider] = :portage
        packages << new(package)
      end

      packages
    rescue Puppet::ExecutionFailure => detail
      raise Puppet::Error, detail
    end
  end

  def install
    should = @resource.should(:ensure)
    cmd = %w[]
    name = qatom[:category] ? "#{qatom[:category]}/#{qatom[:pn]}" : qatom[:pn]
    name = qatom[:pfx] + name if qatom[:pfx]
    name = name + '-' + qatom[:pv] if qatom[:pv]
    name = name + '-' + qatom[:pr] if qatom[:pr]
    name = name + ':' + qatom[:slot] if qatom[:slot]
    cmd << '--update' if [:latest].include?(should)
    cmd += install_options if @resource[:install_options]
    cmd << name
    emerge(*cmd)
  end

  def uninstall

View on GitHub (pinned to e227c27540)

Solutions

  1. Install the tooling: `emerge app-portage/eix app-portage/portage-utils`.
  2. Run `eix-update` manually as root and fix whatever it complains about (overlay config, permissions on /var/cache/eix).
  3. Sync the portage tree (`emerge --sync` or eix-sync) so the timestamp/cache invariants hold.
  4. Re-run puppet once the commands succeed by hand.
Defensive patterns

Strategy: try-catch

Validate before calling

# Ensure the provider's hard-coded binaries exist before the run
for b in /usr/bin/eix /usr/bin/eix-update /usr/bin/qatom; do [ -x "$b" ] || echo "missing $b"; done

Try / catch

begin
  Puppet::Type.type(:package).provider(:portage).instances
rescue Puppet::Error => e
  Puppet.warning("portage enumeration failed (eix?): #{e.message}")
  []
end

Prevention

When it happens

Trigger: `/usr/bin/eix` missing because app-portage/eix is not installed ('Could not run' execution failure); `eix-update` exiting non-zero on a broken portage tree or overlay; the provider being selected on any Gentoo host during `puppet resource package` or catalog prefetch.

Common situations: Fresh or minimal Gentoo boxes missing app-portage/eix (the provider hard-codes /usr/bin/eix); overlays synced into a state eix-update rejects; cache files in /var/cache/eix owned by the wrong user.

Related errors


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