{"record":{"id":"e00dfa9e1a9d18ce","repo":"plandex-ai/plandex","slug":"error-listing-orgs-v","errorCode":null,"errorMessage":"error listing orgs: %v","messagePattern":"error listing orgs: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/auth/account.go","lineNumber":76,"sourceCode":"\t\t}\n\t}\n\n\tif selected == nil {\n\t\treturn fmt.Errorf(\"error selecting account: account not found\")\n\t}\n\n\tselectedAuth := *selected\n\n\tsetAuth(&shared.ClientAuth{\n\t\tClientAccount: selectedAuth,\n\t})\n\n\tterm.StartSpinner(\"\")\n\torgs, apiErr := apiClient.ListOrgs()\n\tterm.StopSpinner()\n\n\tif apiErr != nil {\n\t\treturn fmt.Errorf(\"error listing orgs: %v\", apiErr.Msg)\n\t}\n\n\torg, err := resolveOrgAuth(orgs, selectedAuth.IsLocalMode)\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error resolving org: %v\", err)\n\t}\n\n\terr = setAuth(&shared.ClientAuth{\n\t\tClientAccount:        *selected,\n\t\tOrgId:                org.Id,\n\t\tOrgName:              org.Name,\n\t\tOrgIsTrial:           org.IsTrial,\n\t\tIntegratedModelsMode: org.IntegratedModelsMode,\n\t})\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error setting auth: %v\", err)","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/auth/account.go#L58-L94","documentation":"After an account is selected and cached locally, SelectOrSignInOrCreate calls apiClient.ListOrgs() to fetch the organizations the account belongs to. If the Plandex server returns an API error, it is wrapped as `error listing orgs: %v` with the server's error message. This indicates the authenticated request to enumerate orgs failed, not a local problem.","triggerScenarios":"apiClient.ListOrgs() returns a non-nil ApiErr — server unreachable, invalid/expired account session token, server-side 4xx/5xx, or the account exists locally but has been revoked server-side.","commonSituations":"Server hostname changed or is behind a proxy that rejects the request; stale auth after server restart with different signing keys; expired session needing re-sign-in; network outage or VPN required.","solutions":["Run `plandex signIn` (or delete stored auth and re-authenticate) to refresh the session token, then retry.","Check connectivity to the Plandex server and verify PLANDEX_SERVER_URL / host configuration points at a reachable instance.","Inspect the embedded apiErr.Msg for a server-side cause (e.g. 401/403) and fix on the server (invite status, account removal) as indicated."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if !serverReachable(serverURL) { // e.g. net.DialTimeout before invoking\n    return fmt.Errorf(\"plandex server %s unreachable; check URL/network first\", serverURL)\n}","typeGuard":null,"tryCatchPattern":"if err := auth.SelectOrSignInOrCreate(); err != nil {\n    if strings.Contains(err.Error(), \"error listing orgs\") {\n        if isAuthErr(err) { return reSignInAndRetry() }\n        if isTransient(err) { return retryWithBackoff(auth.SelectOrSignInOrCreate, 3) }\n    }\n    return err\n}","preventionTips":["Refresh sessions proactively; re-run signIn when a 401 first appears.","Validate PLANDEX_SERVER_URL / host config before running org-dependent commands.","Retry transient network failures with backoff before surfacing the error."],"tags":["network","api","auth","orgs"],"backgroundTag":"api-request-failed","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"}