{"record":{"id":"06e76ff0c3b422b7","repo":"puppetlabs/puppet","slug":"unable-to-unfreeze-package","errorCode":null,"errorMessage":"Unable to unfreeze %{package}","messagePattern":"Unable to unfreeze %(.+?)","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/package/pkg.rb","lineNumber":125,"sourceCode":"       { :publisher => Regexp.last_match(1), :name => Regexp.last_match(2), :ensure => Regexp.last_match(3) }.merge ifo_flag(Regexp.last_match(4))\n\n     # FMRI                                                             STATE      UFOXI\n     # pkg://solaris/SUNWcs@0.5.11,5.11-0.151.0.1:20101105T001108Z      installed  u----\n     when %r{^pkg://([^/]+)/([^@]+)@(\\S+) +(\\S+) +(.....)$}\n       { :publisher => Regexp.last_match(1), :name => Regexp.last_match(2), :ensure => Regexp.last_match(3) }.merge pkg_state(Regexp.last_match(4)).merge(ufoxi_flag(Regexp.last_match(5)))\n\n     else\n       raise ArgumentError, _('Unknown line format %{resource_name}: %{parse_line}') % { resource_name: name, parse_line: line }\n     end).merge({ :provider => name })\n  end\n\n  def hold\n    pkg(:freeze, @resource[:name])\n  end\n\n  def unhold\n    r = exec_cmd(command(:pkg), 'unfreeze', @resource[:name])\n    raise Puppet::Error, _(\"Unable to unfreeze %{package}\") % { package: r[:out] } unless [0, 4].include? r[:exit]\n  end\n\n  def insync?(is)\n    # this is called after the generic version matching logic (insync? for the\n    # type), so we only get here if should != is, and 'should' is a version\n    # number. 'is' might not be, though.\n    should = @resource[:ensure]\n    # NB: it is apparently possible for repository administrators to publish\n    # packages which do not include build or branch versions, but component\n    # version must always be present, and the timestamp is added by pkgsend\n    # publish.\n    if /^[0-9.]+(,[0-9.]+)?(-[0-9.]+)?:[0-9]+T[0-9]+Z$/ !~ should\n      # We have a less-than-explicit version string, which we must accept for\n      # backward compatibility. We can find the real version this would match\n      # by asking pkg for the all matching versions, and selecting the first\n      # installable one [0]; this can change over time when remote repositories\n      # are updated, but the principle of least astonishment should still hold:\n      # if we allow users to specify less-than-explicit versions, the","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/package/pkg.rb#L107-L143","documentation":"Raised by `unhold` (lib/puppet/provider/package/pkg.rb:125) in the Solaris `pkg` provider. Before install/update it runs `pkg unfreeze <name>` and accepts exit codes 0 (success) and 4 (nothing frozen); any other exit code aborts with Puppet::Error carrying the command's combined stdout/stderr in %{package}.","triggerScenarios":"`pkg unfreeze` returning something other than 0/4: agent running without root privileges (cannot modify /var/pkg), a corrupted package image, an invalid package operand, or disk/filesystem errors.","commonSituations":"puppet agent running as a non-root or RBAC-restricted user; image left inconsistent after a crashed pkg operation; read-only or full /var filesystem.","solutions":["Run `pkg unfreeze <package>` manually as root and read the real error printed to stdout/stderr (it is embedded in the Puppet message).","Ensure the puppet agent runs as root on Solaris hosts.","Repair the image with `pkg verify` / `pkg fix`, or `pkg rebuild-index` where applicable.","Free disk space and confirm /var/pkg is writable, then let Puppet retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Only rely on unhold when a freeze actually exists and unfreeze succeeds as root\npkg freeze -l | grep -q \"^${name}@\" && pkg unfreeze \"${name}\" || echo \"nothing frozen or cannot unfreeze - investigate as root\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the puppet agent as root on Solaris.","Keep /var/pkg writable and the image healthy (pkg verify after crashes).","Pre-clear holds manually before maintenance windows that change frozen packages."],"tags":["solaris","pkg","unfreeze","hold","permissions","package-provider"],"backgroundTag":"package-manager-command-failure","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}