{"record":{"id":"9ba48571aa5acbd8","repo":"multica-ai/multica","slug":"timed-out-waiting-for-workspace-creation","errorCode":null,"errorMessage":"timed out waiting for workspace creation","messagePattern":"timed out waiting for workspace creation","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_login.go","lineNumber":206,"sourceCode":"\t\ttime.Sleep(pollInterval)\n\n\t\tctx, cancel := context.WithTimeout(context.Background(), pollRequestTimeout)\n\t\tvar workspaces []struct {\n\t\t\tID   string `json:\"id\"`\n\t\t\tName string `json:\"name\"`\n\t\t}\n\t\terr := client.GetJSON(ctx, \"/api/workspaces\", &workspaces)\n\t\tcancel()\n\n\t\tif err != nil {\n\t\t\tcontinue // transient error, keep polling\n\t\t}\n\t\tif len(workspaces) > 0 {\n\t\t\treturn workspaces, nil\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"timed out waiting for workspace creation\")\n}\n","sourceCodeStart":188,"sourceCodeEnd":208,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_login.go#L188-L208","documentation":"Thrown by waitForWorkspaceCreation after the login flow has polled GET /api/workspaces every 2 seconds for a hard 5-minute deadline (cmd_login.go:176-206) without ever seeing a non-empty workspace list. Transient per-poll errors are intentionally swallowed (continue), so this error means either the user never completed workspace creation in the browser, or every poll failed silently for 5 minutes (bad token, network partition).","triggerScenarios":"Login succeeded but the user never visited the create-workspace URL or abandoned the browser flow; every GetJSON poll fails for the full 5 minutes (server died mid-poll, token revoked); the account genuinely has zero workspaces and none was created in time.","commonSituations":"Browser did not open automatically on a headless machine/SSH session (the CLI prints the URL to stderr but the user missed it); CI/automation invoking interactive login; slow human response exceeding 5 minutes; server restarted during the wait.","solutions":["Re-run `multica login` and complete workspace creation in the browser within 5 minutes; copy the URL printed to stderr if no browser opened.","Confirm the account already has a workspace — if it does and the error still fires, the polls are failing: check server reachability and token validity.","For headless/SSH setups, forward the URL manually (e.g. port-forward localhost and open the URL on your workstation).","For automation, skip the interactive wait: pre-create the workspace via the API and configure the token directly instead of using `login`."],"exampleFix":"// before: interactive login blocks 5 min then fails on headless box\nmultica login\n// timed out waiting for workspace creation\n\n// after: create the workspace out-of-band, then login resolves immediately\n curl -X POST https://server/api/workspaces -H \"Authorization: Bearer $TOKEN\" -d '{\"name\":\"main\"}'\nmultica login   # first poll now returns a workspace","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"workspaces, err := waitForWorkspaceCreation(cmd, client)\nif err != nil && strings.Contains(err.Error(), \"timed out waiting\") {\n    // fall back to non-interactive path: create workspace via API or abort with guidance\n}","preventionTips":["Complete the browser workspace-creation step promptly after login starts.","On headless machines, copy the printed URL to a local browser immediately.","In automation, pre-create the workspace via the API instead of relying on the interactive 5-minute poll."],"tags":["cli","timeout","polling","onboarding","go"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}