{"record":{"id":"755087b1f624c37e","repo":"Tencent/WeKnora","slug":"http-read-status-d-s-755087","errorCode":null,"errorMessage":"http read status %d: %s","messagePattern":"http read status (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/weknoracloud_http_reader.go","lineNumber":106,"sourceCode":"\tif err != nil {\n\t\tlogger.Errorf(context.Background(), \"[WeKnoraCloud] marshal read request: %v\", err)\n\t\treturn nil, fmt.Errorf(\"http marshal read request: %w\", err)\n\t}\n\thttpReq, err := p.newSignedRequest(ctx, http.MethodPost, weKnoraCloudReaderBaseURL+\"/reader\", jsonBody)\n\tif err != nil {\n\t\tlogger.Errorf(context.Background(), \"[WeKnoraCloud] signed read request: %v\", err)\n\t\treturn nil, err\n\t}\n\tresp, err := p.client.Do(httpReq)\n\tif err != nil {\n\t\tlogger.Errorf(context.Background(), \"[WeKnoraCloud] http read request failed: %v\", err)\n\t\treturn nil, fmt.Errorf(\"http read failed: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != http.StatusAccepted && resp.StatusCode != http.StatusOK {\n\t\tbodyBytes, _ := io.ReadAll(resp.Body)\n\t\tlogger.Errorf(context.Background(), \"[WeKnoraCloud] http read unexpected status %d: %s\", resp.StatusCode, string(bodyBytes))\n\t\treturn nil, fmt.Errorf(\"http read status %d: %s\", resp.StatusCode, string(bodyBytes))\n\t}\n\tvar submit weKnoraCloudAsyncSubmitResponse\n\tif err := json.NewDecoder(resp.Body).Decode(&submit); err != nil {\n\t\tlogger.Errorf(context.Background(), \"[WeKnoraCloud] decode read submit response: %v\", err)\n\t\treturn nil, fmt.Errorf(\"http decode read submit response: %w\", err)\n\t}\n\tif strings.TrimSpace(submit.TaskID) == \"\" {\n\t\tlogger.Errorf(context.Background(), \"[WeKnoraCloud] submit response missing task_id (status=%q message=%q)\", submit.Status, submit.Message)\n\t\treturn nil, fmt.Errorf(\"weknoracloud docreader submit response missing task_id\")\n\t}\n\tlogger.Infof(ctx, \"[WeKnoraCloud] task submitted task_id=%s file=%q type=%q\", submit.TaskID, req.FileName, req.FileType)\n\treturn p.pollTaskResult(ctx, submit.TaskID)\n}\n\ntype weKnoraCloudAsyncSubmitResponse struct {\n\tTaskID    string `json:\"task_id\"`\n\tStatus    string `json:\"status\"`\n\tMessage   string `json:\"message\"`","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/weknoracloud_http_reader.go#L88-L124","documentation":"Fired in Read when the WeKnoraCloud /reader endpoint answered with a status other than 202/200. The response body is included in the message, so it usually points to an auth/signature rejection (401/403), a bad request payload (400), or a server-side failure (5xx).","triggerScenarios":"Thrown at internal/infrastructure/docparser/weknoracloud_http_reader.go:106 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the embedded response body for the server's error detail","On 401/403 verify signing credentials and clock skew","On 400 validate FileName/FileType/ParserEngine and URL format","On 5xx retry with backoff; on 4xx fix the request, do not retry"],"exampleFix":null,"handlingStrategy":"fallback","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"}