{"record":{"id":"eb7bce79def420ae","repo":"decolua/9router","slug":"onboarding-timeout-please-try-again","errorCode":null,"errorMessage":"Onboarding timeout - please try again","messagePattern":"Onboarding timeout - please try again","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/oauth/services/antigravity.js","lineNumber":179,"sourceCode":"      if (result.done === true) {\n        // Extract final project ID from response\n        let finalProjectId = projectId;\n        if (result.response?.cloudaicompanionProject) {\n          const respProject = result.response.cloudaicompanionProject;\n          if (typeof respProject === 'string') {\n            finalProjectId = respProject.trim();\n          } else if (respProject.id) {\n            finalProjectId = respProject.id.trim();\n          }\n        }\n        return { success: true, projectId: finalProjectId };\n      }\n\n      // Wait 5 seconds before retry\n      await new Promise(resolve => setTimeout(resolve, 5000));\n    }\n\n    throw new Error(\"Onboarding timeout - please try again\");\n  }\n\n  /**\n   * Fetch Project ID from loadCodeAssist API (legacy method for compatibility)\n   */\n  async fetchProjectId(accessToken) {\n    const { projectId } = await this.loadCodeAssist(accessToken);\n    if (!projectId) {\n      throw new Error(\"No cloudaicompanionProject found in response\");\n    }\n    return projectId;\n  }\n\n  /**\n   * Save Antigravity tokens to server\n   */\n  async saveTokens(tokens, userInfo, projectId) {\n    const { server, token, userId } = getServerCredentials();","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/decolua/9router/blob/90b52e06ffd666b7929554211474d01588f6b1f8/src/lib/oauth/services/antigravity.js#L161-L197","documentation":"Thrown by AntigravityService.completeOnboarding after polling onboardUser maxRetries (10) times with 5-second sleeps, and the response never contained done === true. Google's onboarding is asynchronous; this means it did not complete within ~50 seconds. The method is fail-loud by design — it does not return a partial result.","triggerScenarios":"Every call to onboardUser returns HTTP 200 but with done:false (or a missing done field) for all 10 attempts — Google is still provisioning the Code Assist tier for the project.","commonSituations":"Brand-new GCP projects where backend provisioning is slow; free-tier accounts during high load; network keep-alives masking a stuck backend. Users on flaky connections may also lose the flow if they abort before a later retry would have succeeded.","solutions":["Simply re-run the antigravity connect command — provisioning often completes by the next attempt","Wait a few minutes for Google to finish provisioning the Gemini Code Assist tier, then retry","Verify at https://console.cloud.google.com that the project shows Gemini Code Assist enabled before retrying","Raise maxRetries or the 5s delay when calling completeOnboarding if provisioning is consistently slow in your region"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"const pre = await service.loadCodeAssist(token);\nif (pre.tierId === 'legacy-tier' && !pre.raw.allowedTiers) console.warn('No tiers advertised — onboarding may never report done');","typeGuard":"function isOnboardDone(r) { return r != null && r.done === true; }","tryCatchPattern":"try {\n  await service.completeOnboarding(token, projectId, tierId);\n} catch (e) {\n  if (e.message === 'Onboarding timeout - please try again') {\n    await sleep(60000); // wait for backend provisioning\n    await service.completeOnboarding(token, projectId, tierId); // one more round\n  } else throw e;\n}","preventionTips":["Retry the whole connect command — provisioning usually completes between attempts","Allow extra time for brand-new GCP projects before first connect","Pass a higher maxRetries to completeOnboarding in slow regions","Confirm tier provisioning in Cloud Console before concluding the flow is broken"],"tags":["timeout","google-cloud","onboarding","oauth"],"backgroundTag":"operation-timed-out","analyzedSha":"90b52e06ffd666b7929554211474d01588f6b1f8","analyzedAt":"2026-08-30T21:05:45.952Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}