infiniflow/ragflow · error · ConnectorValidationError
BigQuery project_id is required.
Error message
BigQuery project_id is required.
What it means
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.
Source
Thrown at common/data_source/bigquery_connector.py:593
return
from api.db.services.connector_service import ConnectorService
updated_conf = copy.deepcopy(self._sync_config)
updated_conf["sync_cursor_value"] = self.serialize_cursor_value(self._pending_sync_cursor_value)
updated_conf["sync_cursor_id"] = self._pending_sync_cursor_id
ConnectorService.update_by_id(self._sync_connector_id, {"config": updated_conf})
self._sync_config = updated_conf
# ------------------------------------------------------------------ #
# Validation
# ------------------------------------------------------------------ #
def validate_connector_settings(self) -> None:
"""Validate settings via SELECT 1 plus a dry-run of the configured base query."""
if not self._credentials:
raise ConnectorMissingCredentialError("BigQuery credentials not loaded.")
if not self.project_id:
raise ConnectorValidationError("BigQuery project_id is required.")
if not self.content_columns:
raise ConnectorValidationError("At least one content column must be specified.")
if not self.query and not (self.dataset_id and self.table_id):
raise ConnectorValidationError("BigQuery requires either a custom query or both dataset_id and table_id.")
try:
client = self._get_client()
# Cheap connectivity check.
client.query(
"SELECT 1",
job_config=self._build_query_job_config(),
location=self.location or None,
).result()
# Free cost/validity check of the actual base query.
dry_run_job = client.query(
self._wrap_query(self._build_base_query()),View on GitHub (pinned to 554fb1133a)
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
Example fix
// before
config = {"dataset_id": "d", "table_id": "t", ...}
// after
config = {"project_id": "my-proj", "dataset_id": "d", "table_id": "t", ...} Defensive patterns
Strategy: validation
Validate before calling
if not config.get("project_id"):
config["project_id"] = sa_info.get("project_id") or os.environ.get("GCP_PROJECT")
assert config.get("project_id"), "project_id required for BigQuery connector" Try / catch
try:
conn.validate_connector_settings()
except ConnectorValidationError as e:
if "project_id is required" in str(e):
config["project_id"] = sa_info["project_id"]; revalidate()
else:
raise Prevention
- Default project_id from the service-account JSON at config-build time
- Include project_id in required-field validation of the config form
When it happens
Trigger: Config missing project_id (empty/None) while validating settings; common when relying on credentials alone and expecting the project to be auto-detected.
Common situations: Service-account JSON's project assumed to be used automatically; form field left blank; key named differently in the config dict.
Related errors
- BigQuery requires either a custom query or both dataset_id a
- At least one content column must be specified.
- BigQuery configured columns not found in schema: {', '.join(
- main() must return a value. Use null for an empty result.
- main() returned a non-JSON-serializable value.
AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15).
Data as JSON: /api/errors/f52530d7173ba64f.
Report an issue: GitHub.