{"record":{"id":"aec91c52f9f740b8","repo":"AlistGo/alist","slug":"failed-to-refresh-token-refresh-token-is-empty-r","errorCode":null,"errorMessage":"failed to refresh token: refresh token is empty, resp: %s","messagePattern":"failed to refresh token: refresh token is empty, resp: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/aliyundrive_open/util.go","lineNumber":140,"sourceCode":"\t\treturn \"\", \"\", err\n\t}\n\tlog.Debugf(\"[ali_open] refresh token response: %s\", res.String())\n\tif res.StatusCode() == http.StatusTooManyRequests {\n\t\tmessage := e.Message\n\t\tif message == \"\" {\n\t\t\tmessage = http.StatusText(http.StatusTooManyRequests)\n\t\t}\n\t\treturn \"\", \"\", &refreshRateLimitError{\n\t\t\tmessage:    fmt.Sprintf(\"failed to refresh token: %s\", message),\n\t\t\tretryAfter: retryAfterFromResponse(res),\n\t\t}\n\t}\n\tif e.Code != \"\" {\n\t\treturn \"\", \"\", fmt.Errorf(\"failed to refresh token: %s\", e.Message)\n\t}\n\trefresh, access := utils.Json.Get(res.Body(), \"refresh_token\").ToString(), utils.Json.Get(res.Body(), \"access_token\").ToString()\n\tif refresh == \"\" {\n\t\treturn \"\", \"\", fmt.Errorf(\"failed to refresh token: refresh token is empty, resp: %s\", res.String())\n\t}\n\tcurSub, err := getSub(d.RefreshToken)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tnewSub, err := getSub(refresh)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tif curSub != newSub {\n\t\treturn \"\", \"\", errors.New(\"failed to refresh token: sub not match\")\n\t}\n\treturn refresh, access, nil\n}\n\nfunc getSub(token string) (string, error) {\n\tsegments := strings.Split(token, \".\")\n\tif len(segments) != 3 {","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/aliyundrive_open/util.go#L122-L158","documentation":"Error \"failed to refresh token: refresh token is empty, resp: %s\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at drivers/aliyundrive_open/util.go:140 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-authenticate the storage: obtain a new refresh_token via the provider's OAuth flow and update the storage configuration.","Verify client_id/client_secret are correct and the refresh token has not been revoked or expired."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}