KNOWLEDGE BASE

Unable to Connect to Athena via Proxy Server


Published: 14 Dec 2017
Last Modified Date: 20 May 2020

Issue

Tableau Desktop or Server cannot connect to Amazon Athena via proxy server:
  • The following error messages can be seen in tabprotosrv.txt.
2017-11-16T16:18:24.252: 4984-31cc MSG 
throw DataSourceException (type=Unknown): com.tableausoftware.jdbc.TableauJDBCException: Exception while connecting to server. 
Unable to execute HTTP request: Connect to <database location>] failed: connect timed out 
  • Connecting via SQL Workbench also fails with the same error above.
At the same time, users can connect to Athena via a browser.

Environment

  • Tableau Desktop 
  • Tableau Server 
  • Proxy
  • JRE / JDK 1.8 or later 
  • Amazon Athena

Resolution

Set key-value pairs of proxy_host, proxy_port in athena.properties file.
 
1. Create a text file (Use ISO-8859-1/Latin-1 encoding, without BOM, Byte-Order-Mark) and name it athena.properties.
2. Set following key-value pairs in athena.properties.
 
proxy_host=<proxy hostname or IP address>
proxy_port=<the port proxy server uses>

3. Place the athena.properties file in the following directories.

For Tableau Desktop:  ...\My Tableau Repository\Datasources.
For Tableau Server: ...\Tableau Server Data Directory\tabsvc\vizqlserver\Datasources.
If it is not English Windows, but for example Japanese Windows, place the properties file in the localized named directory such as "データソース"

4. Restart Tableau Desktop or Tableau Server.

If Desktop / Server is properly reading athena.properties, following messages can be seen in tabprotosrv.txt

{"ts":"2017-12-12T18:14:00.426","pid":15776,"tid":"3720","sev":"info","req":"-","sess":"-","site":"{XXXXXXXX-XXXX-XXXX-XXXXXXXXXXXXXXXXX}","user":"-","k":"jni-msg","v":"Jdbc custom connection properties: proxy_port=<proxy port>, proxy_host=<proxy host>","ctx":{"client-type":"vizportal","procid":"4572","requestID":"-","sessionid":"XXXXXXXXXXXXXXXXXXXXXXXX-0:0","tid":"9252","username":"tableauuser"}}

Note: If "proxy_host " and "proxy_port" do not work, try "ProxyHost" and "ProxyPort". 

Cause

JDBC driver cannot load Windows proxy server settings by default.

Additional Information

A similar issue can manifest which has a different solution. See Tableau Fails To Connect to Amazon Athena through Proxy With Error Code 37CE01A3 for more information. 
If athena.properties is in UTF8 with BOM (EF BB BF) is attached in the first line, which prevents Tableau from reading key-value pairs properly like follows and results in failure of connection to Athena.
 
{"ts":"2017-12-12T18:44:00.541","pid":15776,"tid":"3720","sev":"info","req":"-","sess":"-","site":"{XXXXXXXX-XXXX-XXXX-XXXXXXXXXXXXXXXXX}","user":"-","k":"jni-msg","v":"Jdbc custom connection properties: proxy_port=<proxy port>, \u00ef\u00bb\u00bfproxy_host=<proxy host>","ctx":{"client-type":"vizportal","procid":"4572","requestID":"-","sessionid":"XXXXXXXXXXXXXXXXXXXXXXXX-0:0","tid":"9252","username":"tableauuser"}}

SQL Workbench can connect to Athena if additional properties are set in Extended Properties like follows. No space before and after "=" is required.

proxy_host=<proxy hostname or IP address>
proxy_port=<the port proxy server uses>

Discuss this article... Feedback Forum
Did this article resolve the issue?