decolua/9router · error · Error

onboardUser HTTP ${response.status}: ${errorText.slice(0, 20

Error message

onboardUser HTTP ${response.status}: ${errorText.slice(0, 200)}

What it means

When loadCodeAssist indicates the account is not yet onboarded, fetchProjectId calls the onboardUser endpoint and polls it. This error is thrown when the onboardUser HTTP response is not OK, carrying the status and first 200 chars of the error body. It means Google refused the onboarding request itself.

Source

Thrown at open-sse/services/projectId.js:230

        // Per-attempt timeout controller; forwards external abort as well
        const localCtrl = new AbortController();
        const timeoutId = setTimeout(() => localCtrl.abort(), 30_000);
        const forwardAbort = () => localCtrl.abort();
        externalSignal?.addEventListener("abort", forwardAbort);

        try {
            const response = await fetch(endpoints.onboardUser, {
                method: "POST",
                headers: { ...headers, "Authorization": `Bearer ${accessToken}` },
                body: JSON.stringify(reqBody),
                signal: localCtrl.signal
            });

            clearTimeout(timeoutId);

            if (!response.ok) {
                const errorText = await response.text().catch(() => "");
                throw new Error(`onboardUser HTTP ${response.status}: ${errorText.slice(0, 200)}`);
            }

            const data = await response.json();

            if (data.done === true) {
                const projectId = extractProjectIdFromOnboard(data);
                if (projectId) {
                    console.log(`[ProjectId] Successfully onboarded, project ID: ${projectId}`);
                    return projectId;
                }
                throw new Error("onboardUser done but no project_id in response");
            }

            // Server not done yet – wait and retry
            console.log(`[ProjectId] Onboard attempt ${attempt}/${MAX_ATTEMPTS}: not done yet, waiting...`);
            await new Promise(resolve => setTimeout(resolve, 2000));

        } catch (error) {

View on GitHub (pinned to 90b52e06ff)

Solutions

  1. Re-authorize the account to obtain a fresh access token before onboarding
  2. Read the embedded error body for the Google error reason and address it (quota, permission, region)
  3. Reduce onboard polling pressure — the code already waits 2s between attempts; wait for any rate-limit window to pass and retry
  4. Verify proxy/network path to cloudcode-pa.googleapis.com is not intercepted or blocked

Example fix

// before
await onboardUser(accessToken, proxyOptions);
// after
try {
  await onboardUser(accessToken, proxyOptions);
} catch (e) {
  if (/HTTP 429/.test(e.message)) {
    await sleep(60_000);
    await onboardUser(accessToken, proxyOptions);
  } else throw e;
}
Defensive patterns

Strategy: retry

Validate before calling

if (!accessToken) throw new Error('Authorize the account before onboarding.');

Type guard

function canOnboard(t) { return typeof t === 'string' && t.length > 0; }

Try / catch

try {
  await onboardUser(accessToken, proxyOptions);
} catch (e) {
  if (/HTTP 429/.test(e.message)) { await sleep(60_000); return onboardUser(accessToken, proxyOptions); }
  if (/HTTP (401|403)/.test(e.message)) { await reauthorize(conn); return onboardUser(await getToken(conn), proxyOptions); }
  throw e;
}

Prevention

When it happens

Trigger: The onboardUser POST returns a non-2xx status after the polling request — 401/403 from bad/expired credentials, 429 from too many onboard attempts, or 5xx from Google.

Common situations: Brand-new Gemini/Code Assist account that Google refuses to onboard (quota/abuse limits); access token expiring mid-poll; regional availability restrictions on Cloud Code onboarding.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


AI-assisted analysis of decolua/9router@90b52e06ff (2026-08-30). Data as JSON: /api/errors/caf596318d728d89. Report an issue: GitHub.