we-promise/sure · error · Provider::YahooFinance::AuthenticationError

Failed to obtain Yahoo Finance cookie

Error message

Failed to obtain Yahoo Finance cookie

What it means

Error "Failed to obtain Yahoo Finance cookie" thrown in we-promise/sure.

Source

Thrown at app/models/provider/yahoo_finance.rb:898

        "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
      end
      if crumb_response.status == 429
        raise RateLimitError.new(
          "Yahoo Finance rate limit exceeded",
          details: { status: crumb_response.status }
        )
      end
      unless crumb_response.success?
        raise AuthenticationError.new(
          "Failed to obtain Yahoo Finance crumb",
          details: { status: crumb_response.status }
        )
      end

      crumb = crumb_response.body.to_s.strip

View on GitHub (pinned to e69894adb9)

When it happens

Trigger: Thrown at app/models/provider/yahoo_finance.rb:898 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of we-promise/sure@e69894adb9 (2026-08-21). Data as JSON: /api/errors/f2a863ecf842ccb1. Report an issue: GitHub.