{"record":{"id":"568c94fb21c75b24","repo":"we-promise/sure","slug":"auth-config-not-loaded-e-class-e-message","errorCode":null,"errorMessage":"Auth config not loaded: #{e.class} - #{e.message}","messagePattern":"Auth config not loaded: #(.+?) - #(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"config/initializers/auth.rb","lineNumber":8,"sourceCode":"# frozen_string_literal: true\n\nRails.configuration.x.auth ||= ActiveSupport::OrderedOptions.new\n\nbegin\n  raw_auth_config = Rails.application.config_for(:auth)\nrescue RuntimeError, Errno::ENOENT, Psych::SyntaxError => e\n  Rails.logger.warn(\"Auth config not loaded: #{e.class} - #{e.message}\")\n  raw_auth_config = {}\nend\n\nauth_config = raw_auth_config.deep_symbolize_keys\n\nRails.configuration.x.auth.local_login_enabled = auth_config.dig(:local_login, :enabled)\nRails.configuration.x.auth.local_admin_override_enabled = auth_config.dig(:local_login, :admin_override_enabled)\n\nRails.configuration.x.auth.passkey_login_enabled = auth_config.dig(:passkey_login, :enabled)\n\nRails.configuration.x.auth.jit_mode = auth_config.dig(:jit, :mode) || \"create_and_link\"\n\nraw_domains = auth_config.dig(:jit, :allowed_oidc_domains).to_s\nRails.configuration.x.auth.allowed_oidc_domains = raw_domains.split(\",\").map(&:strip).reject(&:empty?)\n\nRails.configuration.x.auth.providers = (auth_config[:providers] || [])\n\n# These will be populated by the OmniAuth initializer once providers are","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/we-promise/sure/blob/e69894adb92547273377398c15f45c979cd9416a/config/initializers/auth.rb#L1-L26","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\n# config/auth.yml absent/malformed -> warn, auth falls back to defaults\n\n// after\n# config/auth.yml\nlocal_login:\n  enabled: true\npasskey_login:\n  enabled: false\njit:\n  mode: create_and_link","handlingStrategy":"fallback","validationCode":"path = Rails.root.join('config/auth.yml')\nYAML.safe_load(File.read(path)) if File.exist?(path) # raises on bad YAML before boot","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["rails","configuration","yaml","auth","startup-warning"],"backgroundTag":"config-file-load-failed","analyzedSha":"e69894adb92547273377398c15f45c979cd9416a","analyzedAt":"2026-08-21T18:22:41.165Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}