AlistGo/alist · error

move failed: %s

Error message

move failed: %s

What it means

GuangYaPan Move error: /file/move_file returned non-success msg, surfaced as 'move failed: <backend msg>'. On success the driver then polls a taskID; this error indicates the move was rejected before a task was created.

Source

Thrown at drivers/guangyapan/driver.go:340

	if err := d.ensureAccessToken(ctx); err != nil {
		return err
	}

	fileID := strings.TrimSpace(srcObj.GetID())
	if fileID == "" {
		return errors.New("file id is empty")
	}
	parentID := dstDir.GetID()

	var out deleteResp
	if err := d.postAPI(ctx, "/nd.bizuserres.s/v1/file/move_file", map[string]any{
		"fileIds":  []string{fileID},
		"parentId": parentID,
	}, &out); err != nil {
		return err
	}
	if !strings.EqualFold(strings.TrimSpace(out.Msg), "success") {
		return fmt.Errorf("move failed: %s", strings.TrimSpace(out.Msg))
	}
	taskID := strings.TrimSpace(out.Data.TaskID)
	if taskID == "" {
		return nil
	}
	return d.waitTaskDone(ctx, taskID)
}

func (d *GuangYaPan) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {
	if err := d.ensureAccessToken(ctx); err != nil {
		return err
	}

	fileID := strings.TrimSpace(srcObj.GetID())
	if fileID == "" {
		return errors.New("file id is empty")
	}
	parentID := dstDir.GetID()

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Read the backend msg for the exact rejection reason
  2. Refresh the destination listing and confirm parentID is an existing writable folder
  3. Serialize move/copy operations on the same file to avoid backend task locks
  4. Retry after the previous async task on that file completes
Defensive patterns

Strategy: try-catch

Try / catch

err := d.Move(ctx, srcObj, dstDir)
if err != nil && strings.HasPrefix(err.Error(), "move failed") {
  // inspect backend msg; refresh destination before retrying
}

Prevention

When it happens

Trigger: Calling Move where the backend rejects moving the fileIds into parentId: destination not a folder or deleted, file locked by another async task, same source and destination, or permission limits — msg != success.

Common situations: Moving into a folder that was just removed; concurrent move/copy of the same file; moving into a shared folder without write rights; destination ID copied from stale cache.

Related errors


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