{"record":{"id":"0266466bcf59b6d4","repo":"Tencent/WeKnora","slug":"http-request-w","errorCode":null,"errorMessage":"HTTP request: %w","messagePattern":"HTTP request: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/mineru_cloud_converter.go","lineNumber":142,"sourceCode":"\t\t\"language\":       c.language,\n\t}\n\n\tbody, err := json.Marshal(payload)\n\tif err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"marshal payload: %w\", err)\n\t}\n\n\thttpReq, err := http.NewRequestWithContext(ctx, http.MethodPost, c.baseURL+\"/file-urls/batch\", bytes.NewReader(body))\n\tif err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"create request: %w\", err)\n\t}\n\thttpReq.Header.Set(\"Authorization\", \"Bearer \"+c.apiKey)\n\thttpReq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := utils.NewSSRFSafeHTTPClient(utils.SSRFSafeHTTPClientConfig{Timeout: 30 * time.Second, MaxRedirects: 5})\n\tresp, err := client.Do(httpReq)\n\tif err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"HTTP request: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\trespBody, _ := io.ReadAll(resp.Body)\n\t\treturn \"\", \"\", fmt.Errorf(\"API status %d: %s\", resp.StatusCode, string(respBody))\n\t}\n\n\tvar result batchApplyResponse\n\tif err := json.NewDecoder(resp.Body).Decode(&result); err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"decode response: %w\", err)\n\t}\n\tif result.Code != 0 {\n\t\treturn \"\", \"\", fmt.Errorf(\"API error: %s\", result.Msg)\n\t}\n\tif len(result.Data.FileURLs) == 0 {\n\t\treturn \"\", \"\", fmt.Errorf(\"API returned no file_urls\")\n\t}","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/mineru_cloud_converter.go#L124-L160","documentation":"Transport error in MinerUCloudReader.applyUploadURLs: the SSRF-safe HTTP client's Do() for the /file-urls/batch POST failed. The %w wraps the network cause (DNS, timeout, TLS); it fires after the request was built and signed, distinguishing network failure from the API-status and decode errors handled below.","triggerScenarios":"Thrown at internal/infrastructure/docparser/mineru_cloud_converter.go:142 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check network reachability to the MinerU Cloud API","Verify the configured base URL and SSRF client settings","Retry; transport failures are typically transient"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}