ankane / blazer

Business intelligence made simple
MIT License
4.56k stars 474 forks source link

Connection to Redshift database through Ruby on Rails, blazer hanging and failing #412

Closed axelmukwena closed 2 years ago

axelmukwena commented 2 years ago

Hi,

In a Ruby on Rails 6 project, I am using the blazer gem and whenever I add an AWS redshift database, the connection keeps hanging and loading for a long time, and then fails

PG::ConnectionBad: could not connect to server: Connection timed out
    Is the server running on host "redshift-cluster-x.xxxxxxx.us-east-x.redshift.amazonaws.com" (34.xx.30.xxx) and accepting
    TCP/IP connections on port 5439?

Connection

# data_source.settings["url"] = redshift://username:password@redshift-cluster-1.xxxxx.us-east-1.redshift.amazonaws.com:5439/dev
establish_connection(data_source.settings["url"])

. I have the activerecord6-redshift-adpater gem installed

enter image description here

Ensured public access enter image description here

Also, the VPC routes

enter image description here

ankane commented 2 years ago

Hey @axelmukwena, it sounds like a configuration issue (I'd check security groups as well). Make sure you can connect to Redshift with psql from the same machine running Blazer (replace redshift:// with postgres:// in the URL).