{"record":{"id":"eaacf157988b759b","repo":"glanceapp/glance","slug":"w-could-not-fetch-data-for-d-market-s","errorCode":null,"errorMessage":"%w: could not fetch data for %d market(s)","messagePattern":"%w: could not fetch data for (.+?) market\\(s\\)","errorType":"exception","errorClass":"errPartialContent","httpStatus":null,"severity":"warning","filePath":"internal/glance/widget-markets.go","lineNumber":199,"sourceCode":"\t\t\tPriceHint:     result.Meta.PriceHint,\n\t\t\tName: ternary(marketRequests[i].CustomName == \"\",\n\t\t\t\tresult.Meta.ShortName,\n\t\t\t\tmarketRequests[i].CustomName,\n\t\t\t),\n\t\t\tPercentChange: percentChange(\n\t\t\t\tresult.Meta.RegularMarketPrice,\n\t\t\t\tprevious,\n\t\t\t),\n\t\t\tSvgChartPoints: points,\n\t\t})\n\t}\n\n\tif len(markets) == 0 {\n\t\treturn nil, errNoContent\n\t}\n\n\tif failed > 0 {\n\t\treturn markets, fmt.Errorf(\"%w: could not fetch data for %d market(s)\", errPartialContent, failed)\n\t}\n\n\treturn markets, nil\n}\n\nvar currencyToSymbol = map[string]string{\n\t\"USD\": \"$\",\n\t\"EUR\": \"€\",\n\t\"JPY\": \"¥\",\n\t\"CAD\": \"C$\",\n\t\"AUD\": \"A$\",\n\t\"GBP\": \"£\",\n\t\"CHF\": \"Fr\",\n\t\"NZD\": \"N$\",\n\t\"INR\": \"₹\",\n\t\"BRL\": \"R$\",\n\t\"RUB\": \"₽\",\n\t\"TRY\": \"₺\",","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/widget-markets.go#L181-L217","documentation":"Partial-content warning from the markets widget: one or more symbols failed to fetch from Yahoo Finance, but at least one succeeded. The successfully fetched markets are returned together with errPartialContent, and each failure is logged with its symbol and error. Count of failed symbols is included.","triggerScenarios":"Some GET chart/<symbol> requests fail while others succeed: invalid ticker symbol (Yahoo returns non-200), per-symbol rate limiting, or transient network errors for a subset of the parallel requests.","commonSituations":"Typo'd ticker (e.g. 'APL' instead of 'AAPL'); Yahoo rate limiting burst requests from one IP; symbols delisted or renamed; intermittent egress issues.","solutions":["Check the glance log lines 'Failed to fetch market data' to see which symbol(s) failed and why","Correct or remove invalid/delisted ticker symbols","Reduce the number of symbols or stagger updates if Yahoo is rate limiting","If all symbols fail intermittently, verify connectivity to query1.finance.yahoo.com"],"exampleFix":"# before\n  markets:\n    - symbol: APL\n# after\n  markets:\n    - symbol: AAPL","handlingStrategy":"fallback","validationCode":"func validSymbols(symbols []string) []string {\n    out := make([]string, 0, len(symbols))\n    for _, s := range symbols {\n        if regexp.MustCompile(`^[A-Za-z0-9.\\-=^]{1,12}$`).MatchString(s) {\n            out = append(out, s)\n        }\n    }\n    return out\n}","typeGuard":null,"tryCatchPattern":"markets, err := fetchMarketsDataFromYahoo(reqs)\nif errors.Is(err, errPartialContent) {\n    slog.Warn(\"some market symbols failed\", \"error\", err)\n    return markets, nil // render the successful subset\n}\nif err != nil { return nil, err }","preventionTips":["Validate ticker symbols against a strict charset regex before requesting","Watch the 'Failed to fetch market data' log lines to prune dead symbols early","Space out or reduce symbol counts if Yahoo rate limits your IP"],"tags":["markets","yahoo-finance","partial-content","rate-limit"],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}