AlistGo/alist · error

share_ids is required

Error message

share_ids is required

What it means

Wrapped error from XunLeiCommon's offline task listing (drivers/thunder/driver.go:644) when the GET to TASK_API_URL (type=offline, limit=10000) fails at the transport/request layer or the common Request helper returns an error. The %w preserves the underlying cause (network failure, expired captcha token surfacing as an API error, auth loss).

Source

Thrown at drivers/123_open/other.go:355

	TrafficLimitSwitch int     `json:"traffic_limit_switch"`
	TrafficLimit       int64   `json:"traffic_limit"`
}

type shareListArgs struct {
	Limit       int   `json:"limit"`
	LastShareID int64 `json:"last_share_id"`
}

type shareUpdateArgs struct {
	ShareIDs           []int64 `json:"share_ids"`
	TrafficSwitch      int     `json:"traffic_switch"`
	TrafficLimitSwitch int     `json:"traffic_limit_switch"`
	TrafficLimit       int64   `json:"traffic_limit"`
}

func (a shareUpdateArgs) toRequest() (*pan123.ShareUpdateRequest, error) {
	if len(a.ShareIDs) == 0 {
		return nil, errors.New("share_ids is required")
	}
	return &pan123.ShareUpdateRequest{
		ShareIDs:           a.ShareIDs,
		TrafficSwitch:      pan123.TrafficSwitch(a.TrafficSwitch),
		TrafficLimitSwitch: a.TrafficLimitSwitch,
		TrafficLimit:       a.TrafficLimit,
	}, nil
}

func otherShareCreate(d *Open123, ctx context.Context, args model.OtherArgs) (interface{}, error) {
	var req shareCreateArgs
	if err := decodeOtherArgs(args.Data, &req); err != nil {
		return nil, err
	}
	fileIDs, err := resolveFileIDs(args, req.FileIDs)
	if err != nil {
		return nil, err
	}

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Retry after re-initializing/re-logging the Thunder/XunLei storage (refreshes tokens and captcha token).
  2. Inspect the wrapped cause with errors.Unwrap — if it is a captcha-token error, force the verify flow before listing again.
  3. Check network reachability of the Thunder API endpoints from the host.
  4. Update to a current driver version if Thunder changed endpoints or parameters.

Example fix

// before
tasks, err := xc.GetOfflineTasks(ctx, token)
if err != nil {
	return err
}

// after
tasks, err := xc.GetOfflineTasks(ctx, token)
if err != nil {
	if isAuthOrCaptchaErr(errors.Unwrap(err)) {
		if e := xc.refreshSession(ctx); e != nil {
			return e
		}
		tasks, err = xc.GetOfflineTasks(ctx, token)
	}
	if err != nil {
		return err
	}
}
Defensive patterns

Strategy: retry

Type guard

func isOfflineListErr(err error) bool {
	return err != nil && strings.Contains(err.Error(), "failed to get offline list")
}

Try / catch

tasks, err := xc.GetOfflineTasks(ctx, token)
if isOfflineListErr(err) {
	if isAuthOrCaptchaErr(errors.Unwrap(err)) {
		_ = xc.refreshSession(ctx)
		tasks, err = xc.GetOfflineTasks(ctx, token)
	}
}

Prevention

When it happens

Trigger: Listing offline (XunLei/Thunder) download tasks when the session token expired, the captchaToken became invalid (they rotate), the device/signature was invalidated, or plain network errors reaching the Thunder API host.

Common situations: After the XunLei session ages out (re-login needed); after triggering anti-abuse (invalid captcha token from repeated requests); server sleep/wake changing device fingerprint; API endpoint changes in the thunder driver.

Related errors


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