{"record":{"id":"38bd14b4e2950973","repo":"windmill-labs/windmill","slug":"timed-out-waiting-for-the-project-to-become-reacha","errorCode":null,"errorMessage":"Timed out waiting for the project to become reachable","messagePattern":"Timed out waiting for the project to become reachable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/workspaceSettings/supabaseProvisioning.ts","lineNumber":177,"sourceCode":"\tonStatus?: (status: string | undefined) => void,\n\tattempts = 60\n): Promise<SupabaseProject> {\n\tfor (let i = 0; i < attempts; i++) {\n\t\tawait new Promise((r) => setTimeout(r, 5000))\n\t\tlet list: SupabaseProject[]\n\t\ttry {\n\t\t\tlist = await listSupabaseProjects(token)\n\t\t} catch (err) {\n\t\t\t// A transient failure is worth another poll; an expired token is not -- retrying it\n\t\t\t// burns five minutes and then reports a timeout, which names the wrong problem.\n\t\t\tif (!get(oauthStore)?.access_token) throw err\n\t\t\tcontinue\n\t\t}\n\t\tconst project = list?.find?.((p) => projectRef(p) === projectId)\n\t\tif (project?.status === 'ACTIVE_HEALTHY') return project\n\t\tonStatus?.(project?.status)\n\t}\n\tthrow new Error('Timed out waiting for the project to become reachable')\n}\n\n/**\n * The session-mode Supavisor endpoint of the project's primary database.\n *\n * Which pooler a project sits behind is assigned by Supabase, not derived from its\n * region: constructing `aws-0-<region>.pooler.supabase.com` is wrong for every project\n * that landed on another one, and the resulting resource never connects.\n */\nexport async function getSupabasePooler(token: string, projectId: string): Promise<SupabasePooler> {\n\tconst res = await fetch(`${base}/api/oauth/get_supabase_pooler/${projectId}`, {\n\t\theaders: headers(token)\n\t})\n\tconst configs: SupabasePooler[] = await unwrap(res, 'Could not read the connection details')\n\tconst primary = configs.filter((c) => c.database_type === 'PRIMARY')\n\tconst pooler = primary.find((c) => c.pool_mode === 'session') ?? primary[0] ?? configs[0]\n\tif (!pooler) throw new Error('Supabase returned no connection details for this project')\n\treturn pooler","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/workspaceSettings/supabaseProvisioning.ts#L159-L195","documentation":"waitUntilSupabaseHealthy polls the Supabase projects list until the newly created project reports status ACTIVE_HEALTHY. If the loop exhausts its attempts before the project becomes reachable, it throws this timeout error. Newly created Supabase projects usually take a few minutes to provision, so this fires when provisioning is slower than the wait budget or the project failed to start.","triggerScenarios":"runSetup creates a Supabase project and polls for health; the project stays in another status (e.g. 'COMING_UP', 'RESTORING') or disappears from the list for the whole polling window, then the timeout is thrown.","commonSituations":"Supabase provisioning backlogs making new projects take longer than the wait window; project stuck in an error state; wrong projectId being matched (created project ref doesn't match the one polled); heavy region with slow cold-start.","solutions":["Wait a few minutes and re-run the setup/provisioning step — the project usually becomes ACTIVE_HEALTHY on its own.","Check the project's status in the Supabase dashboard; if it's failed/stuck, delete it and create a new one.","Verify the projectId being polled matches the project returned by the create call.","Increase the polling timeout/attempts in supabaseProvisioning.ts if provisioning in your region is consistently slow."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"const project = (await listSupabaseProjects(token)).find((p) => p.id === projectId)\nif (project && project.status !== 'ACTIVE_HEALTHY') console.log('still', project.status, '- keep waiting')","typeGuard":"function isHealthy(p?: { status?: string }): p is { status: 'ACTIVE_HEALTHY' } & Record<string, unknown> {\n  return !!p && p.status === 'ACTIVE_HEALTHY'\n}","tryCatchPattern":"try {\n  await waitUntilSupabaseHealthy(token, projectId, onStatus)\n} catch (e) {\n  if (e.message.includes('Timed out')) {\n    // resume provisioning later; project may still be coming up\n  } else throw e\n}","preventionTips":["Provision during off-peak hours; Supabase creation can be slow.","Show live project status (onStatus) so users know provisioning is still in progress.","Verify the created project ref matches the polled projectId before waiting."],"tags":["timeout","polling","supabase","provisioning"],"backgroundTag":"resource-provisioning-timeout","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}