{"record":{"id":"f52530d7173ba64f","repo":"infiniflow/ragflow","slug":"bigquery-project-id-is-required","errorCode":null,"errorMessage":"BigQuery project_id is required.","messagePattern":"BigQuery project_id is required\\.","errorType":"validation","errorClass":"ConnectorValidationError","httpStatus":null,"severity":"error","filePath":"common/data_source/bigquery_connector.py","lineNumber":593,"sourceCode":"            return\n\n        from api.db.services.connector_service import ConnectorService\n\n        updated_conf = copy.deepcopy(self._sync_config)\n        updated_conf[\"sync_cursor_value\"] = self.serialize_cursor_value(self._pending_sync_cursor_value)\n        updated_conf[\"sync_cursor_id\"] = self._pending_sync_cursor_id\n        ConnectorService.update_by_id(self._sync_connector_id, {\"config\": updated_conf})\n        self._sync_config = updated_conf\n\n    # ------------------------------------------------------------------ #\n    # Validation\n    # ------------------------------------------------------------------ #\n    def validate_connector_settings(self) -> None:\n        \"\"\"Validate settings via SELECT 1 plus a dry-run of the configured base query.\"\"\"\n        if not self._credentials:\n            raise ConnectorMissingCredentialError(\"BigQuery credentials not loaded.\")\n        if not self.project_id:\n            raise ConnectorValidationError(\"BigQuery project_id is required.\")\n        if not self.content_columns:\n            raise ConnectorValidationError(\"At least one content column must be specified.\")\n        if not self.query and not (self.dataset_id and self.table_id):\n            raise ConnectorValidationError(\"BigQuery requires either a custom query or both dataset_id and table_id.\")\n\n        try:\n            client = self._get_client()\n\n            # Cheap connectivity check.\n            client.query(\n                \"SELECT 1\",\n                job_config=self._build_query_job_config(),\n                location=self.location or None,\n            ).result()\n\n            # Free cost/validity check of the actual base query.\n            dry_run_job = client.query(\n                self._wrap_query(self._build_base_query()),","sourceCodeStart":575,"sourceCodeEnd":611,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/bigquery_connector.py#L575-L611","documentation":"validate_connector_settings requires a non-empty project_id because every BigQuery job must be scoped to a project; without it neither the connectivity check nor the dry-run can be submitted.","triggerScenarios":"Config missing project_id (empty/None) while validating settings; common when relying on credentials alone and expecting the project to be auto-detected.","commonSituations":"Service-account JSON's project assumed to be used automatically; form field left blank; key named differently in the config dict.","solutions":["Set project_id explicitly in the connector config","If the project should come from the service account, wire that when building config: config['project_id'] = sa_info['project_id']","Confirm the config dict key is exactly project_id"],"exampleFix":"// before\nconfig = {\"dataset_id\": \"d\", \"table_id\": \"t\", ...}\n\n// after\nconfig = {\"project_id\": \"my-proj\", \"dataset_id\": \"d\", \"table_id\": \"t\", ...}","handlingStrategy":"validation","validationCode":"if not config.get(\"project_id\"):\n    config[\"project_id\"] = sa_info.get(\"project_id\") or os.environ.get(\"GCP_PROJECT\")\nassert config.get(\"project_id\"), \"project_id required for BigQuery connector\"","typeGuard":null,"tryCatchPattern":"try:\n    conn.validate_connector_settings()\nexcept ConnectorValidationError as e:\n    if \"project_id is required\" in str(e):\n        config[\"project_id\"] = sa_info[\"project_id\"]; revalidate()\n    else:\n        raise","preventionTips":["Default project_id from the service-account JSON at config-build time","Include project_id in required-field validation of the config form"],"tags":["bigquery","configuration","validation"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}