AlistGo/alist · error

yunpan request failed: errno=%d

Error message

yunpan request failed: errno=%d

What it means

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.

Source

Thrown at drivers/yunpan360/util.go:80

			"Cookie":           d.Cookie,
			"Origin":           baseURL,
			"Referer":          baseURL + "/file/index",
			"X-Requested-With": "XMLHttpRequest",
		}).
		SetFormData(form)

	res, err := req.Execute(http.MethodPost, baseURL+apiPath)
	if err != nil {
		return err
	}

	var baseResp BaseResp
	if err := utils.Json.Unmarshal(res.Body(), &baseResp); err != nil {
		return err
	}
	if baseResp.Errno != 0 {
		if baseResp.Errmsg == "" {
			return fmt.Errorf("yunpan request failed: errno=%d", baseResp.Errno)
		}
		return errors.New(baseResp.Errmsg)
	}
	if out == nil {
		return nil
	}
	return utils.Json.Unmarshal(res.Body(), out)
}

func requestPath(dirPath string) string {
	path := normalizeRemotePath(dirPath)
	if path == "" {
		return "/"
	}
	return path
}

func requestOrder(order string) string {

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Update the Cookie in driver storage and retry the request
  2. Capture the same request in the web UI (devtools) and diff errno values to identify the exact cause
  3. Validate the constructed requestPath is non-empty and well-formed before calling
  4. Add modest request pacing to avoid anti-bot throttling errno
Defensive patterns

Strategy: try-catch

Validate before calling

if strings.TrimSpace(d.Cookie) == "" {
    return errors.New("yunpan360: cookie credential missing")
}
if p := normalizeRemotePath(dirPath); p == "" {
    return errors.New("yunpan360: normalized request path is empty")
}

Try / catch

if err := d.cookieRequestForm(ctx, apiPath, form, out); err != nil {
    if strings.Contains(err.Error(), "errno=") {
        code := parseErrno(err)
        if code == errnoSessionExpired {
            return fmt.Errorf("yunpan360 cookie expired, update credential: %w", err)
        }
    }
    return err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/fde5882502937ca9. Report an issue: GitHub.