{"record":{"id":"f43267cf2b813a0d","repo":"plandex-ai/plandex","slug":"error-fetching-pending-invites-s","errorCode":null,"errorMessage":"error fetching pending invites: %s","messagePattern":"error fetching pending invites: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/cmd/revoke.go","lineNumber":53,"sourceCode":"\terrCh := make(chan error)\n\n\tterm.StartSpinner(\"\")\n\n\tgo func() {\n\t\tvar err *shared.ApiError\n\t\tuserResp, err = api.Client.ListUsers()\n\t\tif err != nil {\n\t\t\terrCh <- fmt.Errorf(\"error fetching users: %s\", err.Msg)\n\t\t\treturn\n\t\t}\n\t\terrCh <- nil\n\t}()\n\n\tgo func() {\n\t\tvar err *shared.ApiError\n\t\tpendingInvites, err = api.Client.ListPendingInvites()\n\t\tif err != nil {\n\t\t\terrCh <- fmt.Errorf(\"error fetching pending invites: %s\", err.Msg)\n\t\t\treturn\n\t\t}\n\t\terrCh <- nil\n\t}()\n\n\tfor i := 0; i < 2; i++ {\n\t\terr := <-errCh\n\t\tif err != nil {\n\t\t\tterm.StopSpinner()\n\t\t\tterm.OutputErrorAndExit(err.Error())\n\t\t}\n\t}\n\n\tterm.StopSpinner()\n\n\ttype userInfo struct {\n\t\tId       string\n\t\tIsInvite bool","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/cmd/revoke.go#L35-L71","documentation":"This error wraps a failure from api.Client.ListPendingInvites() during the revoke command's parallel data fetch. The *shared.ApiError Msg is embedded into 'error fetching pending invites: %s'. It means the pending-invites lookup failed, so the command cannot complete its combined users+invites view.","triggerScenarios":"ListPendingInvites() returning a non-nil *shared.ApiError: expired/invalid credentials, insufficient permission to view org invites, or server/network failure while the goroutine is running.","commonSituations":"Members-only accounts that cannot view invites; API downtime; token revoked between login and command execution.","solutions":["Re-authenticate to refresh credentials","Check that your role in the org permits viewing pending invites","Verify API reachability (network/proxy/firewall)","Read the embedded err.Msg for the HTTP status code and address it specifically"],"exampleFix":"// before\nerrCh <- fmt.Errorf(\"error fetching pending invites: %s\", err.Msg)\n// after\nif errors.Is(err, shared.ErrUnauthorized) {\n\terrCh <- fmt.Errorf(\"error fetching pending invites: %s (re-authenticate with `auth login`)\", err.Msg)\n} else {\n\terrCh <- fmt.Errorf(\"error fetching pending invites: %s\", err.Msg)\n}","handlingStrategy":"try-catch","validationCode":"// pre-flight: confirm the token is present and not expired before fetching invites\nif api.Client == nil || api.Client.Token == \"\" {\n\treturn fmt.Errorf(\"not authenticated\")\n}","typeGuard":"func asApiError(err error) (*shared.ApiError, bool) {\n\tae, ok := err.(*shared.ApiError)\n\treturn ae, ok\n}","tryCatchPattern":"pendingInvites, err := api.Client.ListPendingInvites()\nif err != nil {\n\tif ae, ok := err.(*shared.ApiError); ok && ae.Status == 403 {\n\t\treturn fmt.Errorf(\"your role cannot view pending invites: %s\", ae.Msg)\n\t}\n\treturn fmt.Errorf(\"error fetching pending invites: %w\", err)\n}","preventionTips":["Confirm your org role has invite visibility before running invite-dependent commands","Handle 401 by re-authenticating automatically","Add a retry with backoff for transient 5xx responses","Log the embedded err.Msg so the failing endpoint and status are visible"],"tags":["go","cli","api","network"],"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-14T00:17:10.932Z"}