infiniflow/ragflow · error · ConnectorMissingCredentialError

BigQuery credentials not loaded.

Error message

BigQuery credentials not loaded.

What it means

Internal-consistency guard in _get_client: the cached self._credentials dict has no service_account_info entry, meaning load_credentials never ran (or ran with a shape that did not populate it). Distinct from error 533: here the load step was skipped entirely rather than given a missing key.

Source

Thrown at common/data_source/bigquery_connector.py:178

        elif isinstance(raw, dict):
            service_account_info = raw
        else:
            raise ConnectorMissingCredentialError("BigQuery: service_account_json must be a JSON string or object")

        self._credentials = {"service_account_info": service_account_info}
        return None

    def _get_client(self):
        """Create and cache a BigQuery client from the loaded service account."""
        if self._client is not None:
            return self._client

        if bigquery is None or service_account is None:
            raise ConnectorValidationError("BigQuery client not installed. Please install google-cloud-bigquery.")

        service_account_info = self._credentials.get("service_account_info")
        if not service_account_info:
            raise ConnectorMissingCredentialError("BigQuery credentials not loaded.")

        try:
            creds = service_account.Credentials.from_service_account_info(service_account_info)
        except Exception as exc:
            raise ConnectorValidationError(f"Failed to build BigQuery credentials: {exc}")

        try:
            self._client = bigquery.Client(
                project=self.project_id or None,
                credentials=creds,
                location=self.location or None,
            )
        except Exception as exc:
            raise ConnectorValidationError(f"Failed to create BigQuery client: {exc}")

        return self._client

    # ------------------------------------------------------------------ #

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Call load_credentials(credentials) before any operation that builds a client
  2. Verify load_credentials did not raise earlier and leave the object half-initialized
  3. In orchestration code, treat connector construction + load_credentials as one atomic setup step

Example fix

# before
connector = BigQueryConnector(...)
connector.validate_connector_settings()  # triggers _get_client

# after
connector = BigQueryConnector(...)
connector.load_credentials(creds)
connector.validate_connector_settings()
Defensive patterns

Strategy: validation

Validate before calling

def build_bigquery_connector(creds: dict):
    connector = BigQueryConnector(project_id=..., location=...)
    connector.load_credentials(creds)   # must precede any client use
    return connector

Try / catch

try:
    connector._get_client()
except ConnectorMissingCredentialError as e:
    if "credentials not loaded" in str(e):
        connector.load_credentials(creds)
        return connector._get_client()
    raise

Prevention

When it happens

Trigger: Calling _get_client (directly or via validate_connector_settings / query execution) on a connector instance where load_credentials was never invoked — _credentials stays empty ({}), so .get('service_account_info') returns None and this raises ConnectorMissingCredentialError.

Common situations: Orchestration that constructs the connector and jumps straight to validation/queries, or a partial re-initialization path that resets _credentials without re-loading them.

Related errors


AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15). Data as JSON: /api/errors/9e720871e3bdd590. Report an issue: GitHub.