Summary
The "Flight returned unavailable" error is a generic connection failure, and this article shows how to find the real reason behind it. It covers a port check, a TLS handshake test, and a short Python Arrow Flight script with gRPC logging turned on, which prints far more detail than the ODBC error does.
Reported Issue
When connecting with Arrow Flight ODBC from a Windows or Linux client to an SSL-enabled Dremio instance, the user gets the error "Flight returned unavailable" with the message "failed to connect to all addresses." The message does not say why the connection failed.
Relevant Versions
All versions of Dremio.
Cause
The error only means the client could not open a working connection, so several different problems produce it. Rule these out in turn:
- The Arrow Flight port (32010 by default) is not reachable because of a network, firewall or DNS problem, or the wrong host or port.
- TLS is not enabled on that endpoint, or the client and server disagree about whether to use TLS.
- The server certificate is untrusted, expired or has an incomplete chain, so the client rejects it.
- The hostname used does not match the certificate.
- A proxy or security appliance is intercepting the connection.
The steps below separate these causes.
Steps to Resolve
Run these from the client machine that shows the error, replacing <dremio hostname> with the host the ODBC connection uses.
Step 1: Check the port is reachable
On Windows (PowerShell):
Test-NetConnection <dremio hostname> -Port 32010
On Linux:
nc -vz <dremio hostname> 32010
If the connection fails, the cause is the network, a firewall or the wrong host or port. Fix that before testing TLS.
Step 2: Check the TLS handshake and certificate
On Linux, openssl is normally already installed:
openssl s_client -connect <dremio hostname>:32010 -showcerts
On Windows, no download is needed. Use the PowerShell test in the article "Testing SSL/TLS Connection from Windows to Dremio (No Downloads)", which reports the TLS version, the certificate chain and any trust or expiry errors.
Step 3: Run a Python Arrow Flight test with gRPC logging
The ODBC driver reports only the generic error. Arrow Flight runs on gRPC, and turning on gRPC logging shows what is going wrong underneath. Install the library once with pip install pyarrow, then save this as test_arrow.py:
from pyarrow import flight
username = "<dremio user>"
password = "<dremio password>"
host = "<dremio hostname>"
# Verification is disabled, so this tests that a TLS connection can be made,
# not that the certificate is trusted (see Step 4 for that).
client = flight.FlightClient(f"grpc+tls://{host}:32010", disable_server_verification=True)
bearer_token = client.authenticate_basic_token(username, password)
options = flight.FlightCallOptions(headers=[bearer_token])
sql = "SELECT * FROM sys.nodes"
info = client.get_flight_info(flight.FlightDescriptor.for_command(sql), options)
reader = client.do_get(info.endpoints[0].ticket, options)
print(reader.read_all())Turn on gRPC logging before running it.
Windows (Command Prompt):
set GRPC_VERBOSITY=DEBUG set GRPC_TRACE=all python test_arrow.py > flight_test.log 2>&1
Linux:
export GRPC_VERBOSITY=DEBUG export GRPC_TRACE=all python3 test_arrow.py > flight_test.log 2>&1
GRPC_TRACE=all is very verbose, so the commands above write everything to flight_test.log. The tcp trace is not implemented on Windows, so TCP-level lines will not appear there. Do not leave real passwords in the script when sharing the log or the file with anyone.
Step 4: Test certificate trust
Step 3 disables certificate verification so that the connection itself can be tested. To check whether the client trusts the certificate, pass the CA certificate (PEM format) that signed the Dremio certificate and remove disable_server_verification:
with open("ca.pem", "rb") as f:
root_certs = f.read()
client = flight.FlightClient(f"grpc+tls://{host}:32010", tls_root_certs=root_certs)If Step 3 works but Step 4 fails, the connection and TLS are fine and the certificate chain is the problem.
Additional Resources
https://docs.dremio.com/current/sonar/client-applications/clients/microsoft-power-bi/troubleshooting-connectivity/
https://docs.dremio.com/cloud/sonar/client-apps/drivers/arrow-flight-sql-jdbc/#adding-the-root-ca-certificate-to-your-system-truststore
https://docs.dremio.com/current/get-started/cluster-deployments/customizing-configuration/dremio-conf/wire-encryption-config/