AlistGo/alist · error

task %s failed with status=%d

Error message

task %s failed with status=%d

What it means

waitTaskDone maps the task's numeric Data.Status: 2 means success, while -1 and 3 are terminal failures, and this error reports the task ID and failing status. It means the server-side operation (copy/move/etc.) was accepted but ultimately failed.

Source

Thrown at drivers/guangyapan/driver.go:868

	const (
		maxTry   = 30
		interval = 300 * time.Millisecond
	)
	for i := 0; i < maxTry; i++ {
		var out taskStatusResp
		if err := d.postAPI(ctx, "/nd.bizuserres.s/v1/get_task_status", map[string]any{
			"taskId": taskID,
		}, &out); err != nil {
			return err
		}
		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,

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Retry the operation - status 3 is often transient server-side failure.
  2. Verify the source object still exists and the target folder is writable.
  3. Check account quota if failures cluster.
Defensive patterns

Strategy: try-catch

Try / catch

if err := d.waitTaskDone(ctx, taskID); err != nil {
    if strings.Contains(err.Error(), "failed with status=") {
        // terminal server-side failure: do NOT blind-retry large copies repeatedly
        if isLargeOp { return fmt.Errorf("copy failed server-side: %w", err) }
        return d.copy(ctx, src, dst) // one retry for small ops
    }
    return err
}

Prevention

When it happens

Trigger: A polled task transitions to status -1 or 3: upstream copy failed (source missing/permission), quota exceeded, content policy rejection, or provider-side processing error.

Common situations: Copying a file that was deleted between request and processing; target over quota; occasional provider-side failures on large files.

Related errors


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