{"record":{"id":"da01f2d82d808d5e","repo":"AlistGo/alist","slug":"refresh-token-invalid-please-re-provide-refresh-t","errorCode":null,"errorMessage":"refresh_token invalid, please re-provide refresh_token","messagePattern":"refresh_token invalid, please re-provide refresh_token","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/pikpak/util.go","lineNumber":239,"sourceCode":"\turl := d.userURL(\"/v1/auth/token\")\n\tvar e ErrResp\n\tres, err := base.RestyClient.SetRetryCount(1).R().SetError(&e).\n\t\tSetHeader(\"user-agent\", \"\").SetBody(base.Json{\n\t\t\"client_id\":     d.ClientID,\n\t\t\"client_secret\": d.ClientSecret,\n\t\t\"grant_type\":    \"refresh_token\",\n\t\t\"refresh_token\": refreshToken,\n\t}).SetQueryParam(\"client_id\", d.ClientID).Post(url)\n\tif err != nil {\n\t\td.Status = err.Error()\n\t\top.MustSaveDriverStorage(d)\n\t\treturn err\n\t}\n\tif e.ErrorCode != 0 {\n\t\tif e.ErrorCode == 4126 {\n\t\t\t// 1. 未填写 username 或 password\n\t\t\tif d.Addition.Username == \"\" || d.Addition.Password == \"\" {\n\t\t\t\treturn errors.New(\"refresh_token invalid, please re-provide refresh_token\")\n\t\t\t} else {\n\t\t\t\t// refresh_token invalid, re-login\n\t\t\t\treturn d.login()\n\t\t\t}\n\t\t}\n\t\td.Status = e.Error()\n\t\top.MustSaveDriverStorage(d)\n\t\treturn errors.New(e.Error())\n\t}\n\tdata := res.Body()\n\td.Status = \"work\"\n\td.RefreshToken = jsoniter.Get(data, \"refresh_token\").ToString()\n\td.AccessToken = jsoniter.Get(data, \"access_token\").ToString()\n\td.Common.SetUserID(jsoniter.Get(data, \"sub\").ToString())\n\td.Addition.RefreshToken = d.RefreshToken\n\top.MustSaveDriverStorage(d)\n\treturn nil\n}","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/pikpak/util.go#L221-L257","documentation":"Error \"refresh_token invalid, please re-provide refresh_token\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at drivers/pikpak/util.go:239 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-15T17:31:12.345Z"}