{"record":{"id":"731d9e25d51229ce","repo":"AlistGo/alist","slug":"yunpan-async-task-failed-errno-d","errorCode":null,"errorMessage":"yunpan async task failed: errno=%d","messagePattern":"yunpan async task failed: errno=(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/yunpan360/util.go","lineNumber":836,"sourceCode":"}\n\nfunc checkCookieAsyncTask(task CookieAsyncTask, toleratedErrnos map[int]struct{}) (bool, error) {\n\tif task.Status != 10 {\n\t\treturn false, nil\n\t}\n\tif task.Errno == 0 {\n\t\treturn true, nil\n\t}\n\tif _, ok := toleratedErrnos[task.Errno]; ok {\n\t\treturn true, nil\n\t}\n\tif strings.TrimSpace(task.Errstr) != \"\" {\n\t\treturn true, errors.New(task.Errstr)\n\t}\n\tif strings.TrimSpace(task.Action) != \"\" {\n\t\treturn true, fmt.Errorf(\"yunpan async task %s failed: errno=%d\", task.Action, task.Errno)\n\t}\n\treturn true, fmt.Errorf(\"yunpan async task failed: errno=%d\", task.Errno)\n}\n\nfunc (d *Yunpan360) openMove(ctx context.Context, srcName, dstPath string) error {\n\tsignParams := map[string]string{\n\t\t\"src_name\": srcName,\n\t\t\"new_name\": dstPath,\n\t}\n\treturn d.openPOST(ctx, \"File.move\", signParams, nil, signParams, nil, true)\n}\n\nfunc (d *Yunpan360) openDelete(ctx context.Context, targetPath string) error {\n\treturn d.openPOST(ctx, \"File.delete\", nil, nil, map[string]string{\n\t\t\"fname\": targetPath,\n\t}, nil, true)\n}\n\nfunc apiPathForObj(obj model.Obj) string {\n\tif obj.IsDir() {","sourceCodeStart":818,"sourceCodeEnd":854,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/yunpan360/util.go#L818-L854","documentation":"The fallback branch of checkCookieAsyncTask in the yunpan360 driver: an async task polled via /async/query reached terminal status 10 with a non-zero, non-tolerated errno, and the server returned neither errstr nor an Action name, so only the bare errno can be reported.","triggerScenarios":"Same polling path as the action-named variant: any cookie-mode async operation (recycle, batch ops) whose task completes with an error where task.Errstr and task.Action are both empty strings after TrimSpace.","commonSituations":"Upstream response schema change omitting errstr/action; account-level async job failures (expired session, quota, server error) reported as a bare code; new error codes not yet classified by the driver.","solutions":["Reproduce with logging of the full CookieAsyncQueryResp payload to recover any context the server omitted","Retry the operation once after refreshing the cookie session","Verify account state (quota, permissions, target existence) for the operation that created the task","Map the errno against 360 API docs; escalate or classify the code before tolerating it"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Go: bare errno with no server context — log the raw task record, then surface\nif err := d.waitCookieAsyncTask(ctx, taskID); err != nil {\n    if strings.Contains(err.Error(), \"yunpan async task failed: errno=\") {\n        log.Warnf().Err(err).Str(\"task_id\", taskID).Msg(\"yunpan async task failed without details\")\n    }\n    return err\n}","preventionTips":["Log full /async/query payloads during incidents to recover context the driver drops","Refresh the cookie session before large batch operations","Retry once; bare-errno failures frequently clear on a second attempt"],"tags":["yunpan360","async","driver","polling"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}