cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

JDBC Driver cannot connect when using TokenCachePassPhrase property

adrianojsoares1
New Contributor

Hello all, I'm looking for suggestions on enabling the token cache when using browser based SSO login. I'm following the instructions found here: Databricks-JDBC-Driver-Install-and-Configuration-Guide 

For my users, I would like to enable the token cache as it provides a more seamless experience. The driver documentation suggests setting the TokenCachePassPhrase property, but does not elaborate on where I can obtain such a value. So, I created my JDBC connection string like this.

jdbc:databricks://my.prefix.databricks.com:443/default;transportMode=http;ssl=1;AuthMech=11;Auth_Flow=2;
httpPath=/sql/1.0/warehouses/<WAREHOUSE_ID>;UseProxy=1;ProxyHost=<PROXY_HOST>;ProxyPort=<PROXY_PORT>;
TokenCachePassPhrase=cache;PWD=cache;EnableTokenCache=1;

However, the driver returns this following exception. When the EnableTokenCache is set to 0, it connects successfully.

[Databricks][JDBCDriver](500151) Error setting/closing session: Cannot invoke "java.nio.file.attribute.AclFileAttributeView.setAcl(java.util.List)" because "<local6>" is null .
Cannot invoke "java.nio.file.attribute.AclFileAttributeView.setAcl(java.util.List)" because "<local6>" is null

So, can anyone elaborate on what this TokenCachePassPhrase property should be set to? Is it an arbitrary value or a secret known to an administrator? Thank you.

2 REPLIES 2

NandiniN
Databricks Employee
Databricks Employee

The TokenCachePassPhrase property is meant to secure tokens when using the token cache feature of the Databricks JDBC driver. This passphrase serves as an encryption key for storing the tokens securely in the cache.

 

General Guidelines for Setting TokenCachePassPhrase:

  1. This property should be set to a passphrase that you and your organization control, similar to a password. 
  2. Ensure that the same passphrase is consistently used for all connections that leverage the token cache.
  3. Ideally, pick a strong passphrase and do not expose it unnecessarily.

 

 

NandiniN
Databricks Employee
Databricks Employee

For the error encountered (Cannot invoke "java.nio.file.attribute.AclFileAttributeView.setAcl(...)" because "<local6>" is null)  might be permission or file system issues where the token cache store is being accessed. 

When EnableTokenCache=0, the token cache is disabled, which explains why the connection succeeds without issues.

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now