Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

BigQuery: schema browser is empty when the service account lacks access to some datasets in the project #7760

Copy link
Copy link

Description

@Umekawa
Issue body actions

Issue Summary

On a BigQuery data source, the schema browser becomes completely empty (no tables, no columns, no autocomplete) when the service account cannot access every dataset in the project. This happens even for the datasets the account can read.

The root cause is in get_schema() (redash/query_runner/big_query.py):

  • It lists all datasets in the project via datasets().list().
  • It builds a single UNION ALL query over each dataset's INFORMATION_SCHEMA.COLUMN_FIELD_PATHS (and a second one over INFORMATION_SCHEMA.TABLE_OPTIONS).
  • If any one dataset returns an error, _handle_run_query_error() raises and the whole refresh aborts. Nothing is cached.

So a single inaccessible dataset wipes out the schema for the entire data source.

This is common with dataset-level IAM (per-team isolation): the service account is granted only a subset of datasets, plus roles/bigquery.jobUser. Querying the datasets it cannot read returns:

403 PERMISSION_DENIED
Access Denied: Table PROJECT:DATASET.INFORMATION_SCHEMA.TABLE_OPTIONS:
User does not have permission to query table
PROJECT:DATASET.INFORMATION_SCHEMA.TABLE_OPTIONS, or perhaps it does not exist.

Why existing mechanisms do not help:

Steps to Reproduce

  1. Use a BigQuery project with multiple datasets, all in the same location (e.g. asia-northeast1).
  2. Grant a service account read access to only some of those datasets, plus roles/bigquery.jobUser.
  3. Configure a Redash BigQuery data source with that account and "Load Schema" enabled.
  4. Trigger a schema refresh (periodic refresh_schemas, or open the query editor).
  • Expected: the schema browser shows the tables of the accessible datasets.
  • Actual: the schema browser is empty. The refresh_schema job fails with a 403 PERMISSION_DENIED on INFORMATION_SCHEMA.TABLE_OPTIONS / COLUMN_FIELD_PATHS of an inaccessible dataset.

Note: query execution is unaffected. Only schema loading and autocomplete break.

Possible fix

Make get_schema() tolerant of per-dataset failures:

Technical details:

  • Redash Version: 26.3.0 (official redash/redash:26.3.0 image)
  • Browser/OS: N/A (server-side schema refresh; reproduced via RQ worker logs)
  • How did you install Redash: Docker (official image)
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.