AlistGo/alist · error
http request failure, err:%s
Error message
http request failure, err:%s
What it means
In the rangeReaderFunc used by GetRangeReadCloserFromLink, RequestRangedHttp failed AND returned a nil *http.Response, so the transport-level error is formatted as 'http request failure, err:%s'. Any response (even an error status) means the raw error is returned instead.
Source
Thrown at internal/stream/util.go:41
header := net.ProcessHeader(nil, link.Header)
down := net.NewDownloader(func(d *net.Downloader) {
d.Concurrency = link.Concurrency
d.PartSize = link.PartSize
})
req := &net.HttpRequestParams{
URL: link.URL,
Range: r,
Size: size,
HeaderRef: header,
}
rc, err := down.Download(ctx, req)
return rc, err
}
response, err := RequestRangedHttp(ctx, link, r.Start, r.Length)
if err != nil {
if response == nil {
return nil, fmt.Errorf("http request failure, err:%s", err)
}
return nil, err
}
if r.Start == 0 && (r.Length == -1 || r.Length == size) || response.StatusCode == http.StatusPartialContent ||
checkContentRange(&response.Header, r.Start) {
return response.Body, nil
} else if response.StatusCode == http.StatusOK {
log.Warnf("remote http server not supporting range request, expect low perfromace!")
readCloser, err := net.GetRangedHttpReader(response.Body, r.Start, r.Length)
if err != nil {
return nil, err
}
return readCloser, nil
}
return response.Body, nil
}
resultRangeReadCloser := model.RangeReadCloser{RangeReader: rangeReaderFunc}View on GitHub (pinned to 843d9dc814)
Solutions
- Check the wrapped error text — it contains the Go net/http failure reason
- If the link is an expiring signed URL, refresh the link (re-fetch the file) and retry the range read
- Verify network/proxy settings and upstream availability
- Retry the request — transient resets are common for large media streams
Defensive patterns
Strategy: retry
Try / catch
rc, err := rrc.RangeRead(ctx, r)
if err != nil && strings.Contains(err.Error(), "http request failure") {
// network-level failure: refresh the (possibly expired) link, then retry with backoff
} Prevention
- Re-fetch links when signed URLs may have expired instead of caching them long
- Keep proxy settings valid and reachable
- Wrap range reads in a bounded retry with link refresh
When it happens
Trigger: Ranged GET to the link URL fails at network level: DNS failure, connection refused/reset, TLS handshake error, or the upstream server closing the connection before headers are sent.
Common situations: Expired pre-signed URLs from cloud drivers (S3/OSS/OneDrive), network egress blocked, upstream rate-limiting that drops connections, or a proxy (conf.ProxyUrl) being unreachable.
Related errors
- can't create RangeReadCloser since URL is empty in link
- not get file info
- chunkNum invalid
- http request [%s] failure,status: %d response:%s
- missing cookie or qrcode account
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/bec8b42f85068805.
Report an issue: GitHub.