Redash: 500 error post setup on docker install

Created on 9 Feb 2017  路  11Comments  路  Source: getredash/redash

Issue Summary

500 error on hitting the redash server post setup. Error messages that look like this:
http://pastebin.com/2sEVa3Ve
or

server_1 | [2017-02-09 03:22:46,964][PID:135][INFO][werkzeug] 172.19.0.1 - - [09/Feb/2017 03:22:46] "POST /setup HTTP/1.1" 302 - server_1 | [2017-02-09 03:22:46,978] ERROR in app: Exception on / [GET] server_1 | Traceback (most recent call last): server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1988, in wsgi_app server_1 | response = self.full_dispatch_request() server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1641, in full_dispatch_request server_1 | rv = self.handle_user_exception(e) server_1 | File "/usr/local/lib/python2.7/dist-packages/flask_restful/__init__.py", line 271, in error_router server_1 | return original_handler(e) server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1544, in handle_user_exception server_1 | reraise(exc_type, exc_value, tb) server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1639, in full_dispatch_request server_1 | rv = self.dispatch_request() server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1625, in dispatch_request server_1 | return self.view_functions[rule.endpoint](**req.view_args) server_1 | File "/usr/local/lib/python2.7/dist-packages/flask_login/utils.py", line 228, in decorated_view server_1 | return func(*args, **kwargs) server_1 | File "/app/redash/handlers/static.py", line 30, in index server_1 | return send_file(full_path, **dict(cache_timeout=0, conditional=True)) server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/helpers.py", line 536, in send_file server_1 | file = open(filename, 'rb') server_1 | IOError: [Errno 2] No such file or directory: '/app/redash/../client/dist/index.html' server_1 | [2017-02-09 03:22:46,978][PID:135][ERROR][redash] Exception on / [GET] server_1 | Traceback (most recent call last): server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1988, in wsgi_app server_1 | response = self.full_dispatch_request() server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1641, in full_dispatch_request server_1 | rv = self.handle_user_exception(e) server_1 | File "/usr/local/lib/python2.7/dist-packages/flask_restful/__init__.py", line 271, in error_router server_1 | return original_handler(e) server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1544, in handle_user_exception server_1 | reraise(exc_type, exc_value, tb) server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1639, in full_dispatch_request server_1 | rv = self.dispatch_request() server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1625, in dispatch_request server_1 | return self.view_functions[rule.endpoint](**req.view_args) server_1 | File "/usr/local/lib/python2.7/dist-packages/flask_login/utils.py", line 228, in decorated_view server_1 | return func(*args, **kwargs) server_1 | File "/app/redash/handlers/static.py", line 30, in index server_1 | return send_file(full_path, **dict(cache_timeout=0, conditional=True)) server_1 | File "/usr/local/lib/python2.7/dist-packages/flask/helpers.py", line 536, in send_file server_1 | file = open(filename, 'rb') server_1 | IOError: [Errno 2] No such file or directory: '/app/redash/../client/dist/index.html' server_1 | [2017-02-09 03:22:46,983][PID:135][INFO][metrics] method=GET path=/ endpoint=redash.index status=500 content_type=? content_length=-1 duration=11.51 query_count=2 query_duration=2.19 server_1 | [2017-02-09 03:22:46,983][PID:135][INFO][werkzeug] 172.19.0.1 - - [09/Feb/2017 03:22:46] "GET / HTTP/1.1" 500 - worker_1 | [2017-02-09 03:22:47,039: INFO/MainProcess] Task redash.tasks.record_event[39c58eed-2ad4-4517-bc6a-227982950c7c] succeeded in 0.0860393460025s: None server_1 | [2017-02-09 03:22:47,187][PID:135][INFO][metrics] method=GET path=/favicon.ico endpoint=redash.send_static status=404 content_type=text/html content_length=233 duration=2.98 query_count=0 query_duration=0.00 server_1 | [2017-02-09 03:22:47,188][PID:135][INFO][werkzeug] 172.19.0.1 - - [09/Feb/2017 03:22:47] "GET /favicon.ico HTTP/1.1" 404 - worker_1 | [2017-02-09 03:22:48,722: INFO/MainProcess] Task redash.tasks.subscribe[e90ee60b-706c-4209-9d57-1975994abd7d] succeeded in 1.758983237s: None worker_1 | [2017-02-09 03:22:58,459: INFO/Beat] Scheduler: Sending due task refresh_queries (redash.tasks.refresh_queries) worker_1 | [2017-02-09 03:22:58,462: INFO/MainProcess] Received task: redash.tasks.refresh_queries[17466b50-6b20-487c-92e4-e2f0b17c4b3c] worker_1 | [2017-02-09 03:22:58,506: INFO/Worker-2] redash.tasks.refresh_queries[17466b50-6b20-487c-92e4-e2f0b17c4b3c]: Refreshing queries... worker_1 | [2017-02-09 03:22:58,518: INFO/Worker-2] redash.tasks.refresh_queries[17466b50-6b20-487c-92e4-e2f0b17c4b3c]: Done refreshing queries. Found 0 outdated queries: [] worker_1 | [2017-02-09 03:22:58,521: INFO/MainProcess] Task redash.tasks.refresh_queries[17466b50-6b20-487c-92e4-e2f0b17c4b3c] succeeded in 0.0576300719986s: None

