jackwener/OpenCLI · error · CliError
FETCH_ERROR
FETCH_ERROR
Error message
ONES worklog: all endpoints failed (last: ${lastDetail}) What it means
This FETCH_ERROR is thrown by the ONES worklog command after it tried every candidate worklog API endpoint and each failed; the message includes the last failure detail. It aggregates multiple endpoint attempts into one terminal error because ONES worklog APIs vary across deployments/versions.
Source
Thrown at clis/ones/worklog.js:266
];
}
lastDetail = `no effect (total_manhour ${String(beforeTotal)} -> ${String(afterTotal)})`;
continue;
}
// If verification read fails, return success conservatively.
return [
{
task: taskId,
date: dateStr,
hours: String(hoursHuman),
owner: ownerId,
endpoint: path,
},
];
}
lastDetail = fail;
}
throw new CliError('FETCH_ERROR', `ONES worklog: all endpoints failed (last: ${lastDetail})`);
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Read the `last:` detail in the message to see the underlying failure (401 → re-auth; 403 → permissions).
- Re-authenticate / refresh the ONES token, then retry.
- Verify the owner and task uuids are valid and the account can log work in the ONES web UI.
- Check ONES_* env vars (host/org) point to the correct instance; if it persists, report the ONES server version since endpoint shapes vary.
Example fix
// before opencli ones worklog <taskUUID> 2 --team T1 // 401 from stale cookie // after opencli ones login && opencli ones worklog <taskUUID> 2 --team T1
Defensive patterns
Strategy: retry
Validate before calling
const probe = await onesFetchInPage(page, 'auth/token_info');
if (!probe?.user?.uuid) throw new Error('Session invalid — re-authenticate before logging work.'); Type guard
function isRetryableWorklogFailure(e) { return e.code === 'FETCH_ERROR' && /all endpoints failed/.test(e.message); } Try / catch
try {
await opencli.ones.worklog({ task, hours, team });
} catch (e) {
if (e.code === 'FETCH_ERROR' && /all endpoints failed/.test(e.message)) {
console.error(e.message); // inspect `last:` detail
await refreshAuth();
return retryWithBackoff(() => opencli.ones.worklog({ task, hours, team }), 2);
}
throw e;
} Prevention
- Parse the `last:` detail to distinguish auth (401), permission (403), and shape errors.
- Re-authenticate before batch worklog operations.
- Verify worklog write access in the ONES web UI for the account.
- Pin/test against your ONES server version since worklog endpoints vary.
When it happens
Trigger: All worklog endpoints return errors — e.g. invalid owner/task uuid, insufficient permissions to write worklogs, expired auth, or the ONES instance exposes none of the supported endpoint shapes.
Common situations: Restricted accounts that lack worklog write permission; wrong org/host configuration; ONES server version whose worklog API differs; stale session cookies.
Related errors
- FETCH_ERROR
- FETCH_ERROR
- ${label} returned HTTP ${resp.status}: ${summarizeApiError(p
- arXiv API HTTP ${resp.status}
- 获取视频分P信息失败: ${error?.message || error}
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/9befe2f0a5c472d7.
Report an issue: GitHub.