{"record":{"id":"e22a4b2845b9f302","repo":"apache/beam","slug":"failed-to-get-table-with","errorCode":null,"errorMessage":"Failed to get table {} with {}","messagePattern":"Failed to get table (.+?) with (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/UpdateSchemaDestination.java","lineNumber":272,"sourceCode":"              .collect(Collectors.toList());\n      loadConfig.setSchemaUpdateOptions(options);\n    }\n    if (!loadConfig\n            .getWriteDisposition()\n            .equals(BigQueryIO.Write.WriteDisposition.WRITE_TRUNCATE.toString())\n        && !loadConfig\n            .getWriteDisposition()\n            .equals(BigQueryIO.Write.WriteDisposition.WRITE_APPEND.toString())) {\n      return null;\n    }\n    final Table destinationTable;\n    try {\n      destinationTable = datasetService.getTable(tableReference);\n      if (destinationTable == null) {\n        return null; // no need to update schema ahead if table does not exist\n      }\n    } catch (IOException | InterruptedException e) {\n      LOG.warn(\"Failed to get table {} with {}\", tableReference, e.toString());\n      throw new RuntimeException(e);\n    }\n    // no need to update schema ahead if provided schema already matches destination schema\n    // or when destination schema is null (the write will set the schema)\n    // or when provided schema is null (e.g. when using CREATE_NEVER disposition)\n    TableSchema destinationSchema = destinationTable.getSchema();\n    if (destinationSchema == null\n        || destinationSchema.isEmpty()\n        || schema == null\n        || destinationSchema.equals(schema)) {\n      return null;\n    }\n    loadConfig.setSchema(schema);\n    if (timePartitioning != null) {\n      loadConfig.setTimePartitioning(timePartitioning);\n    }\n\n    if (clustering != null) {","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/UpdateSchemaDestination.java#L254-L290","documentation":"UpdateSchemaDestination.startZeroLoadJob fetches the destination table via BigQueryServices.DatasetService.getTable(); if this call throws IOException or InterruptedException, the code logs this warning and rethrows as RuntimeException, failing the update-schema-ahead-of-write step. InterruptedException triggers are re-interrupted implicitly by rethrow (caller should check), and IOException generally means an API/network failure or missing table permission.","triggerScenarios":"datasetService.getTable(tableReference) throws — network failure calling BigQuery API, quota/timeout, permission denied, or the thread interrupted during the blocking call.","commonSituations":"Service account lacking bigquery.tables.get; transient Google API errors during heavy pipelines; VPC without access to bigquery.googleapis.com; worker interruption during teardown.","solutions":["Read e.toString() in the log: if 403, grant the service account bigquery.tables.get (Data Viewer/Editor).","If IOException/timeouts, check network egress to bigquery.googleapis.com and BigQuery quotas.","Retry the pipeline; transient API errors are usually resolved on rerun.","If InterruptedException, check for pipeline cancellation racing with schema update and drain gracefully."],"exampleFix":"// before: table not visible due to missing grant\n// 'Failed to get table myproj:ds.tbl with ... 403'\n// after: grant IAM to the runner service account\ngsutil // gcloud projects add-iam-policy-binding proj --member=serviceAccount:sa@proj.iam.gserviceaccount.com --role=roles/bigquery.dataEditor","handlingStrategy":"validation","validationCode":"// pre-check table visibility with the same credentials\nbq.getTable(projectId, datasetId, tableId); // null => it won't exist downstream either\n// check access: bq.getDataset(ds).get(tableId)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Grant the runner service account bigquery.tables.get via roles/bigquery.dataViewer/Editor.","Verify network egress to bigquery.googleapis.com from workers.","Don't cancel pipelines during the schema-update phase."],"tags":["bigquery","api","network","permissions"],"backgroundTag":"api-error-response","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}