question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting timeout error when trying to establish a connection

See original GitHub issue

Driver version

2.0.903

Redshift version

PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3), Redshift 1.0.34691

Client Operating System

Darwin Nativs-MacBook-Pro.local 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64

Python version

3.8.7

Problem description

  1. Expected behaviour: connection established
  2. Actual behaviour: timeout error
  3. More info: On the free trial period
  4. Error message/stack trace:
Traceback (most recent call last):
  File "/Users/tom/Projects/my_proj/.venv/lib/python3.8/site-packages/redshift_connector/core.py", line 544, in __init__
    self._usock.connect((host, port))
TimeoutError: [Errno 60] Operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "<input>", line 2, in <module>
  File "/Users/tom/Projects/my_proj/.venv/lib/python3.8/site-packages/redshift_connector/__init__.py", line 336, in connect
    return Connection(
  File "/Users/tom/Projects/my_proj/.venv/lib/python3.8/site-packages/redshift_connector/core.py", line 591, in __init__
    raise InterfaceError("communication error", e)
redshift_connector.error.InterfaceError: ('communication error', TimeoutError(60, 'Operation timed out'))

Reproduction code

import redshift_connector
conn = redshift_connector.connect(
     host='my-cluster.abc123.us-east-1.redshift.amazonaws.com',
     database='dev',
     user='awsuser',
     password='pass'
  )

What am I doing wrong?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ni-todo-spotcommented, Jan 20, 2022

Thanks for the info - I followed the instructions in the link attached to your reply and succeeded.

THANKS!

1reaction
Brooke-whitecommented, Jan 18, 2022

Hey @ni-todo-spot ,

Thank you for this information. As psql is unable to connect to your cluster, I would recommend to check the following before trying to use redshift_connector, as the root issue is that your machine cannot connect to the cluster:

  • (Sanity check) Are the cluster endpoint and port correct?
  • Using the AWS console or CLI, is the cluster healthy and running?
  • Using the AWS console or CLI, is the cluster configured for access by your IP address? If applicable, do you need to be connected to a VPN to access this cluster? Is the cluster in a VPC? Are the cluster security groups configured to accommodate your machine connecting?

Also, Connection is refused or fails provides some references for troubleshooting this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix the ERR_CONNECTION_TIMED_OUT Error - Kinsta
Simply put, it's an indication that the system is unavailable and the time given for one to connect has elapsed, and now the...
Read more >
11 Ways to Fix the ERR_CONNECTION_TIMED_OUT Error
Server timeout and error messages occur when a program attempts to connect to a non-existent server, either because it is down or because...
Read more >
What Does a Server Connection Timeout Mean?
A server connection timeout means that a server is taking too long to reply to a data request made from another device. Timeouts...
Read more >
Timeout expired messages when connecting to SQL Server
A timeout error means that a certain operation takes longer than needed. The client application stops the operation (instead of waiting ...
Read more >
Server Connection Timeout Error Explained - Crazy Domains
9. Clear DNS cache and IP · On your computer, click Start. · Type cmd on the search box. · In the command...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found