fix: handle Cloud Run 409 by linking to existing service; show provisioning spinner not failure
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -112,6 +112,16 @@ export async function provisionTheiaWorkspace(
|
||||
|
||||
if (!createRes.ok) {
|
||||
const body = await createRes.text();
|
||||
|
||||
// 409 = service already exists — fetch its URL instead of failing
|
||||
if (createRes.status === 409) {
|
||||
console.log(`[workspace] Cloud Run service already exists: ${serviceName} — fetching existing URL`);
|
||||
const serviceUrl = await waitForServiceUrl(serviceName, token);
|
||||
await allowUnauthenticated(serviceName, token);
|
||||
console.log(`[workspace] Linked to existing service: ${serviceName} → ${serviceUrl}`);
|
||||
return { serviceUrl, serviceName };
|
||||
}
|
||||
|
||||
throw new Error(`Cloud Run create service failed (${createRes.status}): ${body}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user