AlistGo/alist · error

Failed to start download

Error message

Failed to start download

What it means

Error "Failed to start download" thrown in AlistGo/alist.

Source

Thrown at drivers/proton_drive/util.go:219

	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))
			w.Header().Set("Content-Length", fmt.Sprintf("%d", contentLength))
			w.Header().Set("Content-Type", mime.TypeByExtension(filepath.Ext(link.Name)))

			// Partial content...
			// Setting fileName is more cosmetical here
			//.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", link.Name))
			w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", info.FileName))
			w.Header().Set("Accept-Ranges", "bytes")

			w.WriteHeader(http.StatusPartialContent)

			io.CopyN(w, reader, contentLength)
			return

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Check the storage configuration and the provider's service status, fix the indicated cause, and retry the operation.

When it happens

Trigger: Thrown at drivers/proton_drive/util.go:219 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/9f28ead7d01db504. Report an issue: GitHub.