08-19-2024 02:32 PM
Hi Community,
Has anyone encountered the error below, and If yes, how did you solve it? My workspace is setup normally in UC. My workspace also has private endpoint setup. I am authentication over the browser when I run my R code, then right after the error is thrown
Error in dbConnect(drv, url = jdbc_url) :
Unable to connect JDBC to jdbc:databricks://adb-xxxxxx.xx.xxxxx.net:443;httpPath=/sql/1.0/warehouses/xxxxxxxxxx;AuthMech=11;Auth_Flow=2;EnableTokenCache=0;EnableArrow=0;
JDBC ERROR: [Databricks][JDBCDriver](500151) Error setting/closing session: Invalid local Address .
I'm getting this while using the R code below
library(RJDBC)
library(DBI)
setwd("/home")
# Set up JDBC connection parameters
jdbc_url <- "jdbc:databricks://adb-xxxxxx.2.xxxxx.net:443;httpPath=/sql/1.0/warehouses/xxxxxxx;AuthMech=11;Auth_Flow=2;EnableTokenCache=0;EnableArrow=0"
jdbc_driver <- "com.databricks.jdbc.Driver"
# Load the JDBC driver
drv <- RJDBC::JDBC(driverClass = "com.databricks.client.jdbc.Driver",
classPath = "DatabricksJDBC42.jar")
# Establish the connection
conn <- dbConnect(drv, url = jdbc_url)
# Query table
result <- dbGetQuery(conn, "select count(*) from catalog.schema.table")
print(result)
08-21-2024 06:42 AM
Hi
You can use the below connection string for the JDBC driver. Make sure to NOT change the OAuth2ClientId
jdbc:databricks://<workspace url>:443/default;transportMode=http;ssl=1;httpPath=<sql path>;AuthMech=11;OAuth2ClientId=96eecda7-19ea-49cc-abb5-240097d554f5;Auth_Flow=2;EnableTokenCache=0;
Hope this helps.
Regards,
Mehdi
08-21-2024 12:28 AM
I am facing similar issue when connecting via DBeaver Client (JDBC driver version 2.6.40)
"[Databricks][JDBCDriver](500151) Error setting/closing session: Invalid local Address .
Invalid local Address"
08-21-2024 06:42 AM
Hi
You can use the below connection string for the JDBC driver. Make sure to NOT change the OAuth2ClientId
jdbc:databricks://<workspace url>:443/default;transportMode=http;ssl=1;httpPath=<sql path>;AuthMech=11;OAuth2ClientId=96eecda7-19ea-49cc-abb5-240097d554f5;Auth_Flow=2;EnableTokenCache=0;
Hope this helps.
Regards,
Mehdi
08-22-2024 12:44 AM
Hi. when I try this I get this new error message after successful browser OAuth authentification.
[Databricks][JDBCDriver](500593) Communication link failure. Failed to connect to server. Reason: HTTP Response code: 403, Error message: PERMISSION_DENIED: You do not have permission to autostart 0812-090825-9uy7yt4i.
08-25-2024 06:00 PM
This error indicates that the warehouse is not running, and your user may not have the privilege to start it. Try starting the SQL Warehouse from the UI.
08-26-2024 09:15 AM
Thanks everyone for the replies. It turned out that this is a known bug and they are working on a fix
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.
If there isn’t a group near you, start one and help create a community that brings people together.
Request a New Group