{"record":{"id":"73f808cfc315f849","repo":"puppetlabs/puppet","slug":"source-must-be-provided-to-install-hp-ux-packages","errorCode":null,"errorMessage":"source must be provided to install HP-UX packages","messagePattern":"source must be provided to install HP-UX packages","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/package/hpux.rb","lineNumber":25,"sourceCode":"Puppet::Type.type(:package).provide :hpux, :parent => Puppet::Provider::Package do\n  desc \"HP-UX's packaging system.\"\n\n  commands :swinstall => \"/usr/sbin/swinstall\",\n           :swlist => \"/usr/sbin/swlist\",\n           :swremove => \"/usr/sbin/swremove\"\n\n  confine 'os.name' => \"hp-ux\"\n\n  defaultfor 'os.name' => \"hp-ux\"\n\n  def self.instances\n    # TODO:  This is very hard on HP-UX!\n    []\n  end\n\n  # source and name are required\n  def install\n    raise ArgumentError, _(\"source must be provided to install HP-UX packages\") unless resource[:source]\n\n    args = standard_args + [\"-s\", resource[:source], resource[:name]]\n    swinstall(*args)\n  end\n\n  def query\n    swlist resource[:name]\n    { :ensure => :present }\n  rescue\n    { :ensure => :absent }\n  end\n\n  def uninstall\n    args = standard_args + [resource[:name]]\n    swremove(*args)\n  end\n\n  def standard_args","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/package/hpux.rb#L7-L43","documentation":"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'.","triggerScenarios":"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).","commonSituations":"Profiles written for Linux reused on HP-UX where source-less installs work; depot paths moved/decommissioned; SD-UX depot URL typos.","solutions":["Set source on the resource to the depot path or server depot, e.g. source => 'nfs-server:/var/opt/depots'.","Verify the depot is readable on the node: `swlist -s <source> @ <name>` before puppet runs.","Keep HP-UX package declarations in their own OS-gated profile so Linux-style source-less resources never hit this provider."],"exampleFix":"# before\npackage { 'gzip': ensure => installed, provider => 'hpux' }\n\n# after\npackage { 'gzip': ensure => installed, provider => 'hpux', source => 'depotserver:/var/spool/sw' }","handlingStrategy":"validation","validationCode":"# HP-UX packages must carry a depot source\nif facts[:os][:name] == 'hp-ux' && r[:provider].to_s == 'hpux'\n  raise \"package #{r[:name]} needs source (swinstall depot)\" if r[:source].nil?\nend","typeGuard":null,"tryCatchPattern":"begin\n  provider.install\nrescue ArgumentError => e\n  raise unless e.message.include?('HP-UX')\n  resource[:source] = default_depot; retry\nend","preventionTips":["Keep HP-UX package declarations in an OS-gated profile that always sets source.","Verify depot reachability (`swlist -s <depot>`) during provisioning.","Never reuse source-less Linux package patterns on HP-UX."],"tags":["puppet","hpux","packages","missing-parameter"],"backgroundTag":"missing-required-parameter","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}