{"record":{"id":"653b0f2eb97ad97d","repo":"puppetlabs/puppet","slug":"could-not-find-type-request-type","errorCode":null,"errorMessage":"Could not find type %{request_type}","messagePattern":"Could not find type %(.+?)","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/indirector/resource/ral.rb","lineNumber":64,"sourceCode":"  end\n\n  private\n\n  # {type,resource}_name: the resource name may contain slashes:\n  # File[\"/etc/hosts\"]. To handle, assume the type name does\n  # _not_ have any slashes in it, and split only on the first.\n\n  def type_name(request)\n    request.key.split('/', 2)[0]\n  end\n\n  def resource_name(request)\n    name = request.key.split('/', 2)[1]\n    name unless name == \"\"\n  end\n\n  def type(request)\n    Puppet::Type.type(type_name(request)) or raise Puppet::Error, _(\"Could not find type %{request_type}\") % { request_type: type_name(request) }\n  end\nend\n","sourceCodeStart":46,"sourceCodeEnd":67,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/indirector/resource/ral.rb#L46-L67","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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)"],"exampleFix":"# before\npuppet resource apache::vhost web  # type never synced to this node\n# Error: Could not find type apache::vhost\n\n# after\npuppet agent -t                  # pluginsync brings lib/puppet/type/*\npuppet resource apache::vhost web","handlingStrategy":"validation","validationCode":"type_name, title = key.split('/', 2)\nunless Puppet::Type.type(type_name)\n  raise ArgumentError, \"resource type '#{type_name}' not loaded on this host (run puppet agent -t to pluginsync)\"\nend","typeGuard":"def known_resource_type?(name)\n  !Puppet::Type.type(name.to_s.split('/', 2)[0]).nil?\nend","tryCatchPattern":null,"preventionTips":["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"],"tags":["puppet","ral","resource-type","pluginsync","type-lookup"],"backgroundTag":"unknown-resource-type","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}