Steps to Reproduce

  1. Clone down the repo from master branch
  2. docker-compose up
  3. docker-compose run worker create_db (successful)
  4. Go to site URL, fill in setup page successfully.
  5. Submit setup page
  6. 500 error

I think the site should load up post setup, or else include more setup steps that happen to be missing.

Technical details:

  • Redash Version: current master branch
  • Browser/OS:
    Docker version 1.13.0, build 49bf474
    docker-compose version 1.10.0, build 4bd6f1a
    Docker on Mac
  • How did you install Redash: clone repo, docker-compose up

Most helpful comment

Investigated further. It seems that the docker build is missing the npm install and npm run build commands.

Doing this fixes the problem:

docker exec -i -t 854f1fb81a91 /bin/bash
npm install
npm run build
exit

All 11 comments

Same here on a fresh install. Connecting to port 5000 resulted in a half styled registration page. The form was unstyled and below the 'fold'. The right part with the logo did show up nicely. After posting that form the 500 showed up with the same log as above.

Mind you that on my attempt, the nginx container did not start:
edit: #1570 fixes that

2017/02/09 11:21:23 [emerg] 1#1: host not found in upstream "redash:5000" in /etc/nginx/conf.d/default.conf:2
nginx: [emerg] host not found in upstream "redash:5000" in /etc/nginx/conf.d/default.conf:2

The Celery container also had a error:

[2017-02-09 11:19:40,002: INFO/MainProcess] mingle: searching for neighbors
[2017-02-09 11:19:40,119: INFO/Beat] beat: Starting...
[2017-02-09 11:19:40,139: ERROR/Beat] Removing corrupted schedule file 'celerybeat-schedule': DBAccessError(13, 'Permission denied')
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 376, in setup_schedule
    self._store = self._open_schedule()
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 366, in _open_schedule
    return self.persistence.open(self.schedule_filename, writeback=True)
  File "/usr/lib/python2.7/shelve.py", line 243, in open
    return DbfilenameShelf(filename, flag, protocol, writeback)
  File "/usr/lib/python2.7/shelve.py", line 227, in __init__
    Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
  File "/usr/lib/python2.7/anydbm.py", line 85, in open
    return mod.open(file, flag, mode)
  File "/usr/lib/python2.7/dbhash.py", line 18, in open
    return bsddb.hashopen(file, flag, mode)
  File "/usr/lib/python2.7/bsddb/__init__.py", line 364, in hashopen
    d.open(file, db.DB_HASH, flags, mode)
