Getting 500 error while trying to setup redash using docker image redash/redash:7.0.0.b18042 #4209

Hi,

I have tried to setup redash using docker image redash/redash:7.0.0.b18042 but getting below error,

image

getting below error on docker logs,

Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1988, in wsgi_app
response = self.full_dispatch_request()
File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
File “/usr/local/lib/python2.7/dist-packages/flask_restful/ init .py”, line 271, in error_router
return original_handler(e)
File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1639, in full_dispatch_request
rv = self.dispatch_request()
File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1625, in dispatch_request
return self.view_functionsrule.endpoint
File “/usr/local/lib/python2.7/dist-packages/flask_limiter/extension.py”, line 442, in __inner
return obj(*a, **k)
File “/app/redash/handlers/authentication.py”, line 143, in login
if current_org == None and not settings.MULTI_ORG:
File “/usr/local/lib/python2.7/dist-packages/werkzeug/local.py”, line 365, in
eq = lambda x, o: x._get_current_object() == o
File “/usr/local/lib/python2.7/dist-packages/werkzeug/local.py”, line 302, in _get_current_object
return self.__local()
File “/app/redash/authentication/org_resolving.py”, line 18, in _get_current_org
g.org = Organization.get_by_slug(slug)
File “/app/redash/models/organizations.py”, line 33, in get_by_slug
return cls.query.filter(cls.slug == slug).first()
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2895, in first
ret = list(self[0:1])
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2687, in getitem
return list(res)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2995, in iter
return self._execute_and_instances(context)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 3018, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 948, in execute
return meth(self, multiparams, params)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py”, line 269, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1060, in _execute_clauseelement
compiled_sql, distilled_params
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1200, in _execute_context
context)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1413, in _handle_dbapi_exception
exc_info
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py”, line 265, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1193, in _execute_context
context)
File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py”, line 509, in do_execute
cursor.execute(statement, parameters)
ProgrammingError: (psycopg2.ProgrammingError) relation “organizations” does not exist
LINE 2: FROM organizations
^
[SQL: ‘SELECT organizations.updated_at AS organizations_updated_at, organizations.created_at AS organizations_created_at, organizations.id AS organizations_id, organizations.name AS organizations_name, organizations.slug AS organizations_slug, organizations.settings AS organizations_settings \nFROM organizations \nWHERE organizations.slug = %(slug_1)s \n LIMIT %(param_1)s’] [parameters: {‘slug_1’: ‘default’, ‘param_1’: 1}] (Background on this error at: http://sqlalche.me/e/f405)
[2019-10-03 04:48:43,456][PID:9][ERROR][redash] Exception on /login [GET]

Please note that As per the document I have used redis, postgres sql as another containers and given below ennviorment for redash container,

"environment":
- "PYTHONUNBUFFERED=0"
- "REDASH_LOG_LEVEL=INFO"
- "REDASH_REDIS_URL=redis://postgres:6379/0"
- "REDASH_DATABASE_URL=postgresql://postgres@postgres/postgres"
- "REDASH_RATELIMIT_ENABLED=false"

Please advice is there anything need to append to work redash using redash docker image.

Hello. How did you start the Docker image? When I tried to build the image with docker build -t redash/redash . I once got the same error. Without rebuilding it, means with docker-compose run --rm server create_db and then docker-compose up -d it works normally.

Hi,

We are trying via docker compose file, I am pasting the docker-compose file what I am trying,

“networks”:
“lnetwork1”:
“external”:
“name”: “test”
“services”:
“rd-test”:
“container_name”: “rd-test”
“image”: “redash/redash:7.0.0.b18042”
“command”: “server”
“environment”:
- “PYTHONUNBUFFERED=0”
- “REDASH_LOG_LEVEL=INFO”
- “REDASH_REDIS_URL=redis://redis-rd-test:6379/0”
- “REDASH_DATABASE_URL=postgresql://postgres@postgres-rd-test/postgres”
- “REDASH_WEB_WORKERS=4”
- “REDASH_RATELIMIT_ENABLED=false”
“labels”:
“traefik.backend”: “rd-test”
“traefik.docker.network”: “appliance”
“traefik.domain”: “rd-test.example.com
“traefik.enable”: “true”
“traefik.frontend.entryPoints”: “http,https”
“traefik.frontend.rule”: “Host: rd-test.example.com
“traefik.port”: “5000”
“networks”:
- “network1”
“restart”: “always”
“ports”:
- “5000:5000”
“redis-rd”:
“container_name”: “redis-rd-test”
“image”: “redis:5.0-alpine”
“ports”:
- “6379:6379”
“networks”:
- “network1”
“postgres-rd”:
“container_name”: “postgres-rd-test”
“image”: “postgres:9.5-alpine”
“volumes”:
- “storage:/var/lib/postgresql/data”
“networks”:
- “network1”
“ports”:
- “5434:5432”
“version”: “3.4”

Did you run the create_db command?

Based on the error message, it seems that the Redash database doesn’t have the tables it needs. This command creates the database tables Redash uses.

Hi,
Thanks for your update. Its worked.

Is that necessary scheduler section with server section for redash,

eg:

container_name”: “rd-test”
“image”: “redash/redash:7.0.0.b18042”
“command”: “server”
“environment”:

  • “PYTHONUNBUFFERED=0”
  • “REDASH_LOG_LEVEL=INFO”
  • “REDASH_REDIS_URL=redis://redis-rd-test:6379/0”
  • “REDASH_DATABASE_URL=postgresql://postgres@postgres-rd-test/postgres”
  • “REDASH_WEB_WORKERS=4”
  • “REDASH_RATELIMIT_ENABLED=false”

container_name”: “rd-scheduler”
“image”: “redash/redash:7.0.0.b18042”
“command”: “scheduler”
“environment”:

  • “PYTHONUNBUFFERED=0”
  • “REDASH_LOG_LEVEL=INFO”
  • “REDASH_REDIS_URL=redis://redis-rd-test:6379/0”
  • “REDASH_DATABASE_URL=postgresql://postgres@postgres-rd-test/postgres”
  • “WORKERS_COUNT=4”
  • “QUEUES=queries,scheduled_queries,celery”
  • “REDASH_RATELIMIT_ENABLED=false”