SAP Knowledge Base Article - Public

3831602 - Error "Unable to connect to your Datasource..." when configuring Snowflake import connection with Key Pair Authentication in SAP Analytics Cloud

Symptom

  • Error “Unable to connect to your Datasource. Check the connection details and user credentials, and then try again” appears when creating or editing a Snowflake Import Connection with SQL Databases, using Key Pair Authentication, in SAP Analytics Cloud.
  • The following error could be found in Catalina logs:

"net.snowflake.client.core.SessionUtilKeyPair.extractPrivateKeyFromBytes Could not extract private key using Bouncy Castle provider
    net.snowflake.client.jdbc.internal.org.bouncycastle.pkcs.PKCSException: unable to read encrypted data: <> not available: Cannot find any provider supporting AES/CBC/PKCS7Padding"

Environment

  • SAP Analytics Cloud.
  • Snowflake.

Reproducing the Issue

  1. Log in to SAP Analytics Cloud.
  2. Go to Connections and create or edit an Import Connection to Snowflake via SQL Databases.
  3. Save the connection.

>>Notice the following error occurring “Unable to connect to your Datasource. Check the connection details and user credentials, and then try again”.

Cause

The Java runtime was Java 8, which is not supported for Snowflake Import Connections using key pair authentication. The Snowflake JDBC driver requires Java 11+.

Resolution

  1. Upgrade the Java runtime used by the SAC Cloud Agent/Tomcat to SapMachine 21, which could be downloaded from Download SapMachine | SapMachine. 
  2. Add the following Java options in Java command line settings to ensure compatibility:

-Dnet.snowflake.jdbc.enableBouncyCastle=true

--add-opens=java.base/java.nio=ALL-UNNAMED

See Also

Keywords

SAC, Snowflake, import connection, key pair authentication , KBA , LOD-ANA-AQU , Import Data Connections (Acquiring Data) , Problem

Product

SAP Analytics Cloud 1.0