{"record":{"id":"7ccaa5410b47a7bb","repo":"langgenius/dify","slug":"context-id-not-found","errorCode":null,"errorMessage":"context_id not found","messagePattern":"context_id not found","errorType":"http","errorClass":"Forbidden","httpStatus":403,"severity":"error","filePath":"api/controllers/console/datasets/rag_pipeline/datasource_auth.py","lineNumber":216,"sourceCode":"            \"context_id\",\n            context_id,\n            httponly=True,\n            samesite=\"Lax\",\n            max_age=OAuthProxyService.__MAX_AGE__,\n        )\n        return response\n\n\n@console_ns.route(\"/oauth/plugin/<path:provider_id>/datasource/callback\")\nclass DatasourceOAuthCallback(Resource):\n    @console_ns.doc(params=query_params_from_model(DatasourceOAuthCallbackQuery))\n    # response-contract:ignore redirect response\n    @console_ns.response(302, \"Redirect to OAuth callback page\")\n    @setup_required\n    def get(self, provider_id: str):\n        context_id = request.cookies.get(\"context_id\") or request.args.get(\"context_id\")\n        if not context_id:\n            raise Forbidden(\"context_id not found\")\n\n        context = OAuthProxyService.use_proxy_context(context_id)\n        if context is None:\n            raise Forbidden(\"Invalid context_id\")\n\n        user_id: str = context[\"user_id\"]\n        tenant_id: str = context[\"tenant_id\"]\n        datasource_provider_id = DatasourceProviderID(provider_id)\n        plugin_id = datasource_provider_id.plugin_id\n        datasource_provider_service = DatasourceProviderService()\n        oauth_client_params = datasource_provider_service.get_oauth_client(\n            tenant_id=tenant_id,\n            datasource_provider_id=datasource_provider_id,\n        )\n        if not oauth_client_params:\n            raise NotFound()\n        redirect_uri = f\"{dify_config.CONSOLE_API_URL}/console/api/oauth/plugin/{provider_id}/datasource/callback\"\n        oauth_handler = OAuthHandler()","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/datasets/rag_pipeline/datasource_auth.py#L198-L234","documentation":"Error \"context_id not found\" thrown in langgenius/dify.","triggerScenarios":"Thrown at api/controllers/console/datasets/rag_pipeline/datasource_auth.py:216 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:31:55.035Z"}