jackwener/OpenCLI · error · CommandExecutionError

http

Error message

http

What it means

If the /u/<self>.json fetch completes with a non-ok status other than 401/403 (e.g. 429, 5xx), the probe returns {kind:'http', httpStatus} and verifyLinuxDoIdentity throws CommandExecutionError `HTTP <status> from Linux.do /u/<self>.json`. This signals a server-side or rate-limit problem, not an auth failure.

Source

Thrown at clis/linux-do/auth.js:36

      if (!u) return { kind: 'auth', detail: 'Linux.do meta[current-user-username] missing — anonymous' };
      const r = await fetch('/u/' + encodeURIComponent(u) + '.json', {
        credentials: 'include',
        headers: { Accept: 'application/json' },
      });
      if (r.status === 401 || r.status === 403) {
        return { kind: 'auth', detail: 'Linux.do /u/<self>.json HTTP ' + r.status };
      }
      if (!r.ok) return { kind: 'http', httpStatus: r.status };
      const d = await r.json();
      const user = d?.user;
      if (!user || !user.id) return { kind: 'auth', detail: 'Linux.do /u/<self>.json missing user.id' };
      return { ok: true, user_id: String(user.id), username: String(user.username || u), name: String(user.name || '') };
    } catch (e) {
      return { kind: 'exception', detail: String(e && e.message || e) };
    }
  })()`);
  if (probe?.kind === 'auth') throw new AuthRequiredError('linux.do', probe.detail);
  if (probe?.kind === 'http') throw new CommandExecutionError(`HTTP ${probe.httpStatus} from Linux.do /u/<self>.json`);
  if (probe?.kind === 'exception') throw new CommandExecutionError(`Linux.do whoami failed: ${probe.detail}`);
  if (!probe?.ok) throw new CommandExecutionError(`Unexpected Linux.do probe: ${JSON.stringify(probe)}`);
  return { user_id: probe.user_id, username: probe.username, name: probe.name };
}

registerSiteAuthCommands({
  site: 'linux-do',
  domain: 'linux.do',
  loginUrl: 'https://linux.do/login',
  columns: ['user_id', 'username', 'name'],
  quickCheck: hasLinuxDoSessionCookie,
  verify: verifyLinuxDoIdentity,
  poll: async (page) => {
    if (!await hasLinuxDoSessionCookie(page)) {
      throw new AuthRequiredError('linux.do', 'Waiting for Linux.do _t cookie');
    }
    return verifyLinuxDoIdentity(page);
  },

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Wait and retry after a backoff — most commonly a 429 rate-limit
  2. Check linux.do status/uptime for a server-side incident
  3. Reduce the frequency of auth verify/status polling
  4. If Cloudflare is challenging, solve it once in the browser then retry

Example fix

// before (tight loop)
while (!ok) verifyLinuxDoIdentity(page);
// after
await new Promise(r => setTimeout(r, 30_000)); // backoff before retry
verifyLinuxDoIdentity(page);
Defensive patterns

Strategy: retry

Validate before calling

// Throttle your own polling; Discourse rate-limits /u/*.json
await new Promise(r => setTimeout(r, 30_000)); // min interval between verify calls

Try / catch

const verifyWithRetry = async (page, attempts = 3) => {
  for (let i = 0; i < attempts; i++) {
    try { return await verifyLinuxDoIdentity(page); }
    catch (e) {
      if (/HTTP \d+ from Linux\.do/.test(e.message) && i < attempts - 1) {
        await new Promise(r => setTimeout(r, 2 ** i * 15_000));
        continue;
      }
      throw e;
    }
  }
};

Prevention

When it happens

Trigger: Discourse returning 429 (rate limit) or 5xx for the whoami endpoint while the session itself is valid.

Common situations: Hammering the linux.do API with repeated verify calls; linux.do server incident/maintenance window; Cloudflare returning 5xx; bot mitigation returning 429.

Related errors


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