{"record":{"id":"61346ff2848f6f65","repo":"infiniflow/ragflow","slug":"bigquery-validation-failed-exc","errorCode":null,"errorMessage":"BigQuery validation failed: {exc}","messagePattern":"BigQuery validation failed: (.+?)","errorType":"validation","errorClass":"ConnectorValidationError","httpStatus":null,"severity":"error","filePath":"common/data_source/bigquery_connector.py","lineNumber":638,"sourceCode":"            schema_columns = {field.name for field in schema}\n\n            required = set(self.content_columns)\n            optional = set(self.metadata_columns)\n            if self.id_column:\n                optional.add(self.id_column)\n            if self.timestamp_column:\n                optional.add(self.timestamp_column)\n\n            missing = (required | optional) - schema_columns\n            if missing:\n                raise ConnectorValidationError(f\"BigQuery configured columns not found in schema: {', '.join(sorted(missing))}\")\n\n            if self.timestamp_column:\n                self._resolve_cursor_param_type()\n        except (ConnectorValidationError, ConnectorMissingCredentialError):\n            raise\n        except Exception as exc:\n            raise ConnectorValidationError(f\"BigQuery validation failed: {exc}\")\n","sourceCodeStart":620,"sourceCodeEnd":639,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/bigquery_connector.py#L620-L639","documentation":"Catch-all in validate_connector_settings: any exception that is not already a ConnectorValidationError/ConnectorMissingCredentialError (e.g. auth failures, permission errors, network errors, invalid SQL from the dry-run) is re-raised wrapped as ConnectorValidationError with the original message.","triggerScenarios":"google.auth exceptions from bad service-account JSON, 403 Access Denied on the project/dataset, DNS/connectivity failures, or a custom query with syntax errors that surface at dry-run time.","commonSituations":"Expired or wrong-scoped service account; user lacks bigquery.jobs.create; malformed SQL in config['query']; egress-blocked environments.","solutions":["Read the embedded {exc} text — it carries the root cause (auth vs permission vs SQL vs network)","Fix the underlying issue: valid credentials with BigQuery roles, runnable query, network access to bigquery.googleapis.com","Re-run validate_connector_settings() after each fix"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# Smoke-test prerequisites before validate: auth, network, query\nfrom google.auth import default as gdefault  # or service_account\ntry:\n    import socket; socket.create_connection((\"bigquery.googleapis.com\", 443), timeout=5)\nexcept OSError:\n    raise RuntimeError(\"no network path to BigQuery\")","typeGuard":null,"tryCatchPattern":"try:\n    conn.validate_connector_settings()\nexcept ConnectorValidationError as e:\n    root = str(e).removeprefix(\"BigQuery validation failed: \")\n    log_and_alert(root)  # root carries the original auth/permission/SQL error\n    if \"403\" in root: fix_iam_roles()\n    elif \"Syntax error\" in root: fix_query()\n    else: raise","preventionTips":["Treat the wrapped message as the source of truth; never string-match the generic prefix","Run a SELECT 1 dry-run in CI against the connector's service account","Grant the service account roles/bigquery.jobUser plus dataViewer on the dataset"],"tags":["bigquery","wrapped-error","authentication","network"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}