puppetlabs/puppet · error · Puppet::Error
Could not find version #{version} of #{name}
Error message
Could not find version #{version} of #{name} What it means
Puppet::Interface.[] looks up a face by name and version through FaceCollection. This error means at least one version of the named face IS registered (the :current lookup succeeded), but the specifically requested version is not. Faces declare versions with `face :name, '0.0.1'`; requesting an unregistered version string (or a symbol like :latest) while the face exists elsewhere triggers this branch.
Source
Thrown at lib/puppet/interface.rb:99
# @api public
def face?(name, version)
Puppet::Interface::FaceCollection[name, version]
end
# Retrieves a face by name and version
#
# @param name [Symbol] the name of the face
# @param version [String] the version of the face
#
# @return [Puppet::Interface] the face
#
# @api public
def [](name, version)
face = Puppet::Interface::FaceCollection[name, version]
unless face
# REVISIT (#18042) no sense in rechecking if version == :current -- josh
if Puppet::Interface::FaceCollection[name, :current]
raise Puppet::Error, "Could not find version #{version} of #{name}"
else
raise Puppet::Error, "Could not find Puppet Face #{name}"
end
end
face
end
# Retrieves an action for a face
# @param name [Symbol] The face
# @param action [Symbol] The action name
# @param version [String, :current] The version of the face
# @return [Puppet::Interface::Action] The action
def find_action(name, action, version = :current)
Puppet::Interface::FaceCollection.get_action_for_face(name, action, version)
end
end
View on GitHub (pinned to e227c27540)
Solutions
- List registered versions for the face: Puppet::Interface::FaceCollection.versions(name) and use one of those
- Request :current to get the newest registered version instead of a pinned string
- Upgrade/downgrade the face-providing gem so its declared version matches what your code requests
- Pin the face gem version in your project so the declared version string is deterministic
Example fix
# before face = Puppet::Interface[:documentation, '0.0.2'] # => Error: Could not find version 0.0.2 of documentation # after versions = Puppet::Interface::FaceCollection.versions(:documentation) face = Puppet::Interface[:documentation, :current] # or pin code to a version that is actually registered
Defensive patterns
Strategy: validation
Validate before calling
name = name.to_sym
unless Puppet::Interface::FaceCollection[name, version]
versions = Puppet::Interface::FaceCollection.versions(name)
raise Puppet::Error, "face #{name} has versions #{versions}, not #{version}" if versions
raise Puppet::Error, "face #{name} not installed"
end Type guard
def face_version_available?(name, version) !Puppet::Interface::FaceCollection[name.to_sym, version].nil? end
Prevention
- Resolve faces through Puppet::Interface[:name, :current] unless a specific version contract exists
- Pin face-providing gems so declared version strings stay stable
- Check FaceCollection.versions during boot of tools that depend on a specific face version
When it happens
Trigger: Calling Puppet::Interface[:action, '1.0.0'] when the installed face declares '0.1.0'; third-party face gems registering different version strings than the calling tool requests; code requesting version :current by passing a wrong symbol/string.
Common situations: Gem/plugin version drift where a face's declared version changed between releases; tooling hard-coding a face version; faces split out of core Puppet into gems with renumbered versions.
Related errors
- The legacy subcommand '%{sub_command}' does not support supp
- %{name} can't be optional and have a default value
- default value for %{name} is a %{class_name}, not a proc
- before action hook for %{name} is a %{class_name}, not a pro
- after action hook for %{name} is a %{class_name}, not a proc
AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21).
Data as JSON: /api/errors/9dfd0ee4fff0ea01.
Report an issue: GitHub.