{"record":{"id":"4487f46cccc75f0c","repo":"plandex-ai/plandex","slug":"error-verifying-email-v-4487f4","errorCode":null,"errorMessage":"error verifying email: %v","messagePattern":"error verifying email: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/auth/auth.go","lineNumber":97,"sourceCode":"\t\tCurrent.OrgName = org.Name\n\t\tCurrent.IntegratedModelsMode = org.IntegratedModelsMode\n\n\t\terr = writeCurrentAuth()\n\n\t\tif err != nil {\n\t\t\tterm.OutputErrorAndExit(\"Error writing auth: %v\", err)\n\t\t}\n\t}\n}\n\nfunc RefreshInvalidToken() error {\n\tif Current == nil {\n\t\treturn fmt.Errorf(\"error refreshing token: auth not loaded\")\n\t}\n\tres, err := verifyEmail(Current.Email, Current.Host)\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error verifying email: %v\", err)\n\t}\n\n\tif res.hasAccount {\n\t\treturn signIn(Current.Email, res.pin, Current.Host)\n\t} else {\n\t\thost := Current.Host\n\t\tif host == \"\" {\n\t\t\thost = \"Plandex Cloud\"\n\t\t}\n\n\t\tterm.OutputErrorAndExit(\"Account %s not found on %s\", Current.Email, host)\n\t}\n\n\treturn nil\n}\n\nfunc RefreshAuth() error {\n\tif Current == nil {","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/auth/auth.go#L79-L115","documentation":"RefreshInvalidToken calls verifyEmail(Current.Email, Current.Host) to check the account exists and get a PIN for re-authentication. Any failure from that call (network error, server error, malformed response) is wrapped as this error.","triggerScenarios":"verifyEmail fails because the server is unreachable, returns a non-2xx/ApiError, the host is misconfigured, or Current.Email/Host are empty or stale.","commonSituations":"Offline or behind a proxy/VPN blocking the Plandex server; self-hosted server down or DNS misconfigured; token expired long ago and the stored host URL changed (e.g. after migrating a self-hosted instance); account deleted server-side.","solutions":["Check network connectivity to the configured host (or Plandex Cloud)","Verify the host URL in auth.json is correct and the server is up (curl the health endpoint)","Run `plandex sign in` fresh to re-establish email/host and a new token","If self-hosted, confirm the server version matches the CLI and is reachable"],"exampleFix":"// before\nhost := \"http://old-server.internal:8080\" // unreachable\n// after\ncurl -s http://new-server.internal:8080/health && plandex sign in --host http://new-server.internal:8080","handlingStrategy":"retry","validationCode":"if auth.Current == nil || auth.Current.Email == \"\" {\n\treturn fmt.Errorf(\"no stored email to verify; run `plandex sign in`\")\n}\n// preflight: can we reach the host?\nresp, err := http.Get(hostBaseURL + \"/health\")\nif err != nil || resp.StatusCode != 200 {\n\treturn fmt.Errorf(\"server unreachable; refresh would fail\")\n}","typeGuard":"func refreshPossible() bool { return auth.Current != nil && auth.Current.Email != \"\" && auth.Current.Host != \"\" }","tryCatchPattern":"if err := auth.RefreshInvalidToken(); err != nil {\n\tif strings.Contains(err.Error(), \"verifying email\") {\n\t\t// transient network/server issue: back off and retry\n\t\ttime.Sleep(2 * time.Second)\n\t\terr = auth.RefreshInvalidToken()\n\t}\n\tif err != nil { term.OutputErrorAndExit(\"%v\", err) }\n}","preventionTips":["Verify network/proxy/VPN access to the Plandex host before long sessions","Keep the host URL in auth.json current after server migrations","Confirm the account still exists on the target host","Use the same CLI and server version pair"],"tags":["network","auth","email-verification"],"backgroundTag":"server-unreachable","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"}