puppetlabs/puppet · error · ArgumentError

source must be provided to install HP-UX packages

Error message

source must be provided to install HP-UX packages

What it means

hpux.rb:25: the HP-UX package provider's install raises ArgumentError unless resource[:source] is set, because swinstall requires a software depot to install from (there is no repository discovery like with apt/yum). The comment in the source states it plainly: 'source and name are required'.

Source

Thrown at lib/puppet/provider/package/hpux.rb:25

Puppet::Type.type(:package).provide :hpux, :parent => Puppet::Provider::Package do
  desc "HP-UX's packaging system."

  commands :swinstall => "/usr/sbin/swinstall",
           :swlist => "/usr/sbin/swlist",
           :swremove => "/usr/sbin/swremove"

  confine 'os.name' => "hp-ux"

  defaultfor 'os.name' => "hp-ux"

  def self.instances
    # TODO:  This is very hard on HP-UX!
    []
  end

  # source and name are required
  def install
    raise ArgumentError, _("source must be provided to install HP-UX packages") unless resource[:source]

    args = standard_args + ["-s", resource[:source], resource[:name]]
    swinstall(*args)
  end

  def query
    swlist resource[:name]
    { :ensure => :present }
  rescue
    { :ensure => :absent }
  end

  def uninstall
    args = standard_args + [resource[:name]]
    swremove(*args)
  end

  def standard_args

View on GitHub (pinned to e227c27540)

Solutions

  1. Set source on the resource to the depot path or server depot, e.g. source => 'nfs-server:/var/opt/depots'.
  2. Verify the depot is readable on the node: `swlist -s <source> @ <name>` before puppet runs.
  3. Keep HP-UX package declarations in their own OS-gated profile so Linux-style source-less resources never hit this provider.

Example fix

# before
package { 'gzip': ensure => installed, provider => 'hpux' }

# after
package { 'gzip': ensure => installed, provider => 'hpux', source => 'depotserver:/var/spool/sw' }
Defensive patterns

Strategy: validation

Validate before calling

# HP-UX packages must carry a depot source
if facts[:os][:name] == 'hp-ux' && r[:provider].to_s == 'hpux'
  raise "package #{r[:name]} needs source (swinstall depot)" if r[:source].nil?
end

Try / catch

begin
  provider.install
rescue ArgumentError => e
  raise unless e.message.include?('HP-UX')
  resource[:source] = default_depot; retry
end

Prevention

When it happens

Trigger: package { X: ensure => installed, provider => hpux (or default on hp-ux) } without a source attribute pointing at a depot (e.g. '/var/spool/sw', 'server:/depot', or a signed depot).

Common situations: Profiles written for Linux reused on HP-UX where source-less installs work; depot paths moved/decommissioned; SD-UX depot URL typos.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


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