AlistGo/alist · error
res.Status
Error message
res.Status
What it means
Surfaces during Cloudreve local-policy chunked upload: after PUTting a chunk with base.HttpClient.Do, the HTTP status is not 200 and res.Status (e.g. '403 Forbidden') is returned as the error. It reflects a transport/HTTP-level rejection of the chunk upload itself, before any JSON envelope is parsed.
Source
Thrown at drivers/cloudreve/util.go:275
}
req, err := http.NewRequest("POST", uploadUrl+"?chunk="+strconv.Itoa(chunk),
driver.NewLimitedUploadStream(ctx, bytes.NewReader(byteData)))
if err != nil {
return err
}
req = req.WithContext(ctx)
req.ContentLength = byteSize
// req.Header.Set("Content-Length", strconv.Itoa(int(byteSize)))
req.Header.Set("Authorization", fmt.Sprint(credential))
req.Header.Set("User-Agent", d.getUA())
err = func() error {
res, err := base.HttpClient.Do(req)
if err != nil {
return err
}
defer res.Body.Close()
if res.StatusCode != 200 {
return errors.New(res.Status)
}
body, err := io.ReadAll(res.Body)
if err != nil {
return err
}
var up Resp
err = json.Unmarshal(body, &up)
if err != nil {
return err
}
if up.Code != 0 {
return errors.New(up.Msg)
}
return nil
}()
if err == nil {
retryCount = 0
finish += byteSizeView on GitHub (pinned to 843d9dc814)
Solutions
- Retry the whole upload (re-create the upload session) — credentials are short-lived and a stale session URL is the most common cause.
- Check any WAF/CDN/nginx client_max_body_size in front of Cloudrebve allows your chunk size.
- Confirm the alist host clock is synced (signed credential URLs are time-sensitive).
- Inspect Cloudrebve logs for the matching request to see why the chunk endpoint rejected the request.
Defensive patterns
Strategy: retry
Try / catch
if err := upChunk(ctx, url, credential, data); err != nil {
if strings.HasPrefix(err.Error(), "4") || strings.Contains(err.Error(), "Gone") {
// credential/session likely expired: recreate the upload session once
session, serr := d.createUploadSession(...)
if serr == nil { return upChunk(ctx, session.URL, session.Credential, data) }
}
return err
} Prevention
- Complete uploads promptly — chunk credentials are short-lived
- Keep host clock NTP-synced for signed URLs
- Ensure proxies allow the chunk PUT body size
When it happens
Trigger: upLocal retry loop: request built with the upload credential URL, executed, res.StatusCode != 200. Produced by expired/one-time upload credentials, wrong Content-Length, blocked origin, or Cloudrebve returning 404/403 for the session upload URL.
Common situations: Upload session credential expired because the upload paused (chunk retries/backoff) past the credential TTL; Cloudrebve behind CDN/WAF that strips Authorization or limits body size; clock skew breaking signed URLs; server restarted mid-upload losing the session.
Related errors
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/909f0234b43e7ad8.
Report an issue: GitHub.