KNOWLEDGE BASE

Unable to Connect to Athena via Proxy Server


Published: 14 Dec 2017
Last Modified Date: 13 Jul 2018

Issue

Tableau Desktop / Server cannot connect to Amazon Athena via proxy server:
  • JRE / JDK 1.8 or later is installed in the machine.
  • Athena JDBC driver is located in the directory C:\Program Filles\Tableau\Drivers.
  • Customer configured proxy server setting via Internet Explorer > Internet options >  Connections > LAN settings > Proxy server.
  • When connecting from Desktop / Server, following error messages are observed 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 athena.us-west-2.amazonaws.com:443 [athena.us-west-2.amazonaws.com/54.148.70.48, athena.us-west-2.amazonaws.com/34.214.178.63, athena.us-west-2.amazonaws.com/52.88.33.62] 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 10.4.0
  • Tableau Server 10.4.0
  • Windows Server 2012
  • Amazon Athena

Resolution

Tableau Desktop / Server 10.4 or later can read properties file call "athena.properties" and setting key-value pairs of proxy_host, proxy_port in athena.properties can solve the issue.
 
1. Create a text file (not UTF8 with 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 / 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

If athena.properties is in UTF8, 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>
Did this article resolve the issue?