DBAccessError: (13, 'Permission denied')
[2017-02-09 11:19:40,140: ERROR/Beat] Process Beat
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/billiard/process.py", line 292, in _bootstrap
    self.run()
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 553, in run
    self.service.start(embedded_process=True)
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 470, in start
    humanize_seconds(self.scheduler.max_interval))
  File "/usr/local/lib/python2.7/dist-packages/kombu/utils/__init__.py", line 325, in __get__
    value = obj.__dict__[self.__name__] = self.__get(obj)
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 512, in scheduler
    return self.get_scheduler()
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 507, in get_scheduler
    lazy=lazy)
  File "/usr/local/lib/python2.7/dist-packages/celery/utils/imports.py", line 53, in instantiate
    return symbol_by_name(name)(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 358, in __init__
    Scheduler.__init__(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 185, in __init__
    self.setup_schedule()
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 384, in setup_schedule
    self._store = self._destroy_open_corrupted_schedule(exc)
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 372, in _destroy_open_corrupted_schedule
    return self._open_schedule()
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 366, in _open_schedule
    return self.persistence.open(self.schedule_filename, writeback=True)
  File "/usr/lib/python2.7/shelve.py", line 243, in open
    return DbfilenameShelf(filename, flag, protocol, writeback)
  File "/usr/lib/python2.7/shelve.py", line 227, in __init__
    Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
  File "/usr/lib/python2.7/anydbm.py", line 85, in open
    return mod.open(file, flag, mode)
  File "/usr/lib/python2.7/dbhash.py", line 18, in open
    return bsddb.hashopen(file, flag, mode)
  File "/usr/lib/python2.7/bsddb/__init__.py", line 364, in hashopen
    d.open(file, db.DB_HASH, flags, mode)
DBAccessError: (13, 'Permission denied')
[2017-02-09 11:19:42,007: INFO/MainProcess] mingle: all alone

My workflow:

  • Clone Repo
  • git checkout tags/v1.0.0-rc.1
  • docker-compose -f docker-compose.production.yml run --rm server create_db
  • docker-compose -f docker-compose.production.yml up

Versions:

  • Docker on Windows
  • docker-compose version 1.10.0, build 4bd6f1a0
  • Docker version 1.13.0, build 49bf474

Investigated further. It seems that the docker build is missing the npm install and npm run build commands.

Doing this fixes the problem:

docker exec -i -t 854f1fb81a91 /bin/bash
npm install
npm run build
exit

Should be good now, just pull latest docker file and compose files.

I suggest you delete your containers, (docker-compose rm) and recreate them, as sometimes network configuration don't update on start/restart.

Still having same issue after the updated docker file . Still need to run "npm run build"

Yes, still the same issue here.. On running npm run build I get:

> [email protected] build /Users/muuppal/work/redash
> rm -rf ./client/dist/ && NODE_ENV=production node node_modules/.bin/webpack

Hash: b9c6a3928adb1844c075
Version: webpack 2.7.0
Time: 1527ms
                               Asset       Size  Chunks             Chunk Names
         app.293fb4a9aa874a704698.js  895 bytes       0  [emitted]  app
    manifest.c453d7a6421621373984.js    1.48 kB       1  [emitted]  manifest
     app.293fb4a9aa874a704698.js.map    1.22 kB       0  [emitted]  app
manifest.c453d7a6421621373984.js.map    14.5 kB       1  [emitted]  manifest
                          index.html  723 bytes          [emitted]
                      multi_org.html  735 bytes          [emitted]
   [0] ./client/app/index.js 803 bytes {0} [built] [failed] [1 error]

ERROR in ./client/app/index.js
Module build failed: TypeError: Cannot read property 'length' of undefined
    at Traverser.traverse (/Users/muuppal/work/redash/node_modules/estraverse/estraverse.js:411:37)
    at Traverser.traverse (/Users/muuppal/work/redash/node_modules/eslint/lib/util/traverser.js:31:22)
    at EventEmitter.module.exports.api.verify (/Users/muuppal/work/redash/node_modules/eslint/lib/eslint.js:926:23)
    at processText (/Users/muuppal/work/redash/node_modules/eslint/lib/cli-engine.js:264:31)
    at CLIEngine.executeOnText (/Users/muuppal/work/redash/node_modules/eslint/lib/cli-engine.js:754:26)
    at lint (/Users/muuppal/work/redash/node_modules/eslint-loader/index.js:218:17)
    at Object.module.exports (/Users/muuppal/work/redash/node_modules/eslint-loader/index.js:213:21)
Child html-webpack-plugin for "multi_org.html":
       [0] ./~/html-webpack-plugin/lib/loader.js!./client/app/multi_org.html 654 bytes {0} [built]
Child html-webpack-plugin for "index.html":
       [0] ./~/lodash/lodash.js 540 kB {0} [built]
       [1] ./~/html-webpack-plugin/lib/loader.js!./client/app/index.html 946 bytes {0} [built]
       [2] (webpack)/buildin/global.js 509 bytes {0} [built]
       [3] (webpack)/buildin/module.js 517 bytes {0} [built]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `rm -rf ./client/dist/ && NODE_ENV=production node node_modules/.bin/webpack`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/muuppal/.npm/_logs/2017-08-30T21_48_12_100Z-debug.log

I tried it again after docker-compose rm but getting same error. On terminal I can also see

worker_1    | ProgrammingError: (psycopg2.ProgrammingError) relation "queries" does not exist
worker_1    | LINE 2: FROM queries LEFT OUTER JOIN query_results AS query_results_...
worker_1    |              ^

I have the same error with running npm run build

> [email protected] build /Users/kot/git/python/t2/redash
> rm -rf ./client/dist/ && NODE_ENV=production node node_modules/.bin/webpack
Hash: 2c18853529de3a248d55
Version: webpack 2.7.0
Time: 1218ms
                               Asset       Size  Chunks             Chunk Names
         app.f188f8b699ccb9fc1f47.js  930 bytes       0  [emitted]  app
    manifest.f02fa98bafb241cc0f6e.js    1.48 kB       1  [emitted]  manifest
     app.f188f8b699ccb9fc1f47.js.map    1.26 kB       0  [emitted]  app
manifest.f02fa98bafb241cc0f6e.js.map    14.5 kB       1  [emitted]  manifest
                          index.html  723 bytes          [emitted]
                      multi_org.html  735 bytes          [emitted]
   [0] ./client/app/index.js 838 bytes {0} [built] [failed] [1 error]

ERROR in ./client/app/index.js
Module build failed: TypeError: Cannot read property 'length' of undefined
    at Traverser.traverse (/Users/kot/git/python/t2/redash/node_modules/estraverse/estraverse.js:411:37)
    at Traverser.traverse (/Users/kot/git/python/t2/redash/node_modules/eslint/lib/util/traverser.js:31:22)
    at EventEmitter.module.exports.api.verify (/Users/kot/git/python/t2/redash/node_modules/eslint/lib/eslint.js:926:23)
    at processText (/Users/kot/git/python/t2/redash/node_modules/eslint/lib/cli-engine.js:264:31)
    at CLIEngine.executeOnText (/Users/kot/git/python/t2/redash/node_modules/eslint/lib/cli-engine.js:754:26)
    at lint (/Users/kot/git/python/t2/redash/node_modules/eslint-loader/index.js:218:17)
    at Object.module.exports (/Users/kot/git/python/t2/redash/node_modules/eslint-loader/index.js:213:21)
Child html-webpack-plugin for "multi_org.html":
       [0] ./~/html-webpack-plugin/lib/loader.js!./client/app/multi_org.html 654 bytes {0} [built]
Child html-webpack-plugin for "index.html":
       [0] ./~/lodash/lodash.js 540 kB {0} [built]
       [1] ./~/html-webpack-plugin/lib/loader.js!./client/app/index.html 946 bytes {0} [built]
       [2] (webpack)/buildin/global.js 509 bytes {0} [built]
       [3] (webpack)/buildin/module.js 517 bytes {0} [built]`

I had same issue. npm run build worked.
I think this ticket should be reopen.

@is2ei which version have you tried to install, and which type of installation did you use?

@kravets-levko I followed the instruction in https://redash.io/help/open-source/dev-guide/docker

My environment is Debian.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 9.4 (stretch)
Release:    9.4
Codename:   stretch
$ npm --version
6.1.0
$ docker --version
Docker version 18.03.1-ce, build 9ee9f40
$ docker-compose --version
docker-compose version 1.21.2, build a133471

@is2ei the article contains npm run build step (see Usage section). Please next time read all instructions carefully before reporting issues - just to ensure that you did all the possible and it does not work (and it's really a bug)

@kravets-levko does this mean that these extra steps (npm run build) will be necessary with every deployment, and subsequent container restart ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ccakes picture ccakes  路  3Comments

atharvai picture atharvai  路  4Comments

yalisassoon picture yalisassoon  路  4Comments

arikfr picture arikfr  路  3Comments

koooge picture koooge  路  3Comments