AlistGo/alist · error
Invalid range
Error message
Invalid range
What it means
Error "Invalid range" thrown in AlistGo/alist.
Source
Thrown at drivers/proton_drive/util.go:206
return
}
// Get file size for range calculations
_, _, attrs, err := d.protonDrive.DownloadFile(r.Context(), link, 0)
if err != nil {
http.Error(w, "Failed to get file info", http.StatusInternalServerError)
return
}
fileSize := attrs.Size
rangeHeader := r.Header.Get("Range")
if rangeHeader != "" {
// Parse range header like "bytes=0-1023" or "bytes=1024-"
ranges, err := parseRange(rangeHeader, fileSize)
if err != nil {
http.Error(w, "Invalid range", http.StatusRequestedRangeNotSatisfiable)
return
}
if len(ranges) == 1 {
// Single range request, small
start, end := ranges[0].start, ranges[0].end
contentLength := end - start + 1
// Start download from offset
reader, _, _, err := d.protonDrive.DownloadFile(r.Context(), link, start)
if err != nil {
http.Error(w, "Failed to start download", http.StatusInternalServerError)
return
}
defer reader.Close()
w.Header().Set("Content-Range", fmt.Sprintf("bytes %d-%d/%d", start, end, fileSize))View on GitHub (pinned to 843d9dc814)
Solutions
- Send a valid HTTP Range header within the file size bounds and retry the request.
When it happens
Trigger: Thrown at drivers/proton_drive/util.go:206 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/f24442ebb0dbcaa3.
Report an issue: GitHub.