{"record":{"id":"acde4b3b02cdbb43","repo":"puppetlabs/puppet","slug":"no-version-of-name-matching-should-is-instal","errorCode":null,"errorMessage":"No version of %{name} matching %{should} is installable, even though the package is currently installed","messagePattern":"No version of %(.+?) matching %(.+?) is installable, even though the package is currently installed","errorType":"exception","errorClass":"Puppet::DevError","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/package/pkg.rb","lineNumber":184,"sourceCode":"\n        begin\n          unhold if properties[:mark] == :hold\n          status = exec_cmd(command(:pkg), command, *options, \"#{name}@#{p[:ensure]}\")[:exit]\n        ensure\n          hold if properties[:mark] == :hold\n        end\n\n        case status\n        when 4\n          # if the first installable match would cause no changes, we're in sync\n          return true\n        when 0\n          warning(_(\"Selecting version '%{version}' for implicit '%{should}'\") % { version: p[:ensure], should: should })\n          @resource[:ensure] = p[:ensure]\n          return false\n        end\n      }\n      raise Puppet::DevError, _(\"No version of %{name} matching %{should} is installable, even though the package is currently installed\") %\n                              { name: name, should: should }\n    end\n\n    false\n  end\n\n  # Return the version of the package. Note that the bug\n  # http://defect.opensolaris.org/bz/show_bug.cgi?id=19159%\n  # notes that we can't use -Ha for the same even though the manual page reads that way.\n  def latest\n    # Refresh package metadata before looking for latest versions\n    pkg(:refresh)\n\n    lines = pkg(:list, \"-Hvn\", @resource[:name]).split(\"\\n\")\n\n    # remove certificate expiration warnings from the output, but report them\n    cert_warnings = lines.select { |line| line =~ /^Certificate/ }\n    unless cert_warnings.empty?","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/package/pkg.rb#L166-L202","documentation":"Raised as Puppet::DevError inside `insync?` (lib/puppet/provider/package/pkg.rb:184) for the Solaris `pkg` provider. When the desired version is not a full FMRI version string, the provider probes pkg's installable candidates for the installed package; if no candidate matches (`pkg install -n` style probes never returned 0/4 in a usable way), it concludes the wanted version is not installable and raises.","triggerScenarios":"`ensure => '1.9'` (partial version) where no publisher offers a build matching it; the installed package's version has been removed from every configured publisher; wrong publisher set pinned on the host.","commonSituations":"Typo or overly-short version pinned in the manifest; repo removed an old build; using versions copied from a different publisher's FMRI.","solutions":["Verify the version exists: `pkg list -af <name>@<version>` must show an installable candidate.","Pin the full FMRI version exactly as shown by `pkg list -av <name>` (component version, branch, timestamp).","Refresh publisher metadata with `pkg refresh --full` and confirm `pkg publisher` lists the expected repositories.","Correct or relax the `ensure` value in the manifest, then re-run the agent."],"exampleFix":"# before\npackage { 'web/server':\n  ensure   => '1.9',\n  provider => pkg,\n}\n\n# after - pin the full version string reported by `pkg list -av web/server`\npackage { 'web/server':\n  ensure   => '1.9.7,5.11-0.151020:20200701T012345Z',\n  provider => pkg,\n}","handlingStrategy":"validation","validationCode":"# Confirm an installable candidate exists before pinning ensure in the manifest\npkg list -af \"${name}@${version}\" | grep -q . || echo \"no installable candidate - fix ensure value first\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin the full FMRI version from `pkg list -av`, never an abbreviated one.","Refresh publisher metadata (`pkg refresh --full`) before version checks.","Automate manifest linting that validates `ensure` values against `pkg list -a` output."],"tags":["solaris","pkg","version-mismatch","ensure","not-installable"],"backgroundTag":"package-version-not-found","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}