AlistGo/alist · error
resp.Errmsg
Error message
resp.Errmsg
What it means
Thrown by the yunpan360 Open API authentication flow when the auth endpoint responds with a non-zero Errno. The server's Errmsg is returned as-is; this error means the driver could not obtain an AccessToken/Qid/Token triple, so all subsequent Open-API calls will fail.
Source
Thrown at drivers/yunpan360/util.go:213
"grant_type": "authorization_code",
"sub_channel": d.SubChannel,
"api_key": d.APIKey,
})
res, err := req.Get(reqURL)
if err != nil {
return nil, err
}
var resp OpenAuthResp
if err := utils.Json.Unmarshal(res.Body(), &resp); err != nil {
return nil, err
}
if resp.Errno != 0 {
if resp.Errmsg == "" {
return nil, fmt.Errorf("yunpan auth failed: errno=%d", resp.Errno)
}
return nil, errors.New(resp.Errmsg)
}
auth := &OpenAuthInfo{
AccessToken: resp.Data.AccessToken,
Qid: resp.Data.Qid,
Token: resp.Data.Token,
SubChannel: d.SubChannel,
}
d.cachedOpenAuth = auth
d.openAuthExpire = time.Now().Add(50 * time.Minute)
copied := *auth
return &copied, nil
}
func (d *Yunpan360) openBaseParams(auth *OpenAuthInfo, method string, signParams map[string]string, withSign bool) map[string]string {
params := map[string]string{
"method": method,View on GitHub (pinned to 843d9dc814)
Solutions
- Re-enter or refresh the Open API token/credentials in the storage config
- Confirm the token belongs to the correct 360 Open app and account (SubChannel matches)
- Check the errno value accompanying the auth failure — relogin-type errnos mean the stored token is dead and must be re-issued
- If auth keeps failing right after success, verify server clock and credential formatting
Example fix
// before
return nil, errors.New(resp.Errmsg)
// after: keep errno context
return nil, fmt.Errorf("yunpan auth failed: errno=%d: %s", resp.Errno, resp.Errmsg) Defensive patterns
Strategy: retry
Validate before calling
if strings.TrimSpace(d.Addition.Token) == "" { return errs.EmptyToken } Type guard
func isAuthErr(err error) bool { return err != nil && (strings.Contains(err.Error(), "yunpan auth failed") || strings.Contains(err.Error(), "errno=")) } Try / catch
auth, err := d.openAuth(ctx)
if err != nil {
// clear 50-min cache so next call re-authenticates
d.openAuthExpire = time.Time{}
auth, err = d.openAuth(ctx)
if err != nil { return nil, err }
} Prevention
- Store the Open token exactly as issued; no extra whitespace
- Treat repeated auth failures as a dead token — re-issue rather than retry-looping
- Monitor auth refreshes; a refresh storm usually means a revoked token
When it happens
Trigger: Calling the Open auth endpoint (OpenAuthResp decode in drivers/yunpan360/util.go:213) with an invalid/expired app token, wrong SubChannel, malformed credentials, or when the 360 Open platform rejects the sign-in. Any operation that triggers d.openAuth() (listing, upload, download via Open API) can surface it.
Common situations: Expired Open API token past the 50-minute cache window with refresh rejected; credentials copied incorrectly (trailing whitespace, wrong app key); the 360 Open platform account hit a quota or was disabled; clock skew breaking signed requests.
Related errors
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/46c7d26342cc0f3e.
Report an issue: GitHub.