Not able to connect to any datasource

Issue Summary

I have installed redash using docker on my local mac. installation looks fine.
I have a list of datasources on AWS-RDS(mysql), and a mysql(in an Ec2), mongodb(ec2), snowflake
But i see its connecting to snowflake alone as its not hosted by us.
Whereas the other connections timed out. I tried allowing ports 5000, 5678(redash docker server) or allowing all ip’s/ports on ec2(0.0.0.0/0), still i wasn’t able to connect. It looks more like docker issue related. Am new to docker as well. Any help would be appreciated asap. Looks like common problem others faced. But don’t see any straight forward answer.
Note: With the same config i can connect from my IDE - datagrip to the mysql/mongodb without any issue.

Technical details:Screenshot 2020-04-26 at 13.01.09

  • Redash Version:
  • Browser/OS: Chrome/ macOS Mojave
  • How did you install Redash:docker

These errors usually mean that you haven’t enabled network access between Redash and your database server(s). Are the databases also running on your Mac?

No the databases are running on Aws RDS or in an EC2.

Then you need to whitelist your local computer’s public IP address. Here’s an example of how to do this with Redshift.

Yes, i understand that, and my EC2 is already with inbound rules allowing all ip’s and ports. But still not able to connect.

I missed that before.

Is your Redash instance able to connect to the internet at all? What happens if you make a JSON data source and hit a public API?

Yes, it is able to connect to internet. I just found that am connecting through VPN. So is it possible that VPN is blocking, any settings needs to be enabled in docker as if it’s connecting from my laptop?

That’s a bit beyond my element. More of a docker question than a Redash one. You can test it by SSH’ing into the server and then trying to connect to your database directly.

Just run docker ps to see your list of containers and then:

docker exec -it <mycontainer> bash

to effectively SSH into it. Then see about connecting to your data source or pinging it.

Also check your VPN settings to see if there’s a firewall in place. This seems a likely culprit.

If your AWS EC2 instances are inside a VPC, there could also be network access control lists blocking access to your instances from outside the VPC.

It could also be related to the way you’re running the container in Docker on your Mac. See https://docs.docker.com/docker-for-mac/networking/

Okay, I got the problem now,
Solution worked for me: Order of starting services matters. Restart Docker if you have connected to VPN. Order should be start VPN and then start DOCKER.

May be am stupid with DOCKER, but if it helps someone… :slight_smile:

Problem history and analysis
Initially after redash self hosted docker setup on my mac, none of the datasources(mysql/mongodb running aws instances) can be connected from it, but was able to connect to snowflake which was managed by snowflake.
So i thought there were problems with my instances not allowing ports or ip which requires whitelisting.
But wait, i can connect from laptop locally through IDE’s like sqlPro or Datagrip to these mysql instances though i did not whitelist my mac ip nor the instances are allowing all ip’s/ports.
My instances allows all ip’s though our VPN, thats why connection from my local works, coz am connected to VPN.
So its not instances that has problems, but docker does not go through VPN was what my assumption, so started digging in that direction, and i got a whole lot of answers on it, one of them was the order of how you start your DOCKER and VPN matters. I had to restart docker after connecting to VPN that changes docker connect through VPN. Phew!!! that was 2-weeks of docker networking and aws networking and VPN… Now i think i can connect anything :smiley:

Thanks @susodapop, @griffinator76 for your responses.

2 Likes