{"record":{"id":"33043c724f94fdc3","repo":"jackwener/OpenCLI","slug":"quark-move-task-timed-out","errorCode":null,"errorMessage":"quark: Move task timed out","messagePattern":"quark: Move task timed out","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/quark/mv.js","lineNumber":46,"sourceCode":"            throw new ArgumentError('Cannot use both --to and --to-fid');\n        const targetFid = toFid || await findFolder(page, to);\n        const data = await apiPost(page, `${DRIVE_API}/move?pr=ucpro&fr=pc`, {\n            filelist: fidList,\n            to_pdir_fid: targetFid,\n        });\n        const result = {\n            status: 'pending',\n            count: fidList.length,\n            destination: to || toFid,\n            task_id: data.task_id,\n            completed: false,\n        };\n        if (data.task_id) {\n            const completed = await pollTask(page, data.task_id);\n            result.completed = completed;\n            result.status = completed ? 'ok' : 'error';\n            if (!completed)\n                throw new CommandExecutionError('quark: Move task timed out');\n        }\n        else {\n            result.status = 'ok';\n            result.completed = true;\n        }\n        return result;\n    },\n});\n","sourceCodeStart":28,"sourceCodeEnd":55,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/quark/mv.js#L28-L55","documentation":"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'.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Re-run the mv command; the move task may succeed on retry once the Quark queue clears.","Verify the target directory and moved files with a listing command to check whether the move actually completed despite the timeout.","Move fewer/smaller items per invocation to reduce task processing time.","Check Quark service status / retry later if the API is degraded or throttled."],"exampleFix":"// before\nthrow new CommandExecutionError('quark: Move task timed out');\n// after\nif (!completed) {\n  // check final task state once more before giving up\n  await new Promise(r => setTimeout(r, 3000));\n  const final = await pollTask(page, data.task_id);\n  if (!final) throw new CommandExecutionError('quark: Move task timed out');\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// wrap the mv call\ntry {\n  const res = await mv(page, args);\n} catch (e) {\n  if (e.message.includes('Move task timed out')) {\n    // verify state, then retry once\n    const listing = await files(page, { fid: targetFid });\n    if (!moveSucceeded(listing)) await retryMv(page, args);\n  } else throw e;\n}","preventionTips":["Move smaller batches to keep server-side tasks short.","Avoid running moves during peak hours or when Quark is degraded.","Verify results by listing the target folder after the command.","Wrap mv in a bounded retry with backoff."],"tags":["timeout","async-task","polling","quark"],"backgroundTag":"async-task-poll-timeout","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}