puppetlabs/puppet · error · ArgumentError

Could not find declared class %{title}

Error message

Could not find declared class %{title}

What it means

Error "Could not find declared class %{title}" thrown in puppetlabs/puppet.

Source

Thrown at lib/puppet/resource.rb:347

      # Set things like environment, strictness first.
      attributes.each do |attr, value|
        next if attr == :parameters

        send(attr.to_s + "=", value)
      end

      if environment.is_a?(Puppet::Node::Environment) && environment != Puppet::Node::Environment::NONE
        self.file = environment.externalize_path(attributes[:file])
      end

      @type, @title = self.class.type_and_title(type, title)

      rt = resource_type

      self.kind = self.class.to_kind(rt) unless kind
      if strict? && rt.nil?
        if class?
          raise ArgumentError, _("Could not find declared class %{title}") % { title: title }
        else
          raise ArgumentError, _("Invalid resource type %{type}") % { type: type }
        end
      end

      params = attributes[:parameters]
      unless params.nil? || params.empty?
        extract_parameters(params)
        if rt && rt.respond_to?(:deprecate_params)
          rt.deprecate_params(title, params)
        end
      end

      tag(self.type)
      tag_if_valid(self.title)
    end
  end

View on GitHub (pinned to e227c27540)

When it happens

Trigger: Thrown at lib/puppet/resource.rb:347 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21). Data as JSON: /api/errors/e526d894e2a18033. Report an issue: GitHub.