{"record":{"id":"4aef10e1f7de7e85","repo":"wavetermdev/waveterm","slug":"error-creating-starter-workspace-w","errorCode":null,"errorMessage":"error creating starter workspace: %w","messagePattern":"error creating starter workspace: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wcore/wcore.go","lineNumber":77,"sourceCode":"\t\t}\n\t}\n\tlog.Printf(\"clientid: %s\\n\", client.OID)\n\twstore.SetClientId(client.OID)\n\tif len(client.WindowIds) == 1 {\n\t\tlog.Println(\"client has one window\")\n\t\tCheckAndFixWindow(ctx, client.WindowIds[0])\n\t\treturn firstLaunch, nil\n\t}\n\tif len(client.WindowIds) > 0 {\n\t\tlog.Println(\"client has windows\")\n\t\treturn firstLaunch, nil\n\t}\n\twsId := \"\"\n\tif firstLaunch {\n\t\tlog.Println(\"client has no windows and first launch, creating starter workspace\")\n\t\tstarterWs, err := CreateWorkspace(ctx, \"Starter workspace\", \"custom@wave-logo-solid\", \"#58C142\", false, true)\n\t\tif err != nil {\n\t\t\treturn firstLaunch, fmt.Errorf(\"error creating starter workspace: %w\", err)\n\t\t}\n\t\twsId = starterWs.OID\n\t}\n\t_, err = CreateWindow(ctx, nil, wsId)\n\tif err != nil {\n\t\treturn firstLaunch, fmt.Errorf(\"error creating window: %w\", err)\n\t}\n\treturn firstLaunch, nil\n}\n\nfunc CreateClient(ctx context.Context) (*waveobj.Client, error) {\n\tclient := &waveobj.Client{\n\t\tOID:       uuid.NewString(),\n\t\tWindowIds: []string{},\n\t}\n\terr := wstore.DBInsert(ctx, client)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error inserting client: %w\", err)","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/wcore/wcore.go#L59-L95","documentation":"Returned when creation of the starter (default) workspace fails during initialization, e.g. a persistence or configuration error. The underlying error is wrapped with %w.","triggerScenarios":"firstLaunch is true (client has no windows) and CreateWorkspace(ctx, \"Starter workspace\", ...) returns an error — typically the underlying wstore.DBInsert of the new workspace object fails.","commonSituations":"First run with a failing/unwritable DB; a partially initialized workspace table; schema migration problems after upgrading Wave.","solutions":["Read the wrapped error for the root cause (insert vs validation failure)","Verify the wavetool DB is writable and not corrupted","Delete the DB to force clean first-launch initialization","Report a bug with logs if the starter workspace fails on a fresh install"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"clientData, err := wcore.GetClientData(ctx)\nisFirstLaunch := err == nil && len(clientData.WindowIds) == 0\nif isFirstLaunch { /* verify DB writable before CreateWorkspace */ }","typeGuard":null,"tryCatchPattern":"firstLaunch, err := wcore.EnsureInitialData(ctx)\nif err != nil && strings.Contains(err.Error(), \"starter workspace\") {\n    log.Printf(\"starter workspace creation failed: %v\", err)\n}","preventionTips":["Keep the DB healthy so first-launch inserts succeed","Don't delete workspace rows manually while Wave runs","Test first launch on a fresh profile after upgrades","Capture logs from first run for debugging"],"tags":["database","workspace","first-launch"],"backgroundTag":"workspace-creation-failed","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}