BigQuery billing export "table not found: project.dataset.gcp_billing_export" - fixing the export
Fixes BigQuery billing-export queries that fail because the export table name or dataset is wrong. Use it when a cost agent's scheduled query errors on the billing export table while the export looks enabled. Key trigger: the real table name carries a billing-account-ID suffix the query is missing.
TL;DR
Point the query at the real table name, which ends with your billing account ID, for example gcpbillingexportv1[BILLINGACCOUNTID]. List the dataset's tables with bq ls to see the exact name, then fix the query. Export table names are fixed by Google and always carry that suffix, so a hand-written name without it never matches.
The error
table not found: project.dataset.gcp_billing_exportFix it
Confirm the export is actually enabled: open Billing, then Billing export, and check the dataset name and location shown there. Expected: either a dataset is listed (export on) or the page says export is not enabled.
If it is enabled, list what is really in the dataset:
bq ls [PROJECT_ID]:[DATASET]Expected: tables like gcpbillingexportv1[BILLINGACCOUNTID] or gcpbillingexportresourcev1[BILLINGACCOUNT_ID].Rewrite the query to use the exact table name from step 2, including the billing account ID suffix. Expected: the query parses and the table resolves.
Re-run the query. Expected: rows return; if the table exists but is empty, the export was only just enabled and there is no backfill.
Use this when
- A scheduled billing-export job starts failing with a table-not-found error
- Someone hand-wrote the export table name instead of copying it from the dataset
- The export dataset was recreated or moved and old queries still point at the old path
Not for this skill when
- Billing export was never enabled (enable it first; this skill fixes the query, not the missing export)
- The error is a quota error on the query job (that is a quota problem, different fix)
- The query fails on permissions (the caller needs BigQuery Data Viewer on the dataset)
Variant phrasings
- BigQuery billing export table does not exist
- Not found table gcpbillingexport_v1
- billing export dataset is empty after enabling
- where is the GCP billing export table name
Why it happens
Google names export tables itself and appends the billing account ID, so the name is never just gcpbillingexport. Queries copied between accounts break because the suffix changes per account. Separately, the export only starts writing from the moment it is enabled, so a fresh export legitimately has no historical tables.
Edge cases
- Standard usage export, resource-based export, and price export each write to differently named tables; make sure the query targets the right one
- The dataset location matters: a query running in the wrong region cannot see a regional dataset
- Export data lands with a delay (often several hours), so very recent days can look missing
- Deleting the dataset does not disable the export; re-enable it cleanly or exports fail silently
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_qmrL2eevYH5EXtY2O9eYwA