AlistGo/alist · error

Invalid or expired token

Error message

Invalid or expired token

What it means

Error "Invalid or expired token" thrown in AlistGo/alist.

Source

Thrown at drivers/proton_drive/util.go:181

		Handler: mux,
	}

	go func() {
		d.tempServer.Serve(listener)
	}()

	return nil
}

func (d *ProtonDrive) handleTempDownload(w http.ResponseWriter, r *http.Request) {
	token := strings.TrimPrefix(r.URL.Path, "/temp/")

	d.tokenMutex.RLock()
	info, exists := d.downloadTokens[token]
	d.tokenMutex.RUnlock()

	if !exists {
		http.Error(w, "Invalid or expired token", http.StatusNotFound)
		return
	}

	link, err := d.protonDrive.GetLink(r.Context(), info.LinkID)
	if err != nil {
		http.Error(w, "Failed to get file link", http.StatusInternalServerError)
		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

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Provide a valid token in the storage configuration and save it again.
  2. If the token expired, re-login or refresh it through the provider and update the configuration.

When it happens

Trigger: Thrown at drivers/proton_drive/util.go:181 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/ff03802509500e66. Report an issue: GitHub.