coleam00/Archon · error

Subscription login failed to start.

Error message

Subscription login failed to start.

What it means

Generic failure in startOAuth (oauth-bridge.ts:388): the login chain rejected before producing a URL/user-code and the failure was not classified as port-busy. The bridge throws session.detail (the sanitized, truncated underlying error) or this fallback string when detail is missing. It signals the subscription login could not even begin.

Solutions

  1. Inspect the thrown message — if it equals this fallback, check server logs (oauth_bridge.login_failed warn) for the sanitized underlying error.
  2. Verify network/proxy access to the provider's OAuth endpoints.
  3. Retry the login; if consistent, check provider configuration and package versions.
  4. Restart the Archon server to clear any stuck in-flight login state.
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-check basic reachability of the provider auth endpoint before starting a login
const ok = await fetch('https://anthropic.com', { method: 'HEAD' }).then(r => r.ok).catch(() => false);
if (!ok) throw new Error('Network unreachable; fix connectivity before login.');

Try / catch

try {
  await startOAuth(userId, providerId);
} catch (e) {
  const msg = e instanceof Error ? e.message : '';
  if (msg === 'Subscription login failed to start.' || !msg) {
    // Detail was missing: consult server logs (oauth_bridge.login_failed)
    getLog().error({ userId, providerId }, 'subscription_login_failed_opaque');
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling startOAuth when the underlying pi login() (or the openai manual flow) rejects before the first auth callback — e.g. network failure reaching the authorization endpoint, provider misconfiguration, or any early error without session.detail set.

Common situations: Corporate proxy or DNS blocking the provider's auth endpoint; expired/invalid provider configuration; pi-ai login throwing on startup; offline environment; the rare case where the underlying error message was empty or sanitized to nothing.

Related errors


AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01). Data as JSON: /api/errors/97c07f6ad27e227c. Report an issue: GitHub.

Appendix: source

Thrown at packages/core/src/credentials/oauth-bridge.ts:388

    });

  // Wait for the first callback so the URL / user-code is available to return.
  await Promise.race([session.firstSignal.promise, sleep(START_FIRST_SIGNAL_MS)]);

  // An early login() failure → throw (route returns 500, CLI prints the message)
  // rather than returning a misleading { mode:'manual', url:undefined } (I1).
  if (session.status === 'error') {
    sessions.delete(sessionId);
    if (session.portBusy) {
      // Retryable: the cancel above releases the port as soon as the previous
      // login unwinds (microtasks for pi flows), so "retry shortly" is honest
      // advice — and a restart always clears it (#1963).
      throw new OAuthCallbackPortBusyError(
        `A previous '${provider}' login attempt is still holding the OAuth callback port. ` +
          'Wait a few seconds and retry; if it persists, restart the Archon server.'
      );
    }
    throw new Error(session.detail ?? 'Subscription login failed to start.');
  }

  // Superseded (or cancelled) while still waiting for the first signal — the
  // session is already gone from the map, so a 200 here would hand back a
  // url-less session the first poll immediately reports as "not found".
  // Throw the honest answer instead (S4).
  if (!sessions.has(sessionId)) {
    throw new Error('Login attempt was superseded by a newer one. Retry to start a fresh login.');
  }

  return {
    sessionId,
    mode: externalMode(session),
    url: session.url,
    userCode: session.userCode,
    verificationUri: session.verificationUri,
    expiresIn: Math.round(SESSION_TTL_MS / 1000),
  };

View on GitHub (pinned to 0773b97458)