Hi ,
I created a URL datasource in redash that is my localhost path http://localhost. I am querying to test.php which return a JSON data.But I am getting following error.
Error running query: HTTPConnectionPool(host=‘localhost’, port=80): Max retries exceeded with url: /test.php (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x7fe8d7ccde90>: Failed to establish a new connection: [Errno 111] Connection refused’,))
Is apache running localhost on the same container that runs Redash? Or is it localhost on your actual host? I suspect the issue here is that Redash is attempting to reach localhost inside the container so it can’t see your Apache at all.
I’m not super familiar with Docker. But you should be able to create a port forward between your Docker container and the host system so that traffic on localhost through some arbitrary port is passed back to your host computer and then handled by Apache.
Another approach that might work - more of a temporary “just getting started” approach than a long term solution - is by using the IP address of your desktop instead of localhost.
For example, on my desktop computer here one of it’s “real” IP addresses is 192.168.1.50.
With Apache running on my desktop computer, by default it binds to every IP address. So a Redash container is able to access the stuff on my local Apache website as http://192.168.1.50/some/path/here.
If you’re just trying to get an initial thing working, that’s an easy way to do it.
Hmmm, if you’re data is in SQLite format and it’s ok to be public, there are easier ways too.