Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

Troubleshooting: Could not connect! error with Apache Spark on Databricks

HenrietteH
Alteryx Alumni (Retired)
Created

How-To

Troubleshoot "Could not connect!" errors with Apache Spark on Databricks.


Environment 

  • Alteryx Designer
  • Databricks
Note: Testing and all screenshots are for Databricks on AWS, there may be slight differences for Databricks on Azure


This article walks through troubleshooting options that can be used to help diagnose why a user is getting a "Could not Connect!" error such as the ones below when setting up an Apache Spark on Databricks connection through the In-DB Connections Manager (Options > Advanced Options > Manage In-DB Connections).

 

Could not connect! Databricks returned HTTP code 403
Could not connect! Response body is empty
Could not connect! Invalid response while retrieving Databricks clusters

 

HenrietteH_0-1578685318367.png

 

Procedure

Option A: check credentials

Check to make sure that credentials are entered correctly.

Do the same credentials work outside of Alteryx?

If an HTTP Code is returned with the error, use the code as a guide to determine what may be incorrect. For example, the error "Databricks returned HTTP code 403" indicates an incorrect token.

An incorrect Account ID will return an empty response body.

Use theHow To: Configure a Databricks ConnectionKnowledge base article as a guide for finding the correct information.

 

Option B: use curl for troubleshooting

Use curl for further troubleshooting.
Note: This may require assistance from an admin on the computer and/or IT.

When clicking on the "Connect" button, we make a call to retrieve the cluster names. That call is: 

GET https://accountid.cloud.databricks.com/api/2.0/clusters/list

with accountid being the value entered in the Account ID field. The token is being sent for authorization. 
 

  1. If curl is not already installed on the machine, download curl and follow instructions to install it, for example from this site:https://curl.haxx.se/windows/
  2. Alteryx uses tokens for authentication when connecting to Databricks which Databricks strongly recommends. For use with curl, Databricks uses a .netrc file as described in their documentation here:
    machine  login token password 

    Replace with the .cloud.databricks.com domain name of your Databricks deployment. Replace with the value of your personal access token.
  3. Using the Databricks Clusters API, list all available clusters:
    curl -n https:///api/2.0/clusters/list  or  curl --netrc-file "netrc file"  https:///api/2.0/clusters/list  

    Use --netrc-file instead of -n to point directly to the file.
    Replace"netrc file" with the path to the netrc file containing the authentication information and with the .cloud.databricks.com domain name of the user's Databricks deployment.

  4. If this returns an error, we have established that the issues is outside of Alteryx. If the error message is more verbose than the one in Alteryx, it can help the user to search for it or have them share it with his Databricks admin for further troubleshooting.
  5. If there is no error, check to see if the cluster the user is trying to connect to is in the list.
    HenrietteH_1-1578963284818.png

 

 

Option C: check for proxy related issues

Check to see if a proxy is interfering with the connection.

  1. Is the user able to connect outside of Alteryx?
  2. Is the user able to connect off the network (e.g. from home)?
  3. Which Alteryx version are they on (major and minor version)?
  4. Do they have a proxy configured in their browser?
  5. Are they able to connect to the internet (e.g. google.com) with another tool (the download tool)?
  6. Have the user try a TRACERT to follow how it is being routed
    TRACERT www.google.com  TRACERT 

    Replacing with the .cloud.databricks.com domain name of the user's Databricks deployment.

    This will return the hops it takes to reach the destination. There will be some noise but you should be able to spot any proxies.
    HenrietteH_0-1578963053424.png

 

 

Additional Information