Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request failed while connecting to Azure Databricks using usql #230

Open
calebeaires opened this issue Jun 5, 2024 · 8 comments
Open

Request failed while connecting to Azure Databricks using usql #230

calebeaires opened this issue Jun 5, 2024 · 8 comments

Comments

@calebeaires
Copy link

I am facing an issue when trying to connect to Databricks using usql. Even when using the correct credentials, typing the command:

usql databricks://token:dapi*****@adb-*************.azuredatabricks.net:443/sql/protocolv1/o/*********/*******

The credentials and URL details have been omitted for security, but I assure you that the data is correct.

Error Logs:

CleanShot 2024-06-05 at 10 28 57@2x

What You Have Tried

  • Verified credentials and URLs.
  • Reinstalled usql.
  • Tried on different terminals and operating systems (MacOS and Linux).

Where it works

Using DBeaver and the same credentials, the connection works like a charm

Any help to resolve this issue would be highly appreciated.

Alternative question:

It seems to me that the driver redirects the Azure URL to the Databricks URL.

@kravets-levko
Copy link
Collaborator

Hi @calebeaires! It looks that at some point your connection URL get screwed up: the host part is substituted instead of endpoint, host part also looks wrong. Try to set DATABRICKS_LOG_LEVEL=debug env, run usql again and share a full log

@calebeaires
Copy link
Author

Thanks to follow this issue, here is the full log to:

DATABRICKS_LOG_LEVEL=debug usql databricks://token:********@URL.3.azuredatabricks.net:443/sql/protocolv1/o/******/****-******-******
4:28PM INF setting log level to debug
4:28PM DBG client.OpenSession connId= corrId= queryId=
4:28PM DBG performing request
4:28PM DBG RoundTrip elapsed time: 39.36604ms
4:28PM ERR request failed
4:28PM DBG retrying request
4:28PM DBG RoundTrip elapsed time: 14.030828ms
4:28PM ERR request failed
4:28PM DBG retrying request
4:28PM DBG RoundTrip elapsed time: 14.194331ms
4:28PM ERR request failed
4:28PM DBG retrying request
4:28PM DBG RoundTrip elapsed time: 31.649215ms
4:28PM ERR request failed
4:28PM DBG retrying request
4:29PM DBG RoundTrip elapsed time: 32.321025ms
4:29PM ERR request failed

@calebeaires
Copy link
Author

calebeaires commented Jun 5, 2024

And here is where I've got the credentials

CleanShot 2024-06-05 at 16 33 14@2x

And where I've got the token

CleanShot 2024-06-05 at 16 35 48@2x

@calebeaires
Copy link
Author

I just changed it to URL to hide the complete azure url. It becames something like "adb-numeric-id.3.azuredatabricks.net"

@kravets-levko
Copy link
Collaborator

Thank you! TBH I have no idea what's going on. I need some time to try it myself. Will get back to you when I have more info on this

@calebeaires
Copy link
Author

The server we created there is a testing environment. If you need I can send you the connection credentials.

@kravets-levko
Copy link
Collaborator

I already have access to some test servers, will try them first. If you can connect to your server using different driver - most likely it's an issue with either this library or usql

@calebeaires
Copy link
Author

Yes, I can. Using DBeaver, the connection goes ok

CleanShot 2024-06-05 at 17 04 50@2x

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants