{"record":{"id":"e475299b596d0d54","repo":"glanceapp/glance","slug":"w-v","errorCode":null,"errorMessage":"%w: %v","messagePattern":"%w: %v","errorType":"exception","errorClass":"errNoContent","httpStatus":null,"severity":"error","filePath":"internal/glance/widget-markets.go","lineNumber":136,"sourceCode":"\t} `json:\"chart\"`\n}\n\n// TODO: allow changing chart time frame\nconst marketChartDays = 21\n\nfunc fetchMarketsDataFromYahoo(marketRequests []marketRequest) (marketList, error) {\n\trequests := make([]*http.Request, 0, len(marketRequests))\n\n\tfor i := range marketRequests {\n\t\trequest, _ := http.NewRequest(\"GET\", fmt.Sprintf(\"https://query1.finance.yahoo.com/v8/finance/chart/%s?range=1mo&interval=1d\", marketRequests[i].Symbol), nil)\n\t\tsetBrowserUserAgentHeader(request)\n\t\trequests = append(requests, request)\n\t}\n\n\tjob := newJob(decodeJsonFromRequestTask[marketResponseJson](defaultHTTPClient), requests)\n\tresponses, errs, err := workerPoolDo(job)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%w: %v\", errNoContent, err)\n\t}\n\n\tmarkets := make(marketList, 0, len(responses))\n\tvar failed int\n\n\tfor i := range responses {\n\t\tif errs[i] != nil {\n\t\t\tfailed++\n\t\t\tslog.Error(\"Failed to fetch market data\", \"symbol\", marketRequests[i].Symbol, \"error\", errs[i])\n\t\t\tcontinue\n\t\t}\n\n\t\tresponse := responses[i]\n\n\t\tif len(response.Chart.Result) == 0 {\n\t\t\tfailed++\n\t\t\tslog.Error(\"Market response contains no data\", \"symbol\", marketRequests[i].Symbol)\n\t\t\tcontinue","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/widget-markets.go#L118-L154","documentation":"The worker pool itself failed before/independent of per-symbol results while fetching Yahoo Finance chart data (query1.finance.yahoo.com/v8/finance/chart/...). Wrapped with errNoContent; individual symbol failures are counted separately, so this indicates a job-level failure (e.g. zero requests or pool error), not a market data problem.","triggerScenarios":"workerPoolDo returning a job-level error — most realistically zero market requests (empty symbol list) or an internal pool failure; per-request network failures go to errs[i] instead.","commonSituations":"Misconfigured markets widget with an empty symbol list; transient worker-pool exhaustion under heavy widget load.","solutions":["Confirm the markets widget has at least one valid symbol configured","Check glance logs for the '%v' detail to identify the pool-level cause","Verify egress to query1.finance.yahoo.com for the sibling per-symbol errors"],"exampleFix":"# before\n- type: markets\n  markets: []\n# after\n- type: markets\n  markets:\n    - symbol: SPY","handlingStrategy":"validation","validationCode":"if len(marketRequests) == 0 {\n    return nil, fmt.Errorf(\"no market symbols configured\")\n}","typeGuard":null,"tryCatchPattern":"markets, err := fetchMarketsDataFromYahoo(reqs)\nif err != nil {\n    if errors.Is(err, errNoContent) {\n        return widget.lastGoodMarkets, nil // keep previous cycle on total failure\n    }\n    return nil, err\n}","preventionTips":["Require at least one symbol in the markets widget config schema","Verify egress to query1.finance.yahoo.com in deployment checks"],"tags":["markets","yahoo-finance","worker-pool","configuration"],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}