{"record":{"id":"f6cf2f6fd80f56f2","repo":"larksuite/cli","slug":"official-skills-index-returned-http-d","errorCode":null,"errorMessage":"official skills index returned HTTP %d","messagePattern":"official skills index returned HTTP (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/selfupdate/updater.go","lineNumber":311,"sourceCode":"\t\treturn r\n\t}\n\n\tclient := transport.NewHTTPClient(0)\n\tclient.CheckRedirect = func(req *http.Request, via []*http.Request) error {\n\t\tif req.URL.Scheme != \"https\" {\n\t\t\treturn fmt.Errorf(\"official skills index redirected to non-HTTPS URL: %s\", req.URL.Redacted())\n\t\t}\n\t\treturn nil\n\t}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tr.Err = err\n\t\treturn r\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusMultipleChoices {\n\t\tr.Err = fmt.Errorf(\"official skills index returned HTTP %d\", resp.StatusCode)\n\t\treturn r\n\t}\n\n\tlimited := io.LimitReader(resp.Body, skillsIndexMaxBodySize+1)\n\tif _, err := io.Copy(&r.Stdout, limited); err != nil {\n\t\tr.Err = err\n\t\treturn r\n\t}\n\tif r.Stdout.Len() > skillsIndexMaxBodySize {\n\t\tr.Stdout.Reset()\n\t\tr.Err = fmt.Errorf(\"official skills index exceeds %d bytes\", skillsIndexMaxBodySize)\n\t\treturn r\n\t}\n\treturn r\n}\n\nfunc (u *Updater) ListGlobalSkills() *NpmResult {\n\treturn u.runSkillsListGlobal()","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/selfupdate/updater.go#L293-L329","documentation":"FetchSkillsIndex recorded on its result that the official skills index endpoint answered with a status outside 2xx; non-HTTPS redirects were already rejected earlier by the CheckRedirect hook, so this is a server-side index availability failure.","triggerScenarios":"Calling Updater.FetchSkillsIndex(source) when the skills-index endpoint responds with a non-2xx status — 404 for a bad/removed index path, 403 for blocked access, 429 rate limiting, or 5xx server errors.","commonSituations":"Index URL changed or versioned path removed (404); auth required by an internal mirror (401/403); rate limiting by the CDN (429); upstream outage (500/502/503); proxy returning an error page.","solutions":["Read the HTTP status in the message: for 404 verify the skills-index URL/source is current, for 403/401 check access/auth to the mirror","For 429 wait and retry later (respect rate limits) or reduce polling frequency","For 5xx check the service status of the index host and retry after the outage","Check proxy/VPN configuration that may be intercepting requests to the index host"],"exampleFix":"// before\nres := updater.FetchSkillsIndex(source)\nif res.Err != nil { log.Fatal(res.Err) }\n// after\nres := updater.FetchSkillsIndex(source)\nif res.Err != nil {\n\tvar statusMsg string\n\tif _, err := fmt.Sscanf(res.Err.Error(), \"official skills index returned HTTP %s\", &statusMsg); err == nil && strings.HasPrefix(statusMsg, \"5\") {\n\t\tlog.Printf(\"index host error, retrying later: %v\", res.Err)\n\t} else {\n\t\tlog.Fatal(res.Err)\n\t}\n}","handlingStrategy":"retry","validationCode":"resp, err := http.Head(indexURL)\nif err == nil && (resp.StatusCode < 200 || resp.StatusCode >= 300) { /* endpoint unhealthy; fix URL/auth before FetchSkillsIndex */ }","typeGuard":null,"tryCatchPattern":"res := updater.FetchSkillsIndex(source)\nif res.Err != nil {\n\tif strings.Contains(res.Err.Error(), \"returned HTTP 5\") || strings.Contains(res.Err.Error(), \"HTTP 429\") {\n\t\t// transient: retry with backoff\n\t} else {\n\t\treturn res.Err // 404/403: fix URL or access\n\t}\n}","preventionTips":["Pin to the current, documented skills-index URL","Check auth requirements on internal mirrors before fetching","Back off on 429 instead of hammering the endpoint","Monitor index host status for 5xx outages"],"tags":["http","network","selfupdate","status-code"],"backgroundTag":"http-request-failed","analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}