puppetlabs/puppet · error · Puppet::Error
Could not find type %{request_type}
Error message
Could not find type %{request_type} What it means
The RAL resource terminus (used by 'puppet resource' and REST resource queries) splits the request key on the first '/' into type and title, then looks up Puppet::Type.type(type_name). If no resource type is registered under that name, Puppet::Error is raised. Unregistered means: the type name is misspelled or wrongly cased for namespaced types, or a custom type's plugin (custom type/provider ruby files) has not been synced/loaded on this host.
Source
Thrown at lib/puppet/indirector/resource/ral.rb:64
end
private
# {type,resource}_name: the resource name may contain slashes:
# File["/etc/hosts"]. To handle, assume the type name does
# _not_ have any slashes in it, and split only on the first.
def type_name(request)
request.key.split('/', 2)[0]
end
def resource_name(request)
name = request.key.split('/', 2)[1]
name unless name == ""
end
def type(request)
Puppet::Type.type(type_name(request)) or raise Puppet::Error, _("Could not find type %{request_type}") % { request_type: type_name(request) }
end
end
View on GitHub (pinned to e227c27540)
Solutions
- Check available types: puppet resource --types | grep -i <name> to confirm spelling/availability
- Run an agent pass (puppet agent -t) or puppet plugin download so custom types under modules' lib/ are synced before querying
- For namespaced types, use the exact casing: File_line vs file_line per the type's newtype declaration
- Ensure modulepath on the host includes the module providing the type (puppet config print modulepath)
Example fix
# before puppet resource apache::vhost web # type never synced to this node # Error: Could not find type apache::vhost # after puppet agent -t # pluginsync brings lib/puppet/type/* puppet resource apache::vhost web
Defensive patterns
Strategy: validation
Validate before calling
type_name, title = key.split('/', 2)
unless Puppet::Type.type(type_name)
raise ArgumentError, "resource type '#{type_name}' not loaded on this host (run puppet agent -t to pluginsync)"
end Type guard
def known_resource_type?(name)
!Puppet::Type.type(name.to_s.split('/', 2)[0]).nil?
end Prevention
- Run one agent pass (pluginsync) before querying custom types with puppet resource
- Gate custom-type tooling on Puppet::Type.type?(:mytype) being present
- Verify type names against `puppet resource --types` output
When it happens
Trigger: Running puppet resource <type> ... where <type> does not exist: 'puppet resource pakage' (typo), 'puppet resource apache::vhost foo' where the module's lib/puppet/type files were never pluginsynced to this node, or REST calls to /puppet/v3/resource/<bogus>/... against an agent.
Common situations: Custom types used before the first agent run completes pluginsync; environments where modules live in a nonstandard modulepath not present on the querying host; case errors (Package vs package is fine, but namespaced types must match exactly); querying resource via REST on a node lacking the module.
Related errors
- Unknown resource type %{type}
- The code loaded from %{source_ref} does not create the resou
- The code loaded from %{source_ref} does not create the resou
- The code loaded from %{source_ref} must contain only the cre
- The code loaded from %{source_ref} does not define the resou
AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21).
Data as JSON: /api/errors/653b0f2eb97ad97d.
Report an issue: GitHub.