we-promise/sure · error · Provider::YahooFinance::AuthenticationError
Failed to authenticate with Yahoo Finance: #{e.message}
Error message
Failed to authenticate with Yahoo Finance: #{e.message} What it means
Error "Failed to authenticate with Yahoo Finance: #{e.message}" thrown in we-promise/sure.
Source
Thrown at app/models/provider/yahoo_finance.rb:884
cache_key = "#{@cache_prefix}_auth_crumb"
cached = Rails.cache.read(cache_key)
if cached.present?
return cached if valid_crumb?(cached.second)
Rails.cache.delete(cache_key)
end
cookie, crumb, cache_duration = request_cookie_and_crumb(auth_client)
result = [ cookie, crumb ]
Rails.cache.write(cache_key, result, expires_in: cache_duration)
result
rescue Faraday::TooManyRequestsError => e
raise RateLimitError.new(
"Yahoo Finance rate limit exceeded",
details: { status: e.response&.dig(:status) }
)
rescue Faraday::Error => e
raise AuthenticationError, "Failed to authenticate with Yahoo Finance: #{e.message}"
end
def request_cookie_and_crumb(authentication_client)
cookie_response = authentication_client.get("https://fc.yahoo.com")
if cookie_response.respond_to?(:status) && cookie_response.status == 429
raise RateLimitError.new(
"Yahoo Finance rate limit exceeded",
details: { status: cookie_response.status }
)
end
cookie = extract_cookie(cookie_response)
cookie_max_age = extract_cookie_max_age(cookie_response)
raise AuthenticationError, "Failed to obtain Yahoo Finance cookie" if cookie.blank?
crumb_response = authentication_client.get("#{base_url}/v1/test/getcrumb") do |req|
req.headers["Cookie"] = cookie
endView on GitHub (pinned to e69894adb9)
When it happens
Trigger: Thrown at app/models/provider/yahoo_finance.rb:884 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
AI-assisted analysis of we-promise/sure@e69894adb9 (2026-08-21).
Data as JSON: /api/errors/226e1ce5ba82ab03.
Report an issue: GitHub.