{"record":{"id":"52cd4c9e52942a0c","repo":"larksuite/cli","slug":"index-request-failed-s","errorCode":null,"errorMessage":"index request failed: %s","messagePattern":"index request failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/skillscheck/sync.go","lineNumber":352,"sourceCode":"\t}\n\n\tif targetLayout == LayoutSuite {\n\t\treturn &SyncResult{\n\t\t\tAction: \"failed\",\n\t\t\tLayout: targetLayout,\n\t\t\tErr:    fmt.Errorf(\"suite skills sync failed: %s\", strings.Join(reasons, \"; \")),\n\t\t\tDetail: strings.Join(reasons, \"\\n\"),\n\t\t\tForce:  opts.Force,\n\t\t}\n\t}\n\n\treturn fallbackSeparate(opts, previous, readable, localOfficial, installed, fallbackPlan, reasons)\n}\n\nfunc fetchOfficialSkills(runner SkillsRunner, source string) ([]string, error) {\n\tresult := runner.FetchSkillsIndex(source)\n\tif result == nil || result.Err != nil {\n\t\treturn nil, fmt.Errorf(\"index request failed: %s\", resultDetail(result))\n\t}\n\tofficial, err := ParseOfficialSkillsIndexJSON(result.Stdout.String())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid v0.2 index: %w\", err)\n\t}\n\tif len(official) == 0 {\n\t\treturn nil, fmt.Errorf(\"v0.2 index contains no skills\")\n\t}\n\treturn official, nil\n}\n\nfunc listInstalledSkills(runner SkillsRunner) ([]installedSkill, error) {\n\tjsonResult := runner.ListGlobalSkillsJSON()\n\tif jsonResult != nil && jsonResult.Err == nil {\n\t\tif installed, err := parseInstalledSkillsJSON(jsonResult.Stdout.String()); err == nil {\n\t\t\treturn installed, nil\n\t\t}\n\t}","sourceCodeStart":334,"sourceCodeEnd":370,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/skillscheck/sync.go#L334-L370","documentation":"fetchOfficialSkills wraps the result of Runner.FetchSkillsIndex(source). It returns this error when the runner returns nil or result.Err != nil, i.e. the HTTP/command request to fetch the skills index itself failed before any parsing. resultDetail(result) appends whatever diagnostic the runner captured (transport error, non-zero exit, empty stdout).","triggerScenarios":"SyncSkills -> fetchOfficialSkills where FetchSkillsIndex returns nil, or a result with Err set (network failure, command error, non-2xx response, missing output).","commonSituations":"Offline or behind a corporate proxy; DNS failure for the index host; TLS interception rejecting the certificate; the source URL misconfigured in SkillsSources(); the underlying CLI command the runner shells out to is not installed or fails.","solutions":["Check network reachability of the skills index host (curl the source URL) and configure proxy env vars (HTTP_PROXY/HTTPS_PROXY) if needed","Fix the source URL in the runner's SkillsSources() configuration","Verify the underlying skills CLI/command used by FetchSkillsIndex is installed and runs (run it manually and check its stderr)","Read the appended resultDetail text for the exact transport or command error","Try the next source in SkillsSources(); if all fail, the sync aborts or falls back"],"exampleFix":"// debugging: reproduce the fetch manually\nresult := runner.FetchSkillsIndex(source)\nif result == nil || result.Err != nil {\n    log.Printf(\"index fetch failed for %s: %s\", source, resultDetail(result))\n    // check proxy / DNS / CLI availability before retrying\n}","handlingStrategy":"retry","validationCode":"resp, err := http.Get(sourceURL)\nif err != nil || resp.StatusCode != http.StatusOK {\n    return fmt.Errorf(\"index endpoint not reachable: %v/%d\", err, statusCodeOf(resp))\n}","typeGuard":null,"tryCatchPattern":"official, err := fetchOfficialSkills(runner, source)\nif err != nil && strings.HasPrefix(err.Error(), \"index request failed\") {\n    // transient transport failure: back off and retry, then fall through to next source\n    time.Sleep(backoff)\n    official, err = fetchOfficialSkills(runner, source)\n}","preventionTips":["Configure HTTP_PROXY/HTTPS_PROXY in restricted network environments","Verify source URLs with curl before wiring them into SkillsSources()","Ensure the underlying skills CLI used by FetchSkillsIndex is installed and on PATH","Implement multi-source fallback so one unreachable source does not abort sync"],"tags":["go","network","http","skills-index"],"backgroundTag":"index-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"}