theforeman/foreman · error · Foreman::Exception

:foreman_url is not set, please configure in the Foreman Web

Error message

:foreman_url is not set, please configure in the Foreman Web UI (Administer -> Settings -> General)

What it means

Error ":foreman_url is not set, please configure in the Foreman Web UI (Administer -> Settings -> General)" thrown in theforeman/foreman.

Source

Thrown at app/mailers/application_mailer.rb:64

    url = URI.parse(Setting[:foreman_url])
    super.merge(url_options: {:host => url.host, :port => url.port, :protocol => url.scheme})
  end

  private

  def set_locale_for(user)
    old_loc = FastGettext.locale
    begin
      FastGettext.set_locale(user.locale.presence || 'en')
      yield if block_given?
    ensure
      FastGettext.locale = old_loc if block_given?
    end
  end

  def set_url
    unless (@url ||= URI.parse(Setting[:foreman_url])).present?
      raise Foreman::Exception.new(N_(":foreman_url is not set, please configure in the Foreman Web UI (Administer -> Settings -> General)"))
    end
  end

  # splitting the email address into two parts: local and domain parts.
  # each part needs to be encoded separately, for supporting utf-8 address encoding (RFC 6532)
  def utf8_encode(email)
    if email.present?
      address = email.split("@")
      (address.count == 2) ? Mail::Encodings.decode_encode(address[0], :encode) + '@' + Mail::Encodings.decode_encode(address[1], :encode) : email
    end
  end

  def set_delivery_options
    mail.delivery_method.settings.merge!(self.class.delivery_settings.symbolize_keys)
  end
end

View on GitHub (pinned to 6b05625475)

When it happens

Trigger: Thrown at app/mailers/application_mailer.rb:64 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/af05a66299f1bac9. Report an issue: GitHub.