These are chat archives for getredash/redash

28th
Jan 2016
Tomas Zulberti
@tzulberti
Jan 28 2016 18:18
Hello, I need some help when running Redash inside a docker
I have it running, but I don't know how to run the database migrations
Arik Fraimovich
@arikfr
Jan 28 2016 18:36
@tzulberti you have it already running and want to run migrations of a new version or initial database creation?
Tomas Zulberti
@tzulberti
Jan 28 2016 18:37
yes, but if I try to use docker attach , then it gives me the supervisor console
and when I try sudo docker run -it CONTAINER_ID /bin/bash it can not connect to Redis
Arik Fraimovich
@arikfr
Jan 28 2016 18:38
you need to run it with the links. if you usually run it with docker-compose, then use docker-compose run
Tomas Zulberti
@tzulberti
Jan 28 2016 18:43
even if I run: sudo docker-compose run --entrypoint /bin/bash redash, then I cant connect to Redis
Arik Fraimovich
@arikfr
Jan 28 2016 18:46
how your docker-compose.yml file looks like?
Tomas Zulberti
@tzulberti
Jan 28 2016 18:48
It is the default one that is on the github setup/ubuntu_docker

redash:
image: redash/redash
ports:

- "5000:5000"

links:

- redis
- postgres

environment:
REDASH_STATIC_ASSETS_PATH: ../rd_ui/dist/
REDASH_LOG_LEVEL: INFO
REDASH_REDIS_URL: redis://redis:6379/0
REDASH_DATABASE_URL: postgresql://postgres@postgres/postgres
REDASH_COOKIE_SECRET: veryverysecret
REDASH_GOOGLE_APPS_DOMAIN:
redis:
image: redis:2.8
postgres:
image: postgres:9.3
volumes:

  • /opt/redash-docker/postgres-data:/var/lib/postgresql/data
    nginx:
    image: nginx
    ports:
    • "80:80"
      volumes:
    • "/opt/redash-docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf"
      links:
    • redash
  image: redash/redash
  ports:
    - "5000:5000"
  links:
    - redis
    - postgres
  environment:
    REDASH_STATIC_ASSETS_PATH: ../rd_ui/dist/
    REDASH_LOG_LEVEL: INFO
    REDASH_REDIS_URL: redis://redis:6379/0
    REDASH_DATABASE_URL: postgresql://postgres@postgres/postgres
    REDASH_COOKIE_SECRET: veryverysecret
    REDASH_GOOGLE_APPS_DOMAIN:
redis:
  image: redis:2.8
postgres:
  image: postgres:9.3
  volumes:
   - /opt/redash-docker/postgres-data:/var/lib/postgresql/data
nginx:
  image: nginx
  ports:
    - "80:80"
  volumes:
    - "/opt/redash-docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf"
  links:
    - redash
Arik Fraimovich
@arikfr
Jan 28 2016 18:56
what is the error you get for redis?
Tomas Zulberti
@tzulberti
Jan 28 2016 19:03
redis.exceptions.ConnectionError: Error 111 connecting localhost:6379. Connection refused.
root@feb3f25caee8:/opt/redash/current# sudo -u redash bin/run ./manage.py database create_tables sed: can't read .env: No such file or directory [2016-01-28 19:01:07,480][PID:54][WARNING][redash.query_runner] MQL query runner enabled but not supported, not registering. Either disable or install missing dependencies. [2016-01-28 19:01:07,524][PID:54][WARNING][redash.query_runner] Oracle query runner enabled but not supported, not registering. Either disable or install missing dependencies. Traceback (most recent call last): File "/opt/redash/current/manage.py", line 9, in <module> from redash import settings, models, __version__ File "/opt/redash/current/redash/__init__.py", line 51, in <module> reset_new_version_status() File "/opt/redash/current/redash/version_check.py", line 34, in reset_new_version_status latest_version = get_latest_version() File "/opt/redash/current/redash/version_check.py", line 40, in get_latest_version return redis_connection.get(REDIS_KEY) File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 588, in get return self.execute_command('GET', name) File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 381, in execute_command connection.send_command(*args) File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 299, in send_command self.send_packed_command(self.pack_command(*args)) File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 281, in send_packed_command self.connect() File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 229, in connect raise ConnectionError(self._error_message(e)) redis.exceptions.ConnectionError: Error 111 connecting localhost:6379. Connection refused.
root@feb3f25caee8:/opt/redash/current# sudo -u redash bin/run ./manage.py database create_tables
sed: can't read .env: No such file or directory
[2016-01-28 19:01:07,480][PID:54][WARNING][redash.query_runner] MQL query runner enabled but not supported, not registering. Either disable or install missing dependencies.
[2016-01-28 19:01:07,524][PID:54][WARNING][redash.query_runner] Oracle query runner enabled but not supported, not registering. Either disable or install missing dependencies.
Traceback (most recent call last):
  File "/opt/redash/current/manage.py", line 9, in <module>
    from redash import settings, models, __version__
  File "/opt/redash/current/redash/__init__.py", line 51, in <module>
    reset_new_version_status()
  File "/opt/redash/current/redash/version_check.py", line 34, in reset_new_version_status
    latest_version = get_latest_version()
  File "/opt/redash/current/redash/version_check.py", line 40, in get_latest_version
    return redis_connection.get(REDIS_KEY)
  File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 588, in get
    return self.execute_command('GET', name)
  File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 381, in execute_command
    connection.send_command(*args)
  File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 299, in send_command
    self.send_packed_command(self.pack_command(*args))
  File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 281, in send_packed_command
    self.connect()
  File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 229, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting localhost:6379. Connection refused.
Arik Fraimovich
@arikfr
Jan 28 2016 19:03
don't use bin/run in the docker
bin/run is used to read the .env into environment variables
but docker handles this for you
so you need to run sudo -u redash ./manage.py database create_tables
also if you're creating a database there is a script for that
create_database.sh in setup/docker.
it uses docker-compose
Tomas Zulberti
@tzulberti
Jan 28 2016 19:08
ok, that is was I was trying to do... let me check if the create_database.sh can finish without any error
Tomas Zulberti
@tzulberti
Jan 28 2016 19:16
thanks, that seems to have solved the issue
Arik Fraimovich
@arikfr
Jan 28 2016 19:17
:+1: great