{"record":{"id":"fde5882502937ca9","repo":"AlistGo/alist","slug":"yunpan-request-failed-errno-d","errorCode":null,"errorMessage":"yunpan request failed: errno=%d","messagePattern":"yunpan request failed: errno=(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/yunpan360/util.go","lineNumber":80,"sourceCode":"\t\t\t\"Cookie\":           d.Cookie,\n\t\t\t\"Origin\":           baseURL,\n\t\t\t\"Referer\":          baseURL + \"/file/index\",\n\t\t\t\"X-Requested-With\": \"XMLHttpRequest\",\n\t\t}).\n\t\tSetFormData(form)\n\n\tres, err := req.Execute(http.MethodPost, baseURL+apiPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar baseResp BaseResp\n\tif err := utils.Json.Unmarshal(res.Body(), &baseResp); err != nil {\n\t\treturn err\n\t}\n\tif baseResp.Errno != 0 {\n\t\tif baseResp.Errmsg == \"\" {\n\t\t\treturn fmt.Errorf(\"yunpan request failed: errno=%d\", baseResp.Errno)\n\t\t}\n\t\treturn errors.New(baseResp.Errmsg)\n\t}\n\tif out == nil {\n\t\treturn nil\n\t}\n\treturn utils.Json.Unmarshal(res.Body(), out)\n}\n\nfunc requestPath(dirPath string) string {\n\tpath := normalizeRemotePath(dirPath)\n\tif path == \"\" {\n\t\treturn \"/\"\n\t}\n\treturn path\n}\n\nfunc requestOrder(order string) string {","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/yunpan360/util.go#L62-L98","documentation":"Thrown by yunpan360's cookieRequestForm when a POST to www.yunpan.com decoded successfully but BaseResp.Errno is non-zero with an empty Errmsg. This is the generic (non-upload) request path used for list, download, and other form APIs; the bare errno identifies the business failure.","triggerScenarios":"Cookie session expired (most common errno for auth); requesting a path that does not exist (normalizeRemotePath produced a path the server rejects); invalid paging params; server-side throttle; concurrent sessions invalidating the cookie.","commonSituations":"Stored cookie past its lifetime (user logged out or session rotated); path containing characters the server normalizes differently; listing very deep paths; too-frequent automated requests triggering protection.","solutions":["Update the Cookie in driver storage and retry the request","Capture the same request in the web UI (devtools) and diff errno values to identify the exact cause","Validate the constructed requestPath is non-empty and well-formed before calling","Add modest request pacing to avoid anti-bot throttling errno"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if strings.TrimSpace(d.Cookie) == \"\" {\n    return errors.New(\"yunpan360: cookie credential missing\")\n}\nif p := normalizeRemotePath(dirPath); p == \"\" {\n    return errors.New(\"yunpan360: normalized request path is empty\")\n}","typeGuard":null,"tryCatchPattern":"if err := d.cookieRequestForm(ctx, apiPath, form, out); err != nil {\n    if strings.Contains(err.Error(), \"errno=\") {\n        code := parseErrno(err)\n        if code == errnoSessionExpired {\n            return fmt.Errorf(\"yunpan360 cookie expired, update credential: %w\", err)\n        }\n    }\n    return err\n}","preventionTips":["Treat bare-errno errors as auth problems first: refresh the cookie and retry once","Verify requestPath output is non-empty and matches web-UI path format","Pace automated listing/download requests to avoid anti-bot errno codes"],"tags":["yunpan360","cookie-auth","errno","api-error","go"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}