{"record":{"id":"46898ad68751f171","repo":"plandex-ai/plandex","slug":"error-creating-org","errorCode":null,"errorMessage":"Error creating org: ","messagePattern":"Error creating org: ","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"app/server/handlers/orgs.go","lineNumber":138,"sourceCode":"\t\t\tAuth: auth,\n\t\t\tTx:   tx,\n\n\t\t\tCreateOrgHookRequestParams: &hooks.CreateOrgHookRequestParams{\n\t\t\t\tOrg: org,\n\t\t\t},\n\t\t})\n\n\t\treturn nil\n\t})\n\n\tif apiErr != nil {\n\t\twriteApiError(w, *apiErr)\n\t\treturn\n\t}\n\n\tif err != nil {\n\t\tlog.Printf(\"Error creating org: %v\\n\", err)\n\t\thttp.Error(w, \"Error creating org: \"+err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tresp := shared.CreateOrgResponse{\n\t\tId: org.Id,\n\t}\n\n\tbytes, err := json.Marshal(resp)\n\n\tif err != nil {\n\t\tlog.Printf(\"Error marshalling response: %v\\n\", err)\n\t\thttp.Error(w, \"Error marshalling response: \"+err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\terr = SetAuthCookieIfBrowser(w, r, auth.User, \"\", org.Id)\n\tif err != nil {\n\t\tlog.Printf(\"Error setting auth cookie: %v\\n\", err)","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/handlers/orgs.go#L120-L156","documentation":"CreateOrgHandler: the db.WithTx transaction (org insert + hooks) returned a non-ApiError error after any apiErr was handled, so a generic 500 is written. DB or hook failure during org creation; the tx rolled back.","triggerScenarios":"Thrown at app/server/handlers/orgs.go:138 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check server logs for the wrapped tx error","Review CreateOrg hook failures (billing/provisioning)","Retry creation; the rollback leaves no partial org"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}