puppetlabs/puppet · error · Puppet::DevError
No version of %{name} matching %{should} is installable, eve
Error message
No version of %{name} matching %{should} is installable, even though the package is currently installed What it means
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.
Source
Thrown at lib/puppet/provider/package/pkg.rb:184
begin
unhold if properties[:mark] == :hold
status = exec_cmd(command(:pkg), command, *options, "#{name}@#{p[:ensure]}")[:exit]
ensure
hold if properties[:mark] == :hold
end
case status
when 4
# if the first installable match would cause no changes, we're in sync
return true
when 0
warning(_("Selecting version '%{version}' for implicit '%{should}'") % { version: p[:ensure], should: should })
@resource[:ensure] = p[:ensure]
return false
end
}
raise Puppet::DevError, _("No version of %{name} matching %{should} is installable, even though the package is currently installed") %
{ name: name, should: should }
end
false
end
# Return the version of the package. Note that the bug
# http://defect.opensolaris.org/bz/show_bug.cgi?id=19159%
# notes that we can't use -Ha for the same even though the manual page reads that way.
def latest
# Refresh package metadata before looking for latest versions
pkg(:refresh)
lines = pkg(:list, "-Hvn", @resource[:name]).split("\n")
# remove certificate expiration warnings from the output, but report them
cert_warnings = lines.select { |line| line =~ /^Certificate/ }
unless cert_warnings.empty?View on GitHub (pinned to e227c27540)
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.
Example fix
# before
package { 'web/server':
ensure => '1.9',
provider => pkg,
}
# after - pin the full version string reported by `pkg list -av web/server`
package { 'web/server':
ensure => '1.9.7,5.11-0.151020:20200701T012345Z',
provider => pkg,
} Defensive patterns
Strategy: validation
Validate before calling
# Confirm an installable candidate exists before pinning ensure in the manifest
pkg list -af "${name}@${version}" | grep -q . || echo "no installable candidate - fix ensure value first" Prevention
- 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.
When it happens
Trigger: `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.
Common situations: Typo or overly-short version pinned in the manifest; repo removed an old build; using versions copied from a different publisher's FMRI.
Related errors
- Unknown format %{resource_name}: %{full_flags}[%{bad_flag}]
- Unknown format %{resource_name}: %{state}
- Unknown line format %{resource_name}: %{parse_line}
- Unable to unfreeze %{package}
- Pkg could not install %{name} after %{tries} tries. Aborting
AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21).
Data as JSON: /api/errors/acde4b3b02cdbb43.
Report an issue: GitHub.