{"record":{"id":"2d9d135efe696e12","repo":"Tencent/WeKnora","slug":"weknoracloud-docreader-submit-response-missing-tas","errorCode":null,"errorMessage":"weknoracloud docreader submit response missing task_id","messagePattern":"weknoracloud docreader submit response missing task_id","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/weknoracloud_http_reader.go","lineNumber":115,"sourceCode":"\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\"`\n\tCreatedAt int64  `json:\"created_at\"`\n}\n\ntype weKnoraCloudAsyncTaskResponse struct {\n\tTaskID    string            `json:\"task_id\"`\n\tStatus    string            `json:\"status\"`\n\tMessage   string            `json:\"message\"`\n\tProgress  float64           `json:\"progress\"`\n\tResult    *httpReadResponse `json:\"result\"`","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/weknoracloud_http_reader.go#L97-L133","documentation":"Fired in Read when the submit response decoded successfully but contains no task_id. The async read workflow cannot proceed without a task identifier, so this indicates a contract violation by the WeKnoraCloud service (or a schema drift in the response struct).","triggerScenarios":"Thrown at internal/infrastructure/docparser/weknoracloud_http_reader.go:115 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Dump the decoded submit response to confirm the field name/tag mapping","Check for API version drift between client struct tags and server payload","Treat as a service defect and report; retrying is unlikely to help until the server is fixed"],"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"}