{"record":{"id":"fc65c20c77f2f260","repo":"AlistGo/alist","slug":"upload-task-s-timeout","errorCode":null,"errorMessage":"upload task %s timeout","messagePattern":"upload task (.+?) timeout","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"drivers/guangyapan/driver.go","lineNumber":964,"sourceCode":"\t\t}\n\t\tswitch out.Code {\n\t\tcase 145, 146, 147, 155, 163, 0:\n\t\t\t// uploading/verifying/processing\n\t\tdefault:\n\t\t\tif strings.TrimSpace(out.Msg) != \"\" {\n\t\t\t\treturn fmt.Errorf(\"upload task failed: code=%d msg=%s\", out.Code, strings.TrimSpace(out.Msg))\n\t\t\t}\n\t\t}\n\t\tif i == maxTry-1 {\n\t\t\tbreak\n\t\t}\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn ctx.Err()\n\t\tcase <-time.After(interval):\n\t\t}\n\t}\n\treturn fmt.Errorf(\"upload task %s timeout\", taskID)\n}\n\nfunc (d *GuangYaPan) multipartUploadToOSS(ctx context.Context, bucket *oss.Bucket, objectPath string, file model.FileStreamer, up driver.UpdateProgress) error {\n\tpartSize := calcUploadPartSize(file.GetSize())\n\timur, err := bucket.InitiateMultipartUpload(objectPath, oss.Sequential())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttotal := file.GetSize()\n\tpartCount := int((total + partSize - 1) / partSize)\n\tparts := make([]oss.UploadPart, 0, partCount)\n\tvar uploaded int64\n\tpartNumber := 1\n\n\tfor uploaded < total {\n\t\tif err := ctx.Err(); err != nil {\n\t\t\treturn err","sourceCodeStart":946,"sourceCodeEnd":982,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/guangyapan/driver.go#L946-L982","documentation":"waitUploadTaskInfo exhausted its polling budget without FileID appearing, a terminal code, or an error msg - the upload task stayed in an in-progress state (codes 145/146/147/155/163/0) the whole time. Like the waitTaskDone timeout, the task may still finish server-side.","triggerScenarios":"Large files whose server-side verification/processing outlasts the fixed poll window after the OSS multipart upload completed.","commonSituations":"Uploading multi-GB files where ingest takes minutes; provider under load; the poll budget being tuned for small files.","solutions":["Re-list the destination after a delay - the file usually appears once processing completes.","Retry the upload if the file never lands.","Driver maintainers can scale maxTry/interval with file size."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := d.waitUploadTaskInfo(ctx, taskID); err != nil {\n    if strings.Contains(err.Error(), \"timeout\") {\n        // fallback: verify by listing instead of failing the upload\n        time.Sleep(5 * time.Second)\n        if obj, _ := d.getObjByPath(ctx, objectPath); obj != nil {\n            return nil // upload actually completed\n        }\n    }\n    return err\n}","preventionTips":["For multi-GB uploads, verify via destination listing rather than trusting the poll window.","Expect longer ingest times under provider load and pad waits accordingly."],"tags":["upload","timeout","task-polling","guangyapan"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}