AlistGo/alist · warning

task %s timeout

Error message

task %s timeout

What it means

waitTaskDone exhausted all 30 polls (about 9 seconds) without the task reaching status 2 or a terminal status. The task may still complete server-side; this error only says the driver stopped waiting within its fixed budget.

Source

Thrown at drivers/guangyapan/driver.go:879

		if !strings.EqualFold(strings.TrimSpace(out.Msg), "success") {
			return fmt.Errorf("get task status failed: %s", strings.TrimSpace(out.Msg))
		}
		switch out.Data.Status {
		case 2:
			return nil
		case -1, 3:
			return fmt.Errorf("task %s failed with status=%d", taskID, out.Data.Status)
		}
		if i == maxTry-1 {
			break
		}
		select {
		case <-ctx.Done():
			return ctx.Err()
		case <-time.After(interval):
		}
	}
	return fmt.Errorf("task %s timeout", taskID)
}

func (d *GuangYaPan) getUploadToken(ctx context.Context, parentID, name string, size int64) (*uploadTokenData, int, error) {
	var out uploadTokenResp
	err := d.postAPI(ctx, "/nd.bizuserres.s/v1/get_res_center_token", map[string]any{
		"capacity": 2,
		"name":     name,
		"parentId": parentID,
		"res": map[string]any{
			"fileSize": size,
		},
	}, &out)
	if err != nil {
		return nil, 0, err
	}
	msg := strings.TrimSpace(out.Msg)
	if msg != "" && !strings.EqualFold(msg, "success") {
		return nil, out.Code, fmt.Errorf("get upload token failed: %s", msg)

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Retry or re-check the operation result - the task often completes after the timeout.
  2. For large copies, expect this timeout and verify the destination afterwards instead of treating it as failure.
  3. Driver maintainers can raise maxTry/interval for large-task workloads.

Example fix

// before
const (
    maxTry   = 30
    interval = 300 * time.Millisecond
)

// after - budget scaled to tolerate slow server-side tasks
const (
    maxTry   = 100
    interval = 500 * time.Millisecond
)
Defensive patterns

Strategy: retry

Try / catch

if err := d.waitTaskDone(ctx, taskID); err != nil {
    if strings.Contains(err.Error(), "timeout") {
        // task may still finish server-side: check destination before retrying
        if _, lerr := d.listDest(ctx); lerr == nil { return nil }
        return d.retryCopy(ctx, taskID)
    }
    return err
}

Prevention

When it happens

Trigger: A task that takes longer than maxTry*interval (30 * 300ms = 9s) to finish: large copies, provider slowness, or a stuck task that never transitions.

Common situations: Copying very large files or many files at once; provider under load; the 9-second budget being too tight for big operations.

Understand the failure class

Related errors


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