{"record":{"id":"0fa317991b789ea5","repo":"apache/iceberg","slug":"creating-bigquery-client-failed","errorCode":null,"errorMessage":"Creating BigQuery client failed","messagePattern":"Creating BigQuery client failed","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreCatalog.java","lineNumber":90,"sourceCode":"  private CloseableGroup closeableGroup;\n\n  public BigQueryMetastoreCatalog() {}\n\n  @Override\n  public void initialize(String name, Map<String, String> properties) {\n\n    BigQueryProperties bigQueryProperties = new BigQueryProperties(properties);\n\n    this.projectId = bigQueryProperties.projectId();\n    this.projectLocation = bigQueryProperties.location();\n    this.listAllTables = bigQueryProperties.listAllTables();\n\n    BigQueryOptions bigQueryOptions = bigQueryProperties.metastoreOptions();\n\n    try {\n      client = new BigQueryMetastoreClientImpl(bigQueryOptions);\n    } catch (IOException e) {\n      throw new UncheckedIOException(\"Creating BigQuery client failed\", e);\n    } catch (GeneralSecurityException e) {\n      throw new RuntimeException(\"Creating BigQuery client failed due to a security issue\", e);\n    }\n\n    initialize(name, properties, projectId, projectLocation, client);\n  }\n\n  @VisibleForTesting\n  void initialize(\n      String name,\n      Map<String, String> properties,\n      String initialProjectId,\n      String initialLocation,\n      BigQueryMetastoreClient bigQueryMetaStoreClient) {\n    Preconditions.checkArgument(bigQueryMetaStoreClient != null, \"Invalid BigQuery client: null\");\n    this.catalogName = name;\n    this.catalogProperties = ImmutableMap.copyOf(properties);\n    this.projectId = initialProjectId;","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreCatalog.java#L72-L108","documentation":"BigQueryMetastoreCatalog.initialize() constructs the BigQuery metastore client from BigQueryOptions; an IOException during client creation is wrapped into this UncheckedIOException. It means the catalog could not establish the BigQuery client at all.","triggerScenarios":"new BigQueryMetastoreClientImpl(bigQueryOptions) throws IOException — bad project id, malformed options, credential file problems surfacing as IOException, or transport initialization failure.","commonSituations":"Wrong or missing project configuration in BigQueryProperties; invalid service account key file path; network egress blocked to bigquery.googleapis.com; malformed catalog properties generating bad BigQueryOptions.","solutions":["Inspect the wrapped IOException cause for the root failure.","Verify BigQuery catalog properties (project id, endpoint, credentials path) are correct and the key file exists/readable.","Confirm network access to the BigQuery API endpoint from the runtime environment.","Validate that the service account credentials can be loaded (GOOGLE_APPLICATION_CREDENTIALS or configured key file)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-check config\nPreconditions.checkArgument(projectId != null && !projectId.isEmpty(), \"project-id is required\");\njava.io.File keyFile = credentialsPath != null ? new java.io.File(credentialsPath) : null;\nif (keyFile != null) Preconditions.checkArgument(keyFile.exists(), \"credential file missing: \" + credentialsPath);","typeGuard":null,"tryCatchPattern":"try { catalog.initialize(name, props); } catch (UncheckedIOException e) { log.error(\"BigQuery client creation failed: {}\", e.getCause()); throw e; }","preventionTips":["Validate BigQuery catalog properties (project id, credentials path) before initializing.","Check the service account key file exists and is readable at startup.","Verify network reachability of bigquery.googleapis.com from the runtime environment."],"tags":["gcp","bigquery","client-init","io"],"backgroundTag":"module-init-failed","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}