{"record":{"id":"c100a0647580ea42","repo":"plandex-ai/plandex","slug":"error-listing-orgs","errorCode":null,"errorMessage":"Error listing orgs: ","messagePattern":"Error listing orgs: ","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"app/server/handlers/orgs.go","lineNumber":30,"sourceCode":"\n\tshared \"plandex-shared\"\n\n\t\"github.com/jmoiron/sqlx\"\n)\n\nfunc ListOrgsHandler(w http.ResponseWriter, r *http.Request) {\n\tlog.Println(\"Received request for ListOrgsHandler\")\n\n\tauth := Authenticate(w, r, false)\n\tif auth == nil {\n\t\treturn\n\t}\n\n\torgs, err := db.GetAccessibleOrgsForUser(auth.User)\n\n\tif err != nil {\n\t\tlog.Printf(\"Error listing orgs: %v\\n\", err)\n\t\thttp.Error(w, \"Error listing orgs: \"+err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tapiOrgs, apiErr := toApiOrgs(orgs)\n\n\tif apiErr != nil {\n\t\tlog.Printf(\"Error converting orgs to api: %v\\n\", apiErr)\n\t\twriteApiError(w, *apiErr)\n\t\treturn\n\t}\n\n\tbytes, err := json.Marshal(apiOrgs)\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}","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/handlers/orgs.go#L12-L48","documentation":"HTTP 500 error body sent by ListOrgsHandler when db.GetAccessibleOrgsForUser fails to query which orgs the authenticated user can access. It signals a database or lookup failure on the server side after successful authentication; the underlying database error message is appended to the response returned to the client.","triggerScenarios":"Thrown at app/server/handlers/orgs.go:30 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped error in server logs","Check DB connectivity and org-membership query health","Retry after the DB issue is addressed"],"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"}