{"record":{"id":"7ef96ae901129949","repo":"odysseus-dev/odysseus","slug":"google-oauth-client-id-not-set-add-it-to-env","errorCode":null,"errorMessage":"GOOGLE_OAUTH_CLIENT_ID not set — add it to .env","messagePattern":"GOOGLE_OAUTH_CLIENT_ID not set — add it to \\.env","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"routes/email_routes.py","lineNumber":6015,"sourceCode":"            clear_q = _email_account_owner_scope(\n                db.query(EmailAccount), row.owner or \"\"\n            )\n            clear_q.update({EmailAccount.is_default: False})\n            row.is_default = True\n            db.commit()\n            return {\"ok\": True}\n        finally:\n            db.close()\n\n    # ── Google OAuth2 routes ──\n\n    @router.get(\"/oauth/google/authorize\")\n    async def google_oauth_authorize(account_id: str = Query(...), request: Request = None, owner: str = Depends(require_user)):\n        import urllib.parse\n        _assert_owns_account(account_id, owner)\n        client_id = os.environ.get(\"GOOGLE_OAUTH_CLIENT_ID\", \"\")\n        if not client_id:\n            raise HTTPException(400, \"GOOGLE_OAUTH_CLIENT_ID not set — add it to .env\")\n        redirect_uri = (\n            os.environ.get(\"GOOGLE_OAUTH_REDIRECT_URI\")\n            or f\"{request.url.scheme}://{request.headers.get('host', 'localhost:7000')}/api/email/oauth/google/callback\"\n        )\n        state = make_oauth_state(account_id, owner)\n        params = urllib.parse.urlencode({\n            \"client_id\": client_id,\n            \"redirect_uri\": redirect_uri,\n            \"response_type\": \"code\",\n            \"scope\": \"https://mail.google.com/ email\",\n            \"access_type\": \"offline\",\n            \"prompt\": \"consent\",\n            \"state\": state,\n        })\n        from fastapi.responses import RedirectResponse as _RR\n        return _RR(f\"https://accounts.google.com/o/oauth2/v2/auth?{params}\")\n\n    @router.get(\"/oauth/google/callback\")","sourceCodeStart":5997,"sourceCodeEnd":6033,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/email_routes.py#L5997-L6033","documentation":"Error \"GOOGLE_OAUTH_CLIENT_ID not set — add it to .env\" thrown in odysseus-dev/odysseus.","triggerScenarios":"Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.","commonSituations":"See trigger scenarios.","solutions":["Add GOOGLE_OAUTH_CLIENT_ID to the .env file and restart the server.","Create OAuth credentials in Google Cloud Console and configure the client id."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}