AlistGo/alist · error · ErrFileShareCancel
file sharing cancellation
Error message
file sharing cancellation
What it means
Sentinel error ErrFileShareCancel in the lanzou driver. It is produced in getShareUrlHtml (util.go:329-331) when the fetched share page HTML contains the literal text "取消分享" (share cancelled). The owner of the lanzou share link deleted or cancelled the share, so no scraping flow can proceed.
Source
Thrown at drivers/lanzou/types.go:11
package lanzou
import (
"errors"
"fmt"
"github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/pkg/utils"
"time"
)
var ErrFileShareCancel = errors.New("file sharing cancellation")
var ErrFileNotExist = errors.New("file does not exist")
var ErrCookieExpiration = errors.New("cookie expiration")
type RespText[T any] struct {
Text T `json:"text"`
}
type RespInfo[T any] struct {
Info T `json:"info"`
}
var _ model.Obj = (*FileOrFolder)(nil)
var _ model.Obj = (*FileOrFolderByShareUrl)(nil)
type FileOrFolder struct {
Name string `json:"name"`
//Onof string `json:"onof"` // 是否存在提取码
//IsLock string `json:"is_lock"`View on GitHub (pinned to 843d9dc814)
Solutions
- Match this sentinel with errors.Is and surface 'share was cancelled by the owner' to the user instead of a generic failure
- Remove/disable the affected mount or link source since retrying cannot recover a cancelled share
- If you own the share, re-share the file on woozooo.com to get a fresh shareID
Example fix
// before
files, err := d.GetFileOrFolderByShareUrl(shareID, pwd)
if err != nil { return err }
// after
files, err := d.GetFileOrFolderByShareUrl(shareID, pwd)
switch {
case errors.Is(err, lanzou.ErrFileShareCancel):
return fmt.Errorf("share %s was cancelled by its owner", shareID)
case errors.Is(err, lanzou.ErrFileNotExist):
return fmt.Errorf("share %s no longer exists", shareID)
case err != nil:
return err
} Defensive patterns
Strategy: try-catch
Type guard
func isShareCancelled(err error) bool { return errors.Is(err, lanzou.ErrFileShareCancel) } Try / catch
files, err := d.GetFileOrFolderByShareUrl(shareID, pwd)
if err != nil {
if errors.Is(err, lanzou.ErrFileShareCancel) {
// permanent: stop retrying, notify user
return nil, fmt.Errorf("share %s cancelled by owner", shareID)
}
return nil, err
} Prevention
- Always match lanzou sentinels with errors.Is, never string comparison
- Classify this error as permanent in retry policies — no backoff will revive a cancelled share
When it happens
Trigger: GET {ShareUrl}/{shareID} returns the page whose body contains 取消分享 — the file owner cancelled sharing, the share was reported/removed by lanzou moderation, or the share expired. Compare via err == ErrFileShareCancel or errors.Is.
Common situations: User bookmarked a lanzou share that the uploader later deleted; content takedown; share link pasted wrong so it lands on a cancelled-share page.
Related errors
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/e4b40dcae5baeb3d.
Report an issue: GitHub.