Snowflake connection error: JWT token is invalid

Hi all,

Trying to setup a connection to Snowflake. The account is setup using key pair authentication, and I am trying to pass the private key file name and password in the "Additional JDBC connection string options" section as per

However I am getting the below error from Metabase:

2021-10-05 16:52:20,241 ERROR driver.util :: Database connection error
net.snowflake.client.jdbc.SnowflakeSQLException: JWT token is invalid.

The key pair authentication does work via both SnowSQL & a JDBC connection outside of Metabase.

Any thoughts appreciated!

What version of Metabase, and what deployment are you using? If jar file, then what JDK version? Also, please include the full connection string you have specified in Metabase, and also the equivalent from your standalone JDBC application (with sensitive info redacted).

Diagnostic info below which should answer some of your points:

  "browser-info": {
    "language": "en-GB",
    "platform": "Win32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36 Edg/94.0.992.31",
    "vendor": "Google Inc."
  "system-info": {
    "file.encoding": "UTF-8",
    "": "OpenJDK Runtime Environment",
    "java.runtime.version": "1.8.0_232-8u232-b09-0ubuntu1~16.04.1-b09",
    "java.vendor": "Private Build",
    "java.vendor.url": "",
    "java.version": "1.8.0_232",
    "": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "25.232-b09",
    "": "Linux",
    "os.version": "4.15.0-54-generic",
    "user.language": "en",
    "user.timezone": "Europe/London"
  "metabase-info": {
    "databases": [
    "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": {
      "tag": "v0.40.5",
      "date": "2021-09-21",
      "branch": "release-x.40.x",
      "hash": "042a36e"
    "settings": {
      "report-timezone": null

What's the best way to show you the string from Metabase? Ultimately it's just filling out the required fields in metabase (including password, which I know is not needed with key auth - could this be causing an issue?), plus this bit in the "Additional JDBC connection string options":


I'm certain it results in the same as the standalone JDBC, which looks like this:


Bump :grinning:

@gribboa Try upgrading to latest Java 11:

I'm not sure if it would help, or if it requires Metabase to support a key-based authentication (something similar to what is possible with MongoDB, by exposing the full connection string).

1 Like