AlistGo/alist · error
[doubao_new] API error (code: %d): %s
Error message
[doubao_new] API error (code: %d): %s
What it means
Doubao_new business error surfaced by the generic response decoder: the body parsed fine as JSON but BaseResp.Code != 0, meaning the Doubao web API rejected the call. The message prefers Msg then Message fields from the response. This is the canonical 'the server said no' error for every doubao_new operation.
Source
Thrown at drivers/doubao_new/util.go:74
}
body := res.Body()
var common BaseResp
if err = json.Unmarshal(body, &common); err != nil {
msg := fmt.Sprintf("[doubao_new] decode response failed (status: %s, content-type: %s, body: %s): %v",
res.Status(),
res.Header().Get("Content-Type"),
string(body),
err,
)
return body, fmt.Errorf(msg)
}
if common.Code != 0 {
errMsg := common.Msg
if errMsg == "" {
errMsg = common.Message
}
return body, fmt.Errorf("[doubao_new] API error (code: %d): %s", common.Code, errMsg)
}
if resp != nil {
if err = json.Unmarshal(body, resp); err != nil {
return body, err
}
}
return body, nil
}
func getCookieValue(cookie, name string) string {
parts := strings.Split(cookie, ";")
prefix := name + "="
for _, part := range parts {
part = strings.TrimSpace(part)
if strings.HasPrefix(part, prefix) {
return strings.TrimPrefix(part, prefix)
}View on GitHub (pinned to 843d9dc814)
Solutions
- Decode the code number: auth/session codes → refresh the driver's cookies; quota codes → free space; rate-limit codes → back off and retry slower
- Re-authenticate the doubao driver in OpenList settings and retry
- Verify the target path exists and the operation is valid for it
- If code is unrecognized and all operations fail, check for an API change and update the driver
- Add delays between rapid successive operations to avoid frequency-limit codes
Defensive patterns
Strategy: try-catch
Type guard
func isAuthCodeError(err error) bool {
m := regexp.MustCompile(`API error \(code: (\d+)\)`).FindStringSubmatch(err.Error())
return m != nil && isDoubaoAuthCode(m[1]) // maintain a small auth-code set
} Try / catch
if err := d.apiCall(...); err != nil {
if isAuthCodeError(err) {
d.refreshSession() // re-login, then retry once
return d.apiCall(...)
}
if isRateLimitCode(err) {
time.Sleep(5 * time.Second)
return d.apiCall(...)
}
return err
} Prevention
- Map known Doubao business codes to actions (auth → re-login, rate-limit → backoff, quota → stop)
- Renew cookies proactively before long batch operations
- Rate-limit your own listing/upload loops
When it happens
Trigger: Any doubao_new API call hitting a business failure: expired session cookie (auth code), invalid folder token, quota exceeded, file name not allowed, rate limiting, or operation not permitted for the account state.
Common situations: Cookie-based auth going stale (most common — re-login fixes it), uploading to a deleted/moved folder, hitting operation frequency limits during heavy listing/upload, or Doubao A/B testing new endpoints that need updated parameters.
Related errors
- [doubao_new] decode response failed (status: %s, content-typ
- e.Message
- get upload data error
- r.Msg
- up.Msg
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/5534876b12b98206.
Report an issue: GitHub.