AlistGo/alist · error

get task status failed: %s

Error message

get task status failed: %s

What it means

waitTaskDone polls /nd.bizuserres.s/v1/get_task_status up to 30 times at 300ms intervals and throws this when the response envelope's Msg is not 'success' (case-insensitive). It means the provider acknowledged the HTTP request but the API-level status for the task query itself failed - e.g. unknown taskId or server-side rejection - distinct from the task failing.

Source

Thrown at drivers/guangyapan/driver.go:862

		return fmt.Errorf("request failed: status=%d body=%s", resp.StatusCode(), resp.String())
	}
	return nil
}

func (d *GuangYaPan) waitTaskDone(ctx context.Context, taskID string) error {
	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)
}

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Retry the whole operation once - transient non-success Msgs usually clear.
  2. If it persists with the same taskId, assume the task is gone and re-initiate the operation.
  3. Check provider status pages for incidents if many tasks fail at once.
Defensive patterns

Strategy: retry

Try / catch

if err := d.waitTaskDone(ctx, taskID); err != nil {
    if strings.Contains(err.Error(), "get task status failed") {
        // envelope-level failure, usually transient
        time.Sleep(time.Second)
        return d.waitTaskDone(ctx, taskID)
    }
    return err
}

Prevention

When it happens

Trigger: A copy/move/delete task ID is polled but get_task_status returns a non-success Msg: task record not found (expired or never committed), transient provider error, or the task belongs to another session.

Common situations: Polling a task created long ago whose record was purged; provider API hiccup mid-poll; session mismatch after a token refresh rotated accounts.

Related errors


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