{"record":{"id":"2bc26ef0b2562f53","repo":"Tencent/WeKnora","slug":"mineru-cloud-task-timed-out-after-d-polls","errorCode":null,"errorMessage":"MinerU Cloud task timed out after %d polls","messagePattern":"MinerU Cloud task timed out after (.+?) polls","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/mineru_cloud_converter.go","lineNumber":261,"sourceCode":"\t\tstate := strings.ToLower(item.State)\n\n\t\tif pollCount == 1 || pollCount%10 == 0 || state == \"done\" || state == \"failed\" {\n\t\t\tlogger.Infof(context.Background(), \"[MinerUCloud] poll #%d: file=%s state=%s pages=%d/%d\",\n\t\t\t\tpollCount, item.FileName, state, item.Progress.ExtractedPages, item.Progress.TotalPages)\n\t\t}\n\n\t\tif state == \"failed\" {\n\t\t\treturn \"\", nil, fmt.Errorf(\"MinerU Cloud task failed: %s\", item.ErrMsg)\n\t\t}\n\n\t\tif state == \"done\" {\n\t\t\treturn c.extractDoneResult(ctx, &item)\n\t\t}\n\n\t\tsleepCtx(ctx, defaultPollInterval)\n\t}\n\n\treturn \"\", nil, fmt.Errorf(\"MinerU Cloud task timed out after %d polls\", pollCount)\n}\n\nfunc (c *MinerUCloudReader) fetchBatchStatus(ctx context.Context, batchID string, headers map[string]string) ([]extractResultItem, error) {\n\turl := fmt.Sprintf(\"%s/extract-results/batch/%s\", c.baseURL, batchID)\n\thttpReq, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor k, v := range headers {\n\t\thttpReq.Header.Set(k, v)\n\t}\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 nil, err\n\t}\n\tdefer resp.Body.Close()","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/mineru_cloud_converter.go#L243-L279","documentation":"pollBatchResult exhausted its poll budget while the MinerU Cloud extraction task never reached done/failed — the cloud job is stuck or extremely slow, so the wait is abandoned with the poll count reported.","triggerScenarios":"Thrown at internal/infrastructure/docparser/mineru_cloud_converter.go:261 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the whole Read; the job may complete later","Increase the poll timeout for very large documents","Check MinerU Cloud service status if timeouts recur"],"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"}