{"record":{"id":"577744ab53219fd4","repo":"infiniflow/ragflow","slug":"bigquery-client-not-installed-please-install-goog","errorCode":null,"errorMessage":"BigQuery client not installed. Please install google-cloud-bigquery.","messagePattern":"BigQuery client not installed\\. Please install google-cloud-bigquery\\.","errorType":"validation","errorClass":"ConnectorValidationError","httpStatus":null,"severity":"error","filePath":"common/data_source/bigquery_connector.py","lineNumber":174,"sourceCode":"            try:\n                service_account_info = json.loads(raw)\n            except json.JSONDecodeError as exc:\n                raise ConnectorMissingCredentialError(f\"BigQuery: service_account_json is not valid JSON: {exc}\")\n        elif isinstance(raw, dict):\n            service_account_info = raw\n        else:\n            raise ConnectorMissingCredentialError(\"BigQuery: service_account_json must be a JSON string or object\")\n\n        self._credentials = {\"service_account_info\": service_account_info}\n        return None\n\n    def _get_client(self):\n        \"\"\"Create and cache a BigQuery client from the loaded service account.\"\"\"\n        if self._client is not None:\n            return self._client\n\n        if bigquery is None or service_account is None:\n            raise ConnectorValidationError(\"BigQuery client not installed. Please install google-cloud-bigquery.\")\n\n        service_account_info = self._credentials.get(\"service_account_info\")\n        if not service_account_info:\n            raise ConnectorMissingCredentialError(\"BigQuery credentials not loaded.\")\n\n        try:\n            creds = service_account.Credentials.from_service_account_info(service_account_info)\n        except Exception as exc:\n            raise ConnectorValidationError(f\"Failed to build BigQuery credentials: {exc}\")\n\n        try:\n            self._client = bigquery.Client(\n                project=self.project_id or None,\n                credentials=creds,\n                location=self.location or None,\n            )\n        except Exception as exc:\n            raise ConnectorValidationError(f\"Failed to create BigQuery client: {exc}\")","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/bigquery_connector.py#L156-L192","documentation":"Raised by _get_client when the optional google-cloud-bigquery / google-auth imports failed at module load (the module sets bigquery/service_account to None on ImportError). It is a ConnectorValidationError, not a credential error: the runtime environment lacks the client library, so no credential or network fix will help.","triggerScenarios":"Deploying the connector in an image/venv where 'google-cloud-bigquery' (or its google-auth dependency) is not installed or failed to import; the first _get_client call (during validate or first query) then hits this branch.","commonSituations":"Slim production images that omit optional connector deps, dependency-resolution conflicts breaking google-auth transitive imports, or running from a different virtualenv than the one where the package was installed.","solutions":["pip install google-cloud-bigquery in the environment that runs the connector","Verify with: python -c 'from google.cloud import bigquery; from google.oauth2 import service_account'","If using docker, rebuild the image so the dependency layer is present in the deployed image, not just the build stage","Pin compatible versions if google-auth conflicts with other libraries (check pip check)"],"exampleFix":"# before: ImportError swallowed at module import, then\nconnector._get_client()  # -> ConnectorValidationError\n\n# after\npip install google-cloud-bigquery\npython -c \"from google.cloud import bigquery; from google.oauth2 import service_account; print('ok')\"\nconnector._get_client()","handlingStrategy":"validation","validationCode":"def require_bigquery_deps():\n    try:\n        from google.cloud import bigquery  # noqa: F401\n        from google.oauth2 import service_account  # noqa: F401\n    except ImportError as e:\n        raise RuntimeError(\n            \"google-cloud-bigquery is required for the BigQuery connector; \"\n            \"install it in the runtime environment\"\n        ) from e","typeGuard":"def bigquery_available() -> bool:\n    try:\n        from google.cloud import bigquery  # noqa: F401\n        from google.oauth2 import service_account  # noqa: F401\n        return True\n    except ImportError:\n        return False","tryCatchPattern":"try:\n    connector.validate_connector_settings()\nexcept ConnectorValidationError as e:\n    if \"not installed\" in str(e):\n        raise DeploymentError(\"install google-cloud-bigquery in the runtime image\") from e\n    raise","preventionTips":["Declare optional connector dependencies as extra requirements in the deployment image","Run a dependency preflight (import check) at service startup, before scheduling connector jobs","Pin google-cloud-bigquery/google-auth versions and run pip check in CI"],"tags":["bigquery","gcp","dependencies","environment","installation"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}