BigQuery Metabase connection issue

Log:

[f58ab912-9f1c-47c1-bb05-1f2e6c5af6b0] 2022-10-12T13:22:47-04:00 DEBUG metabase.server.middleware.log GET /api/database 200 2.0 ms (3 DB calls) App DB connections: 0/7 Jetty threads: 6/50 (1 idle, 0 queued) (40 total active threads) Queries in flight: 0 (0 queued)
[f58ab912-9f1c-47c1-bb05-1f2e6c5af6b0] 2022-10-12T13:34:25-04:00 ERROR metabase.driver.bigquery-cloud-sdk Exception caught in :bigquery-cloud-sdk can-connect?
com.google.cloud.bigquery.BigQueryException: Read timed out
	at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.translate(HttpBigQueryRpc.java:115)
	at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.listDatasets(HttpBigQueryRpc.java:156)
	at com.google.cloud.bigquery.BigQueryImpl$7.call(BigQueryImpl.java:456)
	at com.google.cloud.bigquery.BigQueryImpl$7.call(BigQueryImpl.java:452)
	at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:105)
	at com.google.cloud.RetryHelper.run(RetryHelper.java:76)
	at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:50)
	at com.google.cloud.bigquery.BigQueryImpl.listDatasets(BigQueryImpl.java:450)
	at com.google.cloud.bigquery.BigQueryImpl.listDatasets(BigQueryImpl.java:441)
	at metabase.driver.bigquery_cloud_sdk$list_tables.invokeStatic(bigquery_cloud_sdk.clj:67)
	at metabase.driver.bigquery_cloud_sdk$list_tables.invoke(bigquery_cloud_sdk.clj:56)
	at metabase.driver.bigquery_cloud_sdk$list_tables.invokeStatic(bigquery_cloud_sdk.clj:61)
	at metabase.driver.bigquery_cloud_sdk$list_tables.invoke(bigquery_cloud_sdk.clj:56)
	at metabase.driver.bigquery_cloud_sdk$fn__82388.invokeStatic(bigquery_cloud_sdk.clj:96)
	at metabase.driver.bigquery_cloud_sdk$fn__82388.invoke(bigquery_cloud_sdk.clj:93)
	at clojure.lang.MultiFn.invoke(MultiFn.java:234)
	at metabase.driver.util$can_connect_with_details_QMARK_$fn__33141.invoke(util.clj:138)
	at clojure.core$binding_conveyor_fn$fn__5823.invoke(core.clj:2047)
	at clojure.lang.AFn.call(AFn.java:18)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.net.SocketTimeoutException: Read timed out
	at java.base/java.net.SocketInputStream.socketRead0(Native Method)
	at java.base/java.net.SocketInputStream.socketRead(Unknown Source)
	at java.base/java.net.SocketInputStream.read(Unknown Source)
	at java.base/java.net.SocketInputStream.read(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketInputRecord.read(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(Unknown Source)
	at java.base/java.io.BufferedInputStream.fill(Unknown Source)
	at java.base/java.io.BufferedInputStream.read1(Unknown Source)
	at java.base/java.io.BufferedInputStream.read(Unknown Source)
	at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
	at java.base/sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
	at java.base/java.net.HttpURLConnection.getResponseCode(Unknown Source)
	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
	at com.google.api.client.http.javanet.NetHttpResponse.<init>(NetHttpResponse.java:36)
	at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:152)
	at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:84)
	at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1012)
	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:514)
	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:455)
	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:565)
	at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.listDatasets(HttpBigQueryRpc.java:148)
	... 21 more
[f58ab912-9f1c-47c1-bb05-1f2e6c5af6b0] 2022-10-12T13:34:25-04:00 DEBUG metabase.server.middleware.log POST /api/database 400 1.3 mins (1 DB calls) 
{:message "Unable to connect to database."}

Hi @god830
Post "Diagnostic Info" from Admin > Troubleshooting.

{
  "browser-info": {
    "language": "en-US",
    "platform": "Linux x86_64",
    "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.16.1+1",
    "java.vendor": "Eclipse Adoptium",
    "java.vendor.url": "https://adoptium.net/",
    "java.version": "11.0.16.1",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.16.1+1",
    "os.name": "Linux",
    "os.version": "5.15.0-50-generic",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "h2",
      "bigquery-cloud-sdk"
    ],
    "hosting-env": "unknown",
    "application-database": "h2",
    "application-database-details": {
      "database": {
        "name": "H2",
        "version": "1.4.197 (2018-03-18)"
      },
      "jdbc-driver": {
        "name": "H2 JDBC Driver",
        "version": "1.4.197 (2018-03-18)"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2022-09-29",
      "tag": "v0.44.4",
      "branch": "release-x.44.x",
      "hash": "382d728"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

@god830 You should migrate away from H2:
https://www.metabase.com/docs/latest/installation-and-operation/migrating-from-h2

Make sure that you don't have any network issues - connection problems, firewalls blocking, DNS issues.

Question, since other accounts on the same platform don't have this problem, is this still an H2 problem?

@god830 It has nothing to do with H2, but you should not use H2 if you are running in production.

If other accounts are working, then it could be caused by rate limiting or firewall on BigQuery, or perhaps you have so many datasets that it causes a timeout, so try limiting to a single dataset.
Check your BigQuery logs for any information that could help understand what is causing the problem.

Thanks, I did change the timeout to a larger number. I will investigate more.