{"record":{"id":"2429530596b6ecb1","repo":"we-promise/sure","slug":"no-metadata-returned-for-symbol-av-symbol","errorCode":null,"errorMessage":"No metadata returned for symbol #{av_symbol}","messagePattern":"No metadata returned for symbol #(.+?)","errorType":"exception","errorClass":"Provider::AlphaVantage::Error","httpStatus":null,"severity":"error","filePath":"app/models/provider/alpha_vantage.rb","lineNumber":148,"sourceCode":"    end\n  end\n\n  def fetch_security_info(symbol:, exchange_operating_mic:)\n    with_provider_response do\n      av_symbol = to_av_symbol(symbol, exchange_operating_mic)\n\n      throttle_request\n      response = client.get(\"#{base_url}/query\") do |req|\n        req.params[\"function\"] = \"OVERVIEW\"\n        req.params[\"symbol\"] = av_symbol\n      end\n\n      parsed = JSON.parse(response.body)\n      check_api_error!(parsed)\n\n      name = parsed[\"Name\"]\n      if name.blank?\n        raise Error, \"No metadata returned for symbol #{av_symbol}\"\n      end\n\n      SecurityInfo.new(\n        symbol: parsed[\"Symbol\"] || symbol,\n        name: name,\n        links: parsed[\"OfficialSite\"].presence,\n        logo_url: nil,\n        description: parsed[\"Description\"].presence,\n        kind: parsed[\"AssetType\"]&.downcase,\n        exchange_operating_mic: exchange_operating_mic\n      )\n    end\n  end\n\n  def fetch_security_price(symbol:, exchange_operating_mic: nil, date:)\n    with_provider_response do\n      historical_data = fetch_security_prices(symbol:, exchange_operating_mic:, start_date: date, end_date: date)\n","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/we-promise/sure/blob/e69894adb92547273377398c15f45c979cd9416a/app/models/provider/alpha_vantage.rb#L130-L166","documentation":"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'.","triggerScenarios":"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.","commonSituations":"User-added custom security with a typo; symbol from another data provider that AV names differently; recently delisted instruments.","solutions":["Verify the symbol on Alpha Vantage's site; correct the ticker or remove the mapping.","Check to_av_symbol: pass the right exchange_operating_mic so the suffix (e.g. .LON) matches the listing.","Strip/normalize the symbol (uppercase, no whitespace) before requesting.","Rescue this error and mark the security info as unavailable instead of failing the whole sync."],"exampleFix":"# before\ninfo = provider.fetch_security_info(symbol: \"BRK.B\")\n\n# after\nbegin\n  info = provider.fetch_security_info(symbol: symbol.upcase.strip)\nrescue Provider::AlphaVantage::Error\n  info = nil # leave security info blank, do not fail the sync\nend","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"begin\n  provider.fetch_security_info(symbol: sym)\nrescue Provider::AlphaVantage::Error => e\n  Rails.logger.warn(\"no AV metadata for #{sym}: #{e.message}\")\n  nil # leave info blank; do not fail the whole sync\nend","preventionTips":["Resolve/verify tickers via search_securities before OVERVIEW calls.","Pass the correct exchange_operating_mic so the AV suffix mapping is right.","Treat 'no metadata' as symbol-not-found: mark the security, alert the user, move on."],"tags":["alpha-vantage","provider","symbol-not-found","ruby"],"backgroundTag":"symbol-not-found","analyzedSha":"e69894adb92547273377398c15f45c979cd9416a","analyzedAt":"2026-08-21T18:22:41.165Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}