{"record":{"id":"9dfd0ee4fff0ea01","repo":"puppetlabs/puppet","slug":"could-not-find-version-version-of-name","errorCode":null,"errorMessage":"Could not find version #{version} of #{name}","messagePattern":"Could not find version #(.+?) of #(.+?)","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/interface.rb","lineNumber":99,"sourceCode":"    # @api public\n    def face?(name, version)\n      Puppet::Interface::FaceCollection[name, version]\n    end\n\n    # Retrieves a face by name and version\n    #\n    # @param name [Symbol] the name of the face\n    # @param version [String] the version of the face\n    #\n    # @return [Puppet::Interface] the face\n    #\n    # @api public\n    def [](name, version)\n      face = Puppet::Interface::FaceCollection[name, version]\n      unless face\n        # REVISIT (#18042) no sense in rechecking if version == :current -- josh\n        if Puppet::Interface::FaceCollection[name, :current]\n          raise Puppet::Error, \"Could not find version #{version} of #{name}\"\n        else\n          raise Puppet::Error, \"Could not find Puppet Face #{name}\"\n        end\n      end\n\n      face\n    end\n\n    # Retrieves an action for a face\n    # @param name [Symbol] The face\n    # @param action [Symbol] The action name\n    # @param version [String, :current] The version of the face\n    # @return [Puppet::Interface::Action] The action\n    def find_action(name, action, version = :current)\n      Puppet::Interface::FaceCollection.get_action_for_face(name, action, version)\n    end\n  end\n","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/interface.rb#L81-L117","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\nface = Puppet::Interface[:documentation, '0.0.2']\n# => Error: Could not find version 0.0.2 of documentation\n\n# after\nversions = Puppet::Interface::FaceCollection.versions(:documentation)\nface = Puppet::Interface[:documentation, :current]\n# or pin code to a version that is actually registered","handlingStrategy":"validation","validationCode":"name = name.to_sym\nunless Puppet::Interface::FaceCollection[name, version]\n  versions = Puppet::Interface::FaceCollection.versions(name)\n  raise Puppet::Error, \"face #{name} has versions #{versions}, not #{version}\" if versions\n  raise Puppet::Error, \"face #{name} not installed\"\nend","typeGuard":"def face_version_available?(name, version)\n  !Puppet::Interface::FaceCollection[name.to_sym, version].nil?\nend","tryCatchPattern":null,"preventionTips":["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"],"tags":["puppet","faces","versioning","plugin-resolution"],"backgroundTag":"version-not-found","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}