{"record":{"id":"752616dfe2cea33e","repo":"AlistGo/alist","slug":"e-message-752616","errorCode":null,"errorMessage":"e.Message","messagePattern":"e\\.Message","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/aliyundrive_share/util.go","lineNumber":55,"sourceCode":"\n// do others that not defined in Driver interface\nfunc (d *AliyundriveShare) getShareToken() error {\n\tdata := base.Json{\n\t\t\"share_id\": d.ShareId,\n\t}\n\tif d.SharePwd != \"\" {\n\t\tdata[\"share_pwd\"] = d.SharePwd\n\t}\n\tvar e ErrorResp\n\tvar resp ShareTokenResp\n\t_, err := base.RestyClient.R().\n\t\tSetResult(&resp).SetError(&e).SetBody(data).\n\t\tPost(\"https://api.alipan.com/v2/share_link/get_share_token\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif e.Code != \"\" {\n\t\treturn errors.New(e.Message)\n\t}\n\td.ShareToken = resp.ShareToken\n\treturn nil\n}\n\nfunc (d *AliyundriveShare) request(url, method string, callback base.ReqCallback) ([]byte, error) {\n\tvar e ErrorResp\n\treq := base.RestyClient.R().\n\t\tSetError(&e).\n\t\tSetHeader(\"content-type\", \"application/json\").\n\t\tSetHeader(\"Authorization\", \"Bearer\\t\"+d.AccessToken).\n\t\tSetHeader(CanaryHeaderKey, CanaryHeaderValue).\n\t\tSetHeader(\"x-share-token\", d.ShareToken)\n\tif callback != nil {\n\t\tcallback(req)\n\t} else {\n\t\treq.SetBody(\"{}\")\n\t}","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/aliyundrive_share/util.go#L37-L73","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the share URL/share_id is still valid by opening it in a browser","If the share has a password, set the correct share_pwd in the storage addition settings","Refresh the parent Aliyundrive access token (re-login or refresh the open token) then retry","If the error says the share is cancelled, obtain a new share link"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := d.getShareToken()\nif err != nil {\n    if strings.Contains(err.Error(), \"password\") { /* fix SharePwd config */ }\n    if strings.Contains(err.Error(), \"cancel\") || strings.Contains(err.Error(), \"expire\") { /* share dead: surface to user */ }\n    return err\n}","preventionTips":["Keep share_id and share_pwd in driver config current","Pre-validate the share link opens in a browser before configuring storage","Refresh access tokens proactively on a schedule"],"tags":["aliyundrive","share-link","api-error","auth"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}