theforeman/foreman · error · RuntimeError

Invalid type #{type}

Error message

Invalid type #{type}

What it means

Error "Invalid type #{type}" thrown in theforeman/foreman.

Source

Thrown at app/models/concerns/foreman/sti.rb:9

module Foreman
  module STI
    extend ActiveSupport::Concern

    class_methods do
      # ensures that the correct STI object is created when :type is passed.
      def new(attributes = nil, &block)
        if attributes.is_a?(Hash) && (type = attributes.with_indifferent_access.delete(:type)).present? && (klass = type.constantize) != self
          raise "Invalid type #{type}" unless klass <= self
          return klass.new(attributes, &block)
        end

        super
      end
    end
  end
end

View on GitHub (pinned to 6b05625475)

When it happens

Trigger: Thrown at app/models/concerns/foreman/sti.rb:9 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of theforeman/foreman@6b05625475 (2026-08-23). Data as JSON: /api/errors/ecfbe7d14e9e1d46. Report an issue: GitHub.