{"record":{"id":"d9ad43e82a74bec1","repo":"apache/beam","slug":"table-not-found","errorCode":null,"errorMessage":"Table not found","messagePattern":"Table not found","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryStorageTableSource.java","lineNumber":223,"sourceCode":"        checkState(\n            !Strings.isNullOrEmpty(options.getProject()),\n            \"No project ID set in %s or %s, cannot construct a complete %s\",\n            TableReference.class.getSimpleName(),\n            BigQueryOptions.class.getSimpleName(),\n            TableReference.class.getSimpleName());\n        LOG.info(\n            \"Project ID not set in {}. Using default project from {}.\",\n            TableReference.class.getSimpleName(),\n            BigQueryOptions.class.getSimpleName());\n        tableReference.setProjectId(\n            options.getBigQueryProject() == null\n                ? options.getProject()\n                : options.getBigQueryProject());\n      }\n      try (DatasetService datasetService = bqServices.getDatasetService(options)) {\n        Table table = datasetService.getTable(tableReference);\n        if (table == null) {\n          throw new IllegalArgumentException(\"Table not found\" + table);\n        }\n        cachedTable.compareAndSet(null, table);\n        return table;\n      }\n    }\n  }\n}\n","sourceCodeStart":205,"sourceCodeEnd":231,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryStorageTableSource.java#L205-L231","documentation":"BigQueryStorageTableSource.getTargetTable fetches table metadata via DatasetService.getTable to build the read session. If BigQuery returns null (the dataset or table doesn't exist, or isn't visible to the credentials), an IllegalArgumentException is thrown. Note the message concatenates the (null) table object, so it prints 'Table not foundnull' unless the table ref was intended.","triggerScenarios":"Querying the Storage Read API for a table whose projectId/dataset/tableId doesn't exist; wrong project configured (options.getBigQueryProject()); credentials lacking bigquery.tables.get / metadata visibility; stale cached table reference after a table was deleted between pipeline construction and execution.","commonSituations":"Typo in dataset or table name; running in a different GCP project than expected (BQ_PROJECT unset); using a dataset-view the service account can't see; table dropped by a retention policy before the pipeline runs.","solutions":["Verify the fully-qualified table (project:dataset.table) exists: run `bq show project:dataset.table` with the same credentials the pipeline uses","Check the configured project: set --project / --bigQueryProject / BQ_PROJECT explicitly to the project that contains the table","Grant the runner service account roles/bigquery.metadataViewer (or at least bigquery.tables.get) on the dataset","Recheck that the table was not deleted/renamed between building the pipeline and running it"],"exampleFix":"// before\noptions.setBigQueryProject(null); // falls back to possibly wrong project\n// after\npipelineOptions.setProject(\"my-data-project\");\nBigQueryOptions bq = pipelineOptions.as(BigQueryOptions.class);\nbq.setBigQueryProject(\"my-data-project\");\n// pre-check before running the pipeline:\nDatasetReference ds = DatasetReference.of(\"my-data-project\", \"my_dataset\");\n// ensure `bq show my-data-project:my_dataset.my_table` succeeds with these credentials","handlingStrategy":"validation","validationCode":"// Pre-flight with the same credentials the pipeline uses:\nBigQuery bq = BigQueryOptions.getDefaultInstance().getService();\nTable t = bq.getTable(\"project\", \"dataset\", \"table\");\nif (t == null) throw new IllegalArgumentException(\"Table project:dataset.table does not exist\");","typeGuard":"boolean tableExists(BigQuery bq, TableReference ref) {\n  return bq.getTable(ref) != null;\n}","tryCatchPattern":"try {\n  pipeline.run().waitUntilFinish();\n} catch (IllegalArgumentException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Table not found\")) {\n    throw new IllegalStateException(\"Check table name, project and IAM access: \" + e.getMessage(), e);\n  }\n  throw e;\n}","preventionTips":["Use fully-qualified project:dataset.table in BigQueryIO.from(...)","Set --project and --bigQueryProject explicitly in pipeline options","Grant roles/bigquery.metadataViewer to the runner service account","Add a pre-flight existence check before launching the pipeline"],"tags":["bigquery","storage-read-api","resource-not-found","gcp"],"backgroundTag":"resource-not-found","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}