jackwener/OpenCLI · error · CommandExecutionError

quark: Move task timed out

Error message

quark: Move task timed out

What it means

Thrown by clis/quark/mv.js when the async move task submitted to the Quark drive API (identified by data.task_id) never reaches a completed state while being polled via pollTask. Quark performs file moves asynchronously; the poll loop exhausts its retries/attempts without the task reporting success. The command aborts with a CommandExecutionError and result.status stays 'error'.

Source

Thrown at clis/quark/mv.js:46

            throw new ArgumentError('Cannot use both --to and --to-fid');
        const targetFid = toFid || await findFolder(page, to);
        const data = await apiPost(page, `${DRIVE_API}/move?pr=ucpro&fr=pc`, {
            filelist: fidList,
            to_pdir_fid: targetFid,
        });
        const result = {
            status: 'pending',
            count: fidList.length,
            destination: to || toFid,
            task_id: data.task_id,
            completed: false,
        };
        if (data.task_id) {
            const completed = await pollTask(page, data.task_id);
            result.completed = completed;
            result.status = completed ? 'ok' : 'error';
            if (!completed)
                throw new CommandExecutionError('quark: Move task timed out');
        }
        else {
            result.status = 'ok';
            result.completed = true;
        }
        return result;
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Re-run the mv command; the move task may succeed on retry once the Quark queue clears.
  2. Verify the target directory and moved files with a listing command to check whether the move actually completed despite the timeout.
  3. Move fewer/smaller items per invocation to reduce task processing time.
  4. Check Quark service status / retry later if the API is degraded or throttled.

Example fix

// before
throw new CommandExecutionError('quark: Move task timed out');
// after
if (!completed) {
  // check final task state once more before giving up
  await new Promise(r => setTimeout(r, 3000));
  const final = await pollTask(page, data.task_id);
  if (!final) throw new CommandExecutionError('quark: Move task timed out');
}
Defensive patterns

Strategy: retry

Try / catch

// wrap the mv call
try {
  const res = await mv(page, args);
} catch (e) {
  if (e.message.includes('Move task timed out')) {
    // verify state, then retry once
    const listing = await files(page, { fid: targetFid });
    if (!moveSucceeded(listing)) await retryMv(page, args);
  } else throw e;
}

Prevention

When it happens

Trigger: Calling the quark mv command with valid fids where the API returns a task_id but the pollTask loop never observes task status == completed before giving up (slow backend, very large folder move, or task stuck in pending/failed state).

Common situations: Moving very large folders with thousands of files; Quark service degradation or queue backlog; temporary account/API throttling slowing task processing; network instability during the polling window.

Understand the failure class

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/33043c724f94fdc3. Report an issue: GitHub.