theforeman/foreman · error · Foreman::Exception

No templates found

Error message

No templates found

What it means

Error "No templates found" thrown in theforeman/foreman.

Source

Thrown at app/controllers/hosts_controller.rb:878

      if proxy
        success _('The %{proxy_type} proxy of the selected hosts was set to %{proxy_name}') % {:proxy_name => proxy.name, :proxy_type => proxy_type}
      else
        success _('The %{proxy_type} proxy of the selected hosts was cleared') % {:proxy_type => proxy_type}
      end
    else
      error n_("The %{proxy_type} proxy could not be set for host: %{host_names}.",
        "The %{proxy_type} puppet ca proxy could not be set for hosts: %{host_names}",
        failed_hosts.count) % {:proxy_type => proxy_type, :host_names => failed_hosts.map { |h, err| "#{h} (#{err})" }.to_sentence}
    end
    redirect_back_or_to helpers.current_hosts_path
  end

  def find_templates
    find_resource
    @templates = TemplateKind.order(:name).map do |kind|
      @host.provisioning_template(:kind => kind.name)
    end.compact
    raise Foreman::Exception.new(N_("No templates found")) if @templates.empty?
  end

  def host_attributes_for_templates(host)
    # This method wants to only get the attributes applicable to the current
    # kind of host. For example 'is_owned_by', even if it's in host_params,
    # should be ignored by Host::Discovered or any other Host class that does
    # not have that attribute
    host_attributes = host.class.attribute_names.dup
    if host_params["compute_attributes"].present?
      host_attributes << 'compute_attributes'
    end
    host_params.select do |k, v|
      host_attributes.include?(k) && !k.end_with?('_ids')
    end.except(:host_parameters_attributes)
  end

  def csv_columns
    csv_pagelets.map { |pagelet| pagelet.opts[:export_data] || pagelet.opts[:export_key] || pagelet.opts[:key] }.flatten

View on GitHub (pinned to 6b05625475)

When it happens

Trigger: Thrown at app/controllers/hosts_controller.rb:878 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/8ed5ebdbc0daaabf. Report an issue: GitHub.