AlistGo/alist · error

e.Message

Error message

e.Message

What it means

Returned by getShareToken() in the Aliyundrive Share driver when the POST to https://api.alipan.com/v2/share_link/get_share_token succeeds at HTTP level but the response body carries a non-empty error Code in its JSON. The server's Message field is surfaced verbatim.

Source

Thrown at drivers/aliyundrive_share/util.go:55

// do others that not defined in Driver interface
func (d *AliyundriveShare) getShareToken() error {
	data := base.Json{
		"share_id": d.ShareId,
	}
	if d.SharePwd != "" {
		data["share_pwd"] = d.SharePwd
	}
	var e ErrorResp
	var resp ShareTokenResp
	_, err := base.RestyClient.R().
		SetResult(&resp).SetError(&e).SetBody(data).
		Post("https://api.alipan.com/v2/share_link/get_share_token")
	if err != nil {
		return err
	}
	if e.Code != "" {
		return errors.New(e.Message)
	}
	d.ShareToken = resp.ShareToken
	return nil
}

func (d *AliyundriveShare) request(url, method string, callback base.ReqCallback) ([]byte, error) {
	var e ErrorResp
	req := base.RestyClient.R().
		SetError(&e).
		SetHeader("content-type", "application/json").
		SetHeader("Authorization", "Bearer\t"+d.AccessToken).
		SetHeader(CanaryHeaderKey, CanaryHeaderValue).
		SetHeader("x-share-token", d.ShareToken)
	if callback != nil {
		callback(req)
	} else {
		req.SetBody("{}")
	}

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Verify the share URL/share_id is still valid by opening it in a browser
  2. If the share has a password, set the correct share_pwd in the storage addition settings
  3. Refresh the parent Aliyundrive access token (re-login or refresh the open token) then retry
  4. If the error says the share is cancelled, obtain a new share link
Defensive patterns

Strategy: try-catch

Try / catch

err := d.getShareToken()
if err != nil {
    if strings.Contains(err.Error(), "password") { /* fix SharePwd config */ }
    if strings.Contains(err.Error(), "cancel") || strings.Contains(err.Error(), "expire") { /* share dead: surface to user */ }
    return err
}

Prevention

When it happens

Trigger: Calling getShareToken with a share_id that is invalid/expired, a wrong share_pwd when the share link is password-protected, or an expired/invalid access token used to redeem the share token.

Common situations: The share link author deleted or expired the share; the share requires a password and SharePwd is wrong/missing; the underlying Aliyundrive access token expired so share-token redemption is rejected.

Related errors


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