Issue Summary

Hi,

I’m trying to deploy Redash 7.0 using docker container, with my own PostgreSQL(on aws’s rds) and redis (local docker container).
However, when I try to browse to 127.0.0.1:5000, localhost:5000, or to redash container ip on port 5000, I get “Unable to connect” error (“This site can’t be reached” on Chrome).

Please assist me, as I don’t know what I’ve done wrong, and how I can get redash to run successfully

How |'ve create the enviroment:

  • I’ve deployed my own postgresql (using RDS on AWS). It is accessible from my laptop, and I’ve created a user for redash with permissions: can login, create roles, create databases.
  • I’ve deployed redis in a docker container on my laptop. I tried to access it from redis cli, and it is working.
  • I’ve downloaded the code from github and switch to the tag v7.0.0
  • I’ve run “docker build” to create docker image
  • I’ve created a local file called docker_env_list with environment variables containing the addresses of my postgresql and redis.
    File content:
    REDASH_REDIS_URL=redis://240.10.0.2:6379/0
    REDASH_DATABASE_URL=postgresql://redash-user:super_secret_password@podtgress_url

Running redash container 1: Creating tables

Command run:

docker run --rm --name redash1 --env-file docker_env_list 86aa2ba6e108 create_db

Output from docker:

[2019-05-20 14:16:33,803][PID:1][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt
[2019-05-20 14:16:33,829][PID:1][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
[2019-05-20 14:17:08,091][PID:1][INFO][alembic.runtime.migration] Context impl PostgresqlImpl.
[2019-05-20 14:17:08,092][PID:1][INFO][alembic.runtime.migration] Will assume transactional DDL.
[2019-05-20 14:17:08,621][PID:1][INFO][alembic.runtime.migration] Running stamp_revision -> e5c7a4e2df4d

Result

The tables were created

Running redash container 2: Deploying dev server

Command run:

docker run --rm --name redash1 --env-file docker_env_list 86aa2ba6e108 dev_server

Output from docker:

[2019-05-20 14:17:30,889][PID:1][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt
[2019-05-20 14:17:30,916][PID:1][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
[2019-05-20 14:17:32,790][PID:1][INFO][werkzeug] * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
[2019-05-20 14:17:32,791][PID:1][INFO][werkzeug] * Restarting with stat
[2019-05-20 14:17:33,606][PID:106][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt
[2019-05-20 14:17:33,631][PID:106][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
[2019-05-20 14:17:35,434][PID:106][WARNING][werkzeug] * Debugger is active!
[2019-05-20 14:17:35,481][PID:106][INFO][werkzeug] * Debugger pin code: 259-495-466

Result

I’ve tried to browse to localhost:5000, 127.0.0.1:5000, and to the containers’ IP to port 5000, but I get “Unable to connect” error (“This site can’t be reached” on Chrome).

Running redash container 3: Deploying regular server

I’ve destroyed the dev container, and tried to run the regular server

Command run:

docker run --rm --name redash1 --env-file docker_env_list 86aa2ba6e108 server

Output from docker

[2019-05-20 14:25:49 +0000] [1] [INFO] Starting gunicorn 19.7.1
[2019-05-20 14:25:49 +0000] [1] [INFO] Listening at: http://0.0.0.0:5000 (1)
[2019-05-20 14:25:49 +0000] [1] [INFO] Using worker: sync
[2019-05-20 14:25:49 +0000] [9] [INFO] Booting worker with pid: 9
[2019-05-20 14:25:49 +0000] [11] [INFO] Booting worker with pid: 11
[2019-05-20 14:25:49 +0000] [13] [INFO] Booting worker with pid: 13
[2019-05-20 14:25:49 +0000] [15] [INFO] Booting worker with pid: 15
[2019-05-20 14:25:51,034][PID:9][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt
[2019-05-20 14:25:51,091][PID:9][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
[2019-05-20 14:25:51,121][PID:11][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt
[2019-05-20 14:25:51,146][PID:13][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt
[2019-05-20 14:25:51,188][PID:11][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
[2019-05-20 14:25:51,190][PID:15][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt
[2019-05-20 14:25:51,217][PID:13][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
[2019-05-20 14:25:51,274][PID:15][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt

Result

I’ve tried to browse to localhost:5000, 127.0.0.1:5000, and to the containers’ IP to port 5000, but I get “Unable to connect” error (“This site can’t be reached” on Chrome).

Technical details:

  • Redash Version: 7.0.0
  • Browser/OS: Firefox/Chrome, macOS
  • How did you install Redash: docker build + docker run

I’ve solved the problem, for all future users.
The port 5000 was available only from inside the container.
Now I run it with:
docker run --rm --name redash_server --env-file docker_env_list -p 5000:5000 86aa2ba6e108 dev_server

1 Like

Good tip for future users. :slight_smile:

As a curiosity thought, do the ports with things listening on them in containers show up when you do this?

$ sudo lsof -i|grep LISTEN

lsof is a utility for querying things like open files, open network ports, and similar. It needs the sudo command in front of it to show things from across the whole system.

If that works, it could be a useful part of diagnostic steps to figure out where things are broken. eg “service not listening” vs “firewall rules blocking things”. :slight_smile:

Yes it does:

docker-pr 24176    root    4u  IPv6 165338136      0t0  TCP *5000 (LISTEN)

Nice tip! thanks :slight_smile:

1 Like