{"record":{"id":"9380d14d23f8b7e3","repo":"Tencent/WeKnora","slug":"create-poll-request-w","errorCode":null,"errorMessage":"create poll request: %w","messagePattern":"create poll request: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/paddleocr_vl_cloud_converter.go","lineNumber":202,"sourceCode":"\nfunc (c *PaddleOCRVLCloudReader) pollJob(ctx context.Context, jobID string) (string, error) {\n\tdeadline := time.Now().Add(paddleOCRVLCloudTimeout)\n\tpollCount := 0\n\turl := c.baseURL + \"/\" + jobID\n\n\tfor time.Now().Before(deadline) {\n\t\t// Bail out promptly when the caller cancels (task cancelled / timed\n\t\t// out) instead of spinning: client.Do would fail immediately and\n\t\t// sleepCtx returns at once on a cancelled ctx, so without this guard\n\t\t// the loop busy-hammers the cloud API and floods logs until deadline.\n\t\tif err := ctx.Err(); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tpollCount++\n\n\t\thttpReq, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"create poll request: %w\", err)\n\t\t}\n\t\thttpReq.Header.Set(\"Authorization\", \"bearer \"+c.token)\n\n\t\tclient := utils.NewSSRFSafeHTTPClient(utils.SSRFSafeHTTPClientConfig{Timeout: 30 * time.Second, MaxRedirects: 5})\n\t\tresp, err := client.Do(httpReq)\n\t\tif err != nil {\n\t\t\tlogger.Errorf(context.Background(), \"[PaddleOCR-VL Cloud] poll #%d failed: %v\", pollCount, err)\n\t\t\tsleepCtx(ctx, paddleOCRVLCloudPollInterval)\n\t\t\tcontinue\n\t\t}\n\t\trespBody, _ := io.ReadAll(resp.Body)\n\t\tresp.Body.Close()\n\n\t\tif resp.StatusCode != http.StatusOK {\n\t\t\tlogger.Errorf(context.Background(), \"[PaddleOCR-VL Cloud] poll #%d status %d: %s\", pollCount, resp.StatusCode, string(respBody))\n\t\t\tsleepCtx(ctx, paddleOCRVLCloudPollInterval)\n\t\t\tcontinue\n\t\t}","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/paddleocr_vl_cloud_converter.go#L184-L220","documentation":"HTTP client error in PaddleOCRVLCloudReader.pollJob: constructing the GET poll request for the job status URL failed at http.NewRequestWithContext. The %w keeps the net/http cause; it fires inside the polling loop after the cancellation guard passed, before the request is sent.","triggerScenarios":"Thrown at internal/infrastructure/docparser/paddleocr_vl_cloud_converter.go:202 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the base URL and job ID form a valid URL","Log the composed polling URL","Retry the Read flow if the URL config is corrected"],"exampleFix":null,"handlingStrategy":"try-catch","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"}