AlistGo/alist · error
request failed: %s
Error message
request failed: %s
What it means
Raised by KodBox request() as the generic application-level failure: after optional token-refresh handling (code '10001' triggers getToken and a form-data accessToken retry), the response still has Code == false. The error text is commonResp.Data verbatim.
Source
Thrown at drivers/kodbox/util.go:83
if err != nil {
return nil, err
}
switch commonResp.Code.(type) {
case bool:
skip = true
case string:
if commonResp.Code.(string) == "10001" {
err = d.getToken()
if err != nil {
return nil, err
}
req.SetFormData(map[string]string{"accessToken": d.authorization})
}
}
}
if commonResp.Code.(bool) == false {
return nil, fmt.Errorf("request failed: %s", commonResp.Data)
}
return res.Body(), nil
}
View on GitHub (pinned to 843d9dc814)
Solutions
- Read the passthrough Data message — it is the server's stated reason for that specific endpoint
- If the message suggests session expiry, reload the storage to force getToken() and obtain a fresh accessToken
- Verify the mount's root path exists and is accessible to the configured KodBox user
Defensive patterns
Strategy: retry
Validate before calling
// Sanity-check the mount root before first request
if cfg.RootFolderPath != "" {
// verify via a lightweight list call that Code==true; otherwise fail config early
} Try / catch
body, err := d.request(http.MethodPost, path, cb)
if err != nil && strings.Contains(err.Error(), "request failed") {
// one re-auth + single retry (the driver already handles code 10001 internally)
_ = d.getToken()
body, err = d.request(http.MethodPost, path, cb)
} Prevention
- Use a KodBox user whose home contains the mounted root path
- Reload the storage after credential or permission changes to force fresh tokens
- Watch for KodBox upgrades that change Code typing (bool vs string) — update the driver
When it happens
Trigger: Any KodBox API call whose Code flag is false for a reason other than the specific '10001' expired-token case: invalid path, missing permission, server-side validation failure, or a token that was refreshed but the operation still refused.
Common situations: Mount root path not visible to the configured user; stale token that the 10001 retry could not fix; KodBox version drift changing Code semantics (string vs bool) so the refresh branch is skipped.
Related errors
- %s
- dynamic: fmt.Errorf(info) - message passthrough from API 'in
- {e.Message}
- get token failed: %s
- chunkSize invalid
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/87a006bd998eea0b.
Report an issue: GitHub.