{"record":{"id":"65ee4f09980e7ba7","repo":"Tencent/WeKnora","slug":"weknoracloud-docreader-task-failed-s","errorCode":null,"errorMessage":"weknoracloud docreader task failed: %s","messagePattern":"weknoracloud docreader task failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/weknoracloud_http_reader.go","lineNumber":192,"sourceCode":"\t\t\treturn nil, err\n\t\t}\n\t\tswitch taskResp.Status {\n\t\tcase \"completed\":\n\t\t\tif taskResp.Result == nil {\n\t\t\t\tlogger.Infof(ctx, \"[WeKnoraCloud] task_id=%s completed with no result payload\", taskID)\n\t\t\t\treturn &types.ReadResult{}, nil\n\t\t\t}\n\t\t\tres := fromHTTPReadResponse(taskResp.Result)\n\t\t\tif res.Error != \"\" {\n\t\t\t\tlogger.Errorf(ctx, \"[WeKnoraCloud] task_id=%s completed with result.error: %s\", taskID, res.Error)\n\t\t\t} else {\n\t\t\t\tlogger.Debugf(ctx, \"[WeKnoraCloud] task_id=%s completed ok markdownLen=%d\", taskID, len(res.MarkdownContent))\n\t\t\t}\n\t\t\treturn res, nil\n\t\tcase \"failed\":\n\t\t\tif taskResp.Error != \"\" {\n\t\t\t\tlogger.Errorf(context.Background(), \"[WeKnoraCloud] task_id=%s failed: %s\", taskID, taskResp.Error)\n\t\t\t\treturn nil, fmt.Errorf(\"weknoracloud docreader task failed: %s\", taskResp.Error)\n\t\t\t}\n\t\t\tlogger.Errorf(context.Background(), \"[WeKnoraCloud] task_id=%s failed: %s\", taskID, taskResp.Message)\n\t\t\treturn nil, fmt.Errorf(\"weknoracloud docreader task failed: %s\", taskResp.Message)\n\t\tcase \"cancelled\":\n\t\t\tif taskResp.Error != \"\" {\n\t\t\t\tlogger.Errorf(context.Background(), \"[WeKnoraCloud] task_id=%s cancelled: %s\", taskID, taskResp.Error)\n\t\t\t\treturn nil, fmt.Errorf(\"weknoracloud docreader task cancelled: %s\", taskResp.Error)\n\t\t\t}\n\t\t\tlogger.Errorf(context.Background(), \"[WeKnoraCloud] task_id=%s cancelled\", taskID)\n\t\t\treturn nil, fmt.Errorf(\"weknoracloud docreader task cancelled\")\n\t\t}\n\t\tif err := pollCtx.Err(); err != nil {\n\t\t\tlogger.Errorf(ctx, \"[WeKnoraCloud] poll task_id=%s aborted before sleep: %v\", taskID, err)\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// Exponential backoff: multiply by 1.5 each time, cap at maxPollInterval\n\t\tselect {","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/weknoracloud_http_reader.go#L174-L210","documentation":"Fired in pollTaskResult when the async task reports status \"failed\" with a non-empty Error field. The remote document reader itself failed to process the file (unsupported format, corrupt content, internal reader error); the message carries the server-side error text.","triggerScenarios":"Thrown at internal/infrastructure/docparser/weknoracloud_http_reader.go:192 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the embedded task error to learn why the reader failed","Verify the file format is supported and the content is not corrupt","Adjust ParserEngine/ParserEngineOverrides if the engine rejected the file","Resubmit the read after fixing the input; do not retry blindly"],"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"}