AlistGo/alist · error

baseResp.Errmsg

Error message

baseResp.Errmsg

What it means

Returned by the yunpan360 driver when a cookie-mode API call succeeds at the HTTP level but the response body carries a non-zero Errno in its BaseResp envelope. The server-supplied Errmsg string is propagated verbatim as the error text. This is the canonical 'business-level failure' signal for 360 Cloud Drive (yunpan) endpoints.

Source

Thrown at drivers/yunpan360/util.go:82

			"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 {
	if strings.EqualFold(order, "desc") {
		return "desc"

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Refresh or re-enter the cookie/credentials in the storage configuration and retry the request
  2. Verify the request targets an object that still exists (re-list the parent directory to get fresh nid/path)
  3. Inspect the Errmsg text and the accompanying errno value — it is the server's own reason (e.g. relogin required, file not found) and maps directly to the fix
  4. If errors persist for every call, log out and back in on yunpan360.com to obtain a fresh cookie, then update the driver config

Example fix

// before: error text is opaque server message
return errors.New(baseResp.Errmsg)

// after: wrap with errno for easier diagnosis
return fmt.Errorf("yunpan request failed: errno=%d: %s", baseResp.Errno, baseResp.Errmsg)
Defensive patterns

Strategy: retry

Validate before calling

if d.Addition.Cookie == "" { return errs.EmptyToken } // ensure session configured before cookie calls

Type guard

func isYunpanBusinessErr(err error) bool { return err != nil && !errors.Is(err, io.EOF) && strings.Contains(err.Error(), "errno=") || /* server msg */ yunpanErrno(err) > 0 }

Try / catch

resp, err := d.cookieRequestForm(ctx, path, form, out)
if err != nil {
    if strings.Contains(err.Error(), "relogin") || isSessionExpired(err) {
        d.invalidateCookieSession()
        resp, err = d.cookieRequestForm(ctx, path, form, out)
    }
}

Prevention

When it happens

Trigger: Any d.cookieRequestForm / cookie-mode request whose JSON response decodes into BaseResp with Errno != 0 and a non-empty Errmsg field (drivers/yunpan360/util.go:82). Typical triggers: listing or downloading files with an expired or invalid cookie session, operating on a file that was deleted server-side, or hitting rate limits / login-state checks on yunpan360.com.

Common situations: Cookie credentials expired (user logged out or cookie rotated) while the driver still sends requests; wrong cookie configuration in the storage settings; files renamed or moved externally so the nid/path the driver holds is stale; 360 backend returning session-relogin errors after long idle periods.

Related errors


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