JuliusBrussee/caveman · error · Error
caveman: remote session revocation was unavailable…
Error message
caveman: remote session revocation was unavailable; credentials kept — retry `caveman logout`
What it means
Thrown during `caveman logout` when the POST to `${baseURL}/api/v1/auth/logout` (remote session revocation) throws at the transport level — network failure, DNS error, or request abort. Local credentials are preserved so the logout can be retried.
Solutions
- Restore connectivity to the gateway and re-run `caveman logout`.
- Verify the configured baseURL points at the correct, reachable auth host.
- If behind a proxy/firewall, allowlist the auth endpoint or configure proxy env vars.
- Retry later during a known outage; credentials were kept, so retrying is safe.
Defensive patterns
Strategy: retry
Validate before calling
// Check reachability of the auth logout endpoint first
const reachable = await fetch(`${baseURL}/api/v1/auth/logout`, { method: "HEAD", signal: AbortSignal.timeout(5000) }).then(r => true).catch(() => false);
if (!reachable) console.warn("Skipping logout until the auth server is reachable."); Try / catch
try {
await logout();
} catch (e) {
if (e instanceof Error && e.message.includes("session revocation was unavailable")) {
await new Promise(r => setTimeout(r, 3000));
await logout();
} else throw e;
} Prevention
- Ensure network/proxy access to `${baseURL}` before running logout.
- Update DNS/hosts after gateway migrations.
- Credentials are kept on this error, so retrying is safe and idempotent.
When it happens
Trigger: `caveman logout` with a stored refresh token when the auth server is unreachable: offline machine, wrong baseURL, server down, TLS interception, or connection reset mid-request.
Common situations: Logging out while offline or behind a blocking proxy; corporate firewall blocking the auth host; auth service outage; stale DNS after a gateway migration.
Related errors
- caveman: remote gateway key revocation was unavailable…
- caveman: remote session revocation failed
- awscreds: sts assume role with web identity failed
- binary download failed: HTTP
- cave_agent_tool_timeout | cave_network_error
AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20).
Data as JSON: /api/errors/aaa67e1d2030b084.
Report an issue: GitHub.
Appendix: source
Thrown at packages/cli/src/index.ts:9836
const headers: Record<string, string> = {
authorization: `Bearer ${cfg.token}`,
"x-cave-client": "cli",
};
const request: RequestInit = {
method: "POST",
redirect: "manual",
headers,
signal: AbortSignal.timeout(5000),
};
if (cfg.refreshToken) {
headers["content-type"] = "application/json";
request.body = JSON.stringify({ refresh_token: cfg.refreshToken });
}
let response: Response;
try {
response = await fetch(`${cfg.baseURL}/api/v1/auth/logout`, request);
} catch {
throw new Error("caveman: remote session revocation was unavailable; credentials kept — retry `caveman logout`");
}
if (!response.ok) throw new Error(`caveman: remote session revocation failed (HTTP ${response.status}); credentials kept — retry \`caveman logout\``);
}
if (externalToken) {
console.error("caveman: remote session revoked; CAVE_TOKEN remains set by the parent environment — unset it before the next command");
print({ logged_out: true, remote_session_revoked: true, external_token_cleared: false, external_token_source: "CAVE_TOKEN" });
return;
}
// Persist remote completion before deleting the only local credential. If
// Keychain/file cleanup fails, the next logout safely retries cleanup without
// trying to authenticate with the now-revoked session.
await saveConfig({ ...cfg, logoutPendingLocalCleanup: true });
clearToken(cfg.tokenStore);
await saveConfig({ baseURL: "", token: "" });
print({ logged_out: true });
}
function sleep(ms: number) {View on GitHub (pinned to 3ee70a1026)