AlistGo/alist · error
refresh_token invalid, please re-provide refresh_token
Error message
refresh_token invalid, please re-provide refresh_token
What it means
Error "refresh_token invalid, please re-provide refresh_token" thrown in AlistGo/alist.
Source
Thrown at drivers/pikpak/util.go:239
url := d.userURL("/v1/auth/token")
var e ErrResp
res, err := base.RestyClient.SetRetryCount(1).R().SetError(&e).
SetHeader("user-agent", "").SetBody(base.Json{
"client_id": d.ClientID,
"client_secret": d.ClientSecret,
"grant_type": "refresh_token",
"refresh_token": refreshToken,
}).SetQueryParam("client_id", d.ClientID).Post(url)
if err != nil {
d.Status = err.Error()
op.MustSaveDriverStorage(d)
return err
}
if e.ErrorCode != 0 {
if e.ErrorCode == 4126 {
// 1. 未填写 username 或 password
if d.Addition.Username == "" || d.Addition.Password == "" {
return errors.New("refresh_token invalid, please re-provide refresh_token")
} else {
// refresh_token invalid, re-login
return d.login()
}
}
d.Status = e.Error()
op.MustSaveDriverStorage(d)
return errors.New(e.Error())
}
data := res.Body()
d.Status = "work"
d.RefreshToken = jsoniter.Get(data, "refresh_token").ToString()
d.AccessToken = jsoniter.Get(data, "access_token").ToString()
d.Common.SetUserID(jsoniter.Get(data, "sub").ToString())
d.Addition.RefreshToken = d.RefreshToken
op.MustSaveDriverStorage(d)
return nil
}View on GitHub (pinned to 843d9dc814)
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.
When it happens
Trigger: Thrown at drivers/pikpak/util.go:239 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/da01f2d82d808d5e.
Report an issue: GitHub.