we-promise/sure · error · Provider::AlphaVantage::Error

No metadata returned for symbol #{av_symbol}

Error message

No metadata returned for symbol #{av_symbol}

What it means

The OVERVIEW fetch raises Provider::AlphaVantage::Error 'No metadata returned for symbol X' when the parsed response has a blank 'Name' field. Alpha Vantage returns HTTP 200 with an empty/near-empty object for symbols it does not know (invalid ticker, wrong exchange suffix, or delisted), so a missing Name is effectively 'symbol not found'.

Source

Thrown at app/models/provider/alpha_vantage.rb:148

    end
  end

  def fetch_security_info(symbol:, exchange_operating_mic:)
    with_provider_response do
      av_symbol = to_av_symbol(symbol, exchange_operating_mic)

      throttle_request
      response = client.get("#{base_url}/query") do |req|
        req.params["function"] = "OVERVIEW"
        req.params["symbol"] = av_symbol
      end

      parsed = JSON.parse(response.body)
      check_api_error!(parsed)

      name = parsed["Name"]
      if name.blank?
        raise Error, "No metadata returned for symbol #{av_symbol}"
      end

      SecurityInfo.new(
        symbol: parsed["Symbol"] || symbol,
        name: name,
        links: parsed["OfficialSite"].presence,
        logo_url: nil,
        description: parsed["Description"].presence,
        kind: parsed["AssetType"]&.downcase,
        exchange_operating_mic: exchange_operating_mic
      )
    end
  end

  def fetch_security_price(symbol:, exchange_operating_mic: nil, date:)
    with_provider_response do
      historical_data = fetch_security_prices(symbol:, exchange_operating_mic:, start_date: date, end_date: date)

View on GitHub (pinned to e69894adb9)

Solutions

  1. Verify the symbol on Alpha Vantage's site; correct the ticker or remove the mapping.
  2. Check to_av_symbol: pass the right exchange_operating_mic so the suffix (e.g. .LON) matches the listing.
  3. Strip/normalize the symbol (uppercase, no whitespace) before requesting.
  4. Rescue this error and mark the security info as unavailable instead of failing the whole sync.

Example fix

# before
info = provider.fetch_security_info(symbol: "BRK.B")

# after
begin
  info = provider.fetch_security_info(symbol: symbol.upcase.strip)
rescue Provider::AlphaVantage::Error
  info = nil # leave security info blank, do not fail the sync
end
Defensive patterns

Strategy: try-catch

Try / catch

begin
  provider.fetch_security_info(symbol: sym)
rescue Provider::AlphaVantage::Error => e
  Rails.logger.warn("no AV metadata for #{sym}: #{e.message}")
  nil # leave info blank; do not fail the whole sync
end

Prevention

When it happens

Trigger: fetch_security_info for a ticker that does not exist on Alpha Vantage; symbol converted with the wrong MIC suffix (e.g. XLON mapped suffix on a US ticker); delisted security; symbol casing/whitespace issues.

Common situations: User-added custom security with a typo; symbol from another data provider that AV names differently; recently delisted instruments.

Related errors


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