AlistGo/alist · error

yunpan async task %s failed: errno=%d

Error message

yunpan async task %s failed: errno=%d

What it means

Produced by checkCookieAsyncTask in the yunpan360 driver while polling /async/query (waitCookieAsyncTask loops up to 15 times, 300ms apart). When a task reaches status 10 with a non-zero errno that is not in the tolerated set, and errstr is empty but the task record has a non-empty Action, the failure is reported with that action name.

Source

Thrown at drivers/yunpan360/util.go:834

	// Keep prior behavior when the async task is still pending after the probe window.
	return nil
}

func checkCookieAsyncTask(task CookieAsyncTask, toleratedErrnos map[int]struct{}) (bool, error) {
	if task.Status != 10 {
		return false, nil
	}
	if task.Errno == 0 {
		return true, nil
	}
	if _, ok := toleratedErrnos[task.Errno]; ok {
		return true, nil
	}
	if strings.TrimSpace(task.Errstr) != "" {
		return true, errors.New(task.Errstr)
	}
	if strings.TrimSpace(task.Action) != "" {
		return true, fmt.Errorf("yunpan async task %s failed: errno=%d", task.Action, task.Errno)
	}
	return true, fmt.Errorf("yunpan async task failed: errno=%d", task.Errno)
}

func (d *Yunpan360) openMove(ctx context.Context, srcName, dstPath string) error {
	signParams := map[string]string{
		"src_name": srcName,
		"new_name": dstPath,
	}
	return d.openPOST(ctx, "File.move", signParams, nil, signParams, nil, true)
}

func (d *Yunpan360) openDelete(ctx context.Context, targetPath string) error {
	return d.openPOST(ctx, "File.delete", nil, nil, map[string]string{
		"fname": targetPath,
	}, nil, true)
}

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Retry the user operation; transient server-side async failures often clear
  2. Check that the target path/owner_qid used for the async operation is still valid in the account
  3. Confirm the cookie session is fresh (re-login) and the account has rights over the target
  4. If the same errno recurs, extend the tolerated errno list in the waitCookieAsyncTask call only after confirming the code is benign (as was done for 3008)

Example fix

// before: only errno 3008 is tolerated during recycle deletion
d.waitCookieAsyncTask(ctx, resp.Data.TaskID, 3008)

// after: tolerate an additional confirmed-benign completion code (e.g. 'already deleted')
d.waitCookieAsyncTask(ctx, resp.Data.TaskID, 3008, confirmedBenignErrno)
Defensive patterns

Strategy: retry

Try / catch

// Go: async task failures are often transient server-side; retry the creating operation once
err := d.waitCookieAsyncTask(ctx, taskID, 3008)
if err != nil && strings.Contains(err.Error(), "yunpan async task") {
    if retryErr := d.retryOriginalOperation(ctx); retryErr == nil { err = nil }
}

Prevention

When it happens

Trigger: Cookie-mode operations that spawn async tasks — e.g. recycle-bin deletion (waitCookieAsyncTask with tolerated errno 3008) — where the server-side task finishes (status 10) with an error code outside the tolerated list and no errstr, but an Action field describing the failed operation.

Common situations: Deleting/moving large folders via the cookie API where the async job fails server-side (path already gone, permission lost, quota); a new errno appears that the driver's toleratedErrnos list (currently 3008) does not cover; cookie session partially invalidated mid-task.

Related errors


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