{"record":{"id":"af05a66299f1bac9","repo":"theforeman/foreman","slug":"foreman-url-is-not-set-please-configure-in-the-f","errorCode":null,"errorMessage":":foreman_url is not set, please configure in the Foreman Web UI (Administer -> Settings -> General)","messagePattern":":foreman_url is not set, please configure in the Foreman Web UI \\(Administer -> Settings -> General\\)","errorType":"exception","errorClass":"Foreman::Exception","httpStatus":null,"severity":"error","filePath":"app/mailers/application_mailer.rb","lineNumber":64,"sourceCode":"    url = URI.parse(Setting[:foreman_url])\n    super.merge(url_options: {:host => url.host, :port => url.port, :protocol => url.scheme})\n  end\n\n  private\n\n  def set_locale_for(user)\n    old_loc = FastGettext.locale\n    begin\n      FastGettext.set_locale(user.locale.presence || 'en')\n      yield if block_given?\n    ensure\n      FastGettext.locale = old_loc if block_given?\n    end\n  end\n\n  def set_url\n    unless (@url ||= URI.parse(Setting[:foreman_url])).present?\n      raise Foreman::Exception.new(N_(\":foreman_url is not set, please configure in the Foreman Web UI (Administer -> Settings -> General)\"))\n    end\n  end\n\n  # splitting the email address into two parts: local and domain parts.\n  # each part needs to be encoded separately, for supporting utf-8 address encoding (RFC 6532)\n  def utf8_encode(email)\n    if email.present?\n      address = email.split(\"@\")\n      (address.count == 2) ? Mail::Encodings.decode_encode(address[0], :encode) + '@' + Mail::Encodings.decode_encode(address[1], :encode) : email\n    end\n  end\n\n  def set_delivery_options\n    mail.delivery_method.settings.merge!(self.class.delivery_settings.symbolize_keys)\n  end\nend\n","sourceCodeStart":46,"sourceCodeEnd":81,"githubUrl":"https://github.com/theforeman/foreman/blob/6b05625475cfe6aac31a88f8c8ee6e62e4efe620/app/mailers/application_mailer.rb#L46-L81","documentation":"Error \":foreman_url is not set, please configure in the Foreman Web UI (Administer -> Settings -> General)\" thrown in theforeman/foreman.","triggerScenarios":"Thrown at app/mailers/application_mailer.rb:64 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6b05625475cfe6aac31a88f8c8ee6e62e4efe620","analyzedAt":"2026-08-23T17:46:34.094Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}