we-promise/sure · warning
Auth config not loaded: #{e.class} - #{e.message}
Error message
Auth config not loaded: #{e.class} - #{e.message} What it means
Startup warning from config/initializers/auth.rb (line 8): Rails.application.config_for(:auth) raised RuntimeError, Errno::ENOENT, or Psych::SyntaxError while loading config/auth.yml. The initializer catches it, logs class + message, and falls back to an empty config — so local login, passkey login, and JIT settings all resolve to their defaults (e.g. jit_mode defaults to 'create_and_link'). The app still boots; auth behavior is simply defaults rather than what auth.yml intended.
Source
Thrown at config/initializers/auth.rb:8
# frozen_string_literal: true
Rails.configuration.x.auth ||= ActiveSupport::OrderedOptions.new
begin
raw_auth_config = Rails.application.config_for(:auth)
rescue RuntimeError, Errno::ENOENT, Psych::SyntaxError => e
Rails.logger.warn("Auth config not loaded: #{e.class} - #{e.message}")
raw_auth_config = {}
end
auth_config = raw_auth_config.deep_symbolize_keys
Rails.configuration.x.auth.local_login_enabled = auth_config.dig(:local_login, :enabled)
Rails.configuration.x.auth.local_admin_override_enabled = auth_config.dig(:local_login, :admin_override_enabled)
Rails.configuration.x.auth.passkey_login_enabled = auth_config.dig(:passkey_login, :enabled)
Rails.configuration.x.auth.jit_mode = auth_config.dig(:jit, :mode) || "create_and_link"
raw_domains = auth_config.dig(:jit, :allowed_oidc_domains).to_s
Rails.configuration.x.auth.allowed_oidc_domains = raw_domains.split(",").map(&:strip).reject(&:empty?)
Rails.configuration.x.auth.providers = (auth_config[:providers] || [])
# These will be populated by the OmniAuth initializer once providers areView on GitHub (pinned to e69894adb9)
Solutions
- Check the logged exception class: ENOENT means create config/auth.yml (start from the repo's example); Psych::SyntaxError means fix the YAML (usually indentation or unquoted special characters).
- Validate the file before boot: ruby -e "require 'yaml'; YAML.safe_load(File.read('config/auth.yml'))" or re-run bin/setup.
- If ERB inside the file references env vars, make them set or use ENV.fetch('X', nil) so config_for does not raise.
- After fixing, restart and confirm the warning is gone and auth settings (local login, passkey, jit mode) match intent.
Example fix
// before # config/auth.yml absent/malformed -> warn, auth falls back to defaults // after # config/auth.yml local_login: enabled: true passkey_login: enabled: false jit: mode: create_and_link
Defensive patterns
Strategy: fallback
Validate before calling
path = Rails.root.join('config/auth.yml')
YAML.safe_load(File.read(path)) if File.exist?(path) # raises on bad YAML before boot Prevention
- Copy auth.yml from the repo example during setup and lint it on change.
- Keep ERB inside config files defensive: ENV.fetch('X', nil) instead of bare ENV['X'] where absence is normal.
- Treat this warning as 'auth is on defaults' — verify jit_mode/local-login flags match your intent after any config work.
When it happens
Trigger: config/auth.yml missing (Errno::ENOENT), containing YAML syntax errors (Psych::SyntaxError), or ERB/config_for runtime errors — e.g. referencing an ENV var inside ERB that raises, or bad indentation — while the app boots in an environment that expects the file.
Common situations: Fresh clones or self-hosted deploys where auth.yml was never created from an example; hand-editing auth.yml and breaking indentation; ERB in the file calling something unavailable at boot.
Related errors
- Anthropic Model is required when a custom Base URL is set.
- No LLM provider configured that supports model '#{requested_
- External assistant is not configured. Set the URL and token
- IndexaCapital provider is not configured
- Trading 212 API key is missing.
AI-assisted analysis of we-promise/sure@e69894adb9 (2026-08-21).
Data as JSON: /api/errors/568c94fb21c75b24.
Report an issue: GitHub.