KNOWLEDGE BASE

Error "org.postgresql.util.PSQLException: Connection to localhost:8060 refused"


Published: 31 Aug 2016
Last Modified Date: 28 Aug 2017

Issue

Tableau Server logins fail and tabadmin commands that connect to the Internal Postgres database return the following error:

The driver encountered an unknown error: org.postgresql.util.PSQLException: Connection to localhost:8060 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

Environment

Tableau Server 10.0

Resolution

Determine Tableau Server's current status by running tabadmin status -v from a command prompt. For more information, see tabadmin commands: status.
 
  • If tabadmin status is Stopped:
    1. Confirm that the Run As User has the necessary permissions described in Required Run As User Account Settings 
    2. Restart Tableau Server. 
  • If tabadmin status is Setting up, increase the timeout of the repository:

    Open the Command Prompt as an administrator and run the following commands
    tabadmin stop
    tabadmin set clustercontroller.pgsql_connection_timeout_ms 6000
    tabadmin config
    tabadmin start


    If the issue persists after setting the value to 6000, the value can be increased again, up to a maximum of 60000. For best results, we recommend using the lowest value possible.
     
  • If tabadmin status is Degraded

    Install the PostgreSQL drivers from Driver Download
     
  • If tabadmin status is Running

    A firewall or antivirus may be preventing Tableau Server from starting up completely. For more information, see Configuring Communication with the Internet

Cause

The Tableau Server Repository (Running on PosgreSQL) is unable to start. The Tableau Server Repository contains all the authentication information causing logins to fail. 

Additional Information

Tableau Server waits a set amount of time (default 60 seconds) for the database to startup before retrying or restarting it. The following 2 workgroup.yml settings determine the timeout:

clustercontroller.pgsql_connection_attempts  (default value=20)
clustercontroller.pgsql_connection_timeout_ms (default value=3000)

The product of these 2 values determines the total amount of the timeout. (60000ms or 60 seconds).

Increasing the value of clustercontroller.pgsql_connection_timeout_ms will increase the amount of time clustercontroller waits for a response from Postgres before attempting failover. Increasing the values of this setting may negatively impact the performance of Tableau Server. For example, it may increase the amount of time Tableau Server is unresponsive in the event of a failure, because clustercontroller will wait longer before restarting Postgres if it is actually down. This is why we recommend using the lowest possible value for this setting.  
The best solution will always be to investigate what environmental factors are causing Postgres to start up slowly. Modifying the clustercontroller.pgsql_connection_timeout_ms setting may be useful as a quick solution while slow performance is being investigated for a longer-term fix. 
 
Did this article resolve the issue?