03-21-2023 10:34 AM
I had to rebuild my laptop and am trying to re-install Databricks and Databricks-sql-cli so I can use the CLI to pull info from the databricks repository.
When I try to run the command: dbsqlcli -e "select distinct tableName from databases_info.all_db_tbl_clm"
I get the error: Error during request to server: [Errno 11001] getaddrinfo failed
-----
I am able to get a valid response from the DOS command: databricks workspace ls
I have updated the credentials section of the dbsqlclirc file to populate host_name, http_path and access_token.
http_path and access_token match the ones in the .databrickscfg file.
I went into the databricks compute clusters and copied the name into host_name.
Here is the app.log extract, slightly redacted:
2023-03-21 11:41:08,099 (11320/MainThread) dbsqlcli.main ERROR - error: RequestError('Error during request to server: [Errno 11001] getaddrinfo failed', gaierror(11001, 'getaddrinfo failed'))
Traceback (most recent call last):
File "%userinfo%\AppData\Roaming\Python\Python311\site-packages\dbsqlcli\main.py", line 94, in __init__
self.connect(hostname, http_path, access_token, database)
File "%userinfo%\AppData\Roaming\Python\Python311\site-packages\dbsqlcli\main.py", line 228, in connect
self.sqlexecute = SQLExecute(hostname, http_path, access_token, database)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "%userinfo%\AppData\Roaming\Python\Python311\site-packages\dbsqlcli\sqlexecute.py", line 27, in __init__
self.connect(database=self.database)
File "%userinfo%\AppData\Roaming\Python\Python311\site-packages\dbsqlcli\sqlexecute.py", line 32, in connect
conn = dbsql.connect(
^^^^^^^^^^^^^^
File "%userinfo%\AppData\Roaming\Python\Python311\site-packages\databricks\sql\__init__.py", line 50, in connect
return Connection(server_hostname, http_path, access_token, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "%userinfo%\AppData\Roaming\Python\Python311\site-packages\databricks\sql\client.py", line 189, in __init__
self._session_handle = self.thrift_backend.open_session(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "%userinfo%\AppData\Roaming\Python\Python311\site-packages\databricks\sql\thrift_backend.py", line 464, in open_session
response = self.make_request(self._client.OpenSession, open_session_req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "%userinfo%\AppData\Roaming\Python\Python311\site-packages\databricks\sql\thrift_backend.py", line 393, in make_request
self._handle_request_error(error_info, attempt, elapsed)
File "%userinfo%\AppData\Roaming\Python\Python311\site-packages\databricks\sql\thrift_backend.py", line 261, in _handle_request_error
raise network_request_error
03-22-2023 08:58 PM
@John Zajic
@John Zajic
The error message "Error during request to server: [Errno 11001] getaddrinfo failed" suggests that there is a problem with resolving the hostname of the Databricks server. Here are some steps you can take to troubleshoot the issue:
03-23-2023 06:49 PM
I hear what you are saying but I am using the same http_path and token when I run the databricks workspace ls which gives me a proper response.
03-29-2023 10:05 PM
Hi @John Zajic
Thank you for posting your question in our community! We are happy to assist you.
To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?
This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance!
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