Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vagrant installation #413

Closed
romanblachman opened this issue Apr 29, 2015 · 7 comments
Closed

vagrant installation #413

romanblachman opened this issue Apr 29, 2015 · 7 comments

Comments

@romanblachman
Copy link

after installing the redash for the first time, after installing the frontend using bower and pip install to the required Python packages, I'm running redash and getting the following error immediately:

14:00:55 web.1 | [2015-04-29 14:00:55,040][PID:1839][ERROR][peewee] SELECT "t1"."id", "t1"."updated_at", "t1"."created_at", "t1"."name", "t1"."email", "t1"."password_hash", "t1"."groups" FROM "users" AS t1 WHERE ("t1"."email" = %s) [u'admin']
14:00:55 web.1 | Traceback (most recent call last):
14:00:55 web.1 | File "/usr/local/lib/python2.7/dist-packages/playhouse/postgres_ext.py", line 351, in execute_sql
14:00:55 web.1 | cursor.execute(sql, params or ())
14:00:55 web.1 | ProgrammingError: column t1.updated_at does not exist
14:00:55 web.1 | LINE 1: SELECT "t1"."id", "t1"."updated_at", "t1"."created_at", "t1"...
14:00:55 web.1 | ^
14:00:55 web.1 | Traceback (most recent call last):
14:00:55 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in call
14:00:55 web.1 | return self.wsgi_app(environ, start_response)
14:00:55 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
14:00:55 web.1 | response = self.make_response(self.handle_exception(e))
14:00:55 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask_restful/init.py", line 251, in error_router
14:00:55 web.1 | return original_handler(e)
14:00:55 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
14:00:55 web.1 | reraise(exc_type, exc_value, tb)
14:00:55 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
14:00:55 web.1 | response = self.full_dispatch_request()
14:00:55 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
14:00:55 web.1 | rv = self.handle_user_exception(e)
14:00:55 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask_restful/init.py", line 251, in error_router
14:00:55 web.1 | return original_handler(e)
14:00:55 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
14:00:55 web.1 | reraise(exc_type, exc_value, tb)
14:00:55 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
14:00:55 web.1 | rv = self.dispatch_request()
14:00:55 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
14:00:55 web.1 | return self.view_functionsrule.endpoint
14:00:55 web.1 | File "/opt/redash/current/redash/controllers.py", line 72, in login
14:00:55 web.1 | user = models.User.select().where(models.User.email == request.form['username']).first()
14:00:55 web.1 | File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 2517, in first
14:00:55 web.1 | res = self.execute()
14:00:55 web.1 | File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 2551, in execute
14:00:55 web.1 | self._qr = ResultWrapper(model_class, self._execute(), query_meta)
14:00:55 web.1 | File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 2243, in _execute
14:00:55 web.1 | return self.database.execute_sql(sql, params, self.require_commit)
14:00:55 web.1 | File "/usr/local/lib/python2.7/dist-packages/playhouse/postgres_ext.py", line 358, in execute_sql
14:00:55 web.1 | self.commit()
14:00:55 web.1 | File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 2732, in exit
14:00:55 web.1 | reraise(new_type, new_type(*exc_value.args), traceback)
14:00:55 web.1 | File "/usr/local/lib/python2.7/dist-packages/playhouse/postgres_ext.py", line 351, in execute_sql
14:00:55 web.1 | cursor.execute(sql, params or ())
14:00:55 web.1 | ProgrammingError: column t1.updated_at does not exist
14:00:55 web.1 | LINE 1: SELECT "t1"."id", "t1"."updated_at", "t1"."created_at", "t1"...
14:00:55 web.1 | ^

@jason-turbin
Copy link

I'm seeing a similar problem.

@arikfr
Copy link
Member

arikfr commented Apr 29, 2015

Looks like it's trying to use the wrong postgres database. Did you prefix your command with bin/run?

Also, you will need to run the migrations. Or alternatively just recreate the database.

To run migrations, run the following from the vagrant box in /opt/redash/current:

bin/run PYTHONPATH=. python migrations/0001_allow_delete_query.py
bin/run PYTHONPATH=. python migrations/0002_fix_timestamp_fields.py
bin/run PYTHONPATH=. python migrations/0003_update_data_source_config.py
bin/run PYTHONPATH=. python migrations/0004_allow_null_in_event_user.py
bin/run PYTHONPATH=. python migrations/0005_add_updated_at.py
bin/run PYTHONPATH=. python migrations/0006_queries_last_edit_by.py
bin/run PYTHONPATH=. python migrations/0007_add_schedule_to_queries.py
bin/run PYTHONPATH=. python migrations/0008_make_ds_name_unique.py

@arikfr
Copy link
Member

arikfr commented Apr 29, 2015

(Btw, I'm assuming you're using the development Vagrant box. Let me know if it's not the case)

@jason-turbin
Copy link

Thank you Arik, that did the trick. I was running the command with bin/run. I did have to change your suggestion to run migrations to this to get them to work...

PYTHONPATH=. bin/run python migrations/0001_allow_delete_query.py
PYTHONPATH=. bin/run python migrations/0002_fix_timestamp_fields.py
PYTHONPATH=. bin/run python migrations/0003_update_data_source_config.py
PYTHONPATH=. bin/run python migrations/0004_allow_null_in_event_user.py
PYTHONPATH=. bin/run python migrations/0005_add_updated_at.py
PYTHONPATH=. bin/run python migrations/0006_queries_last_edit_by.py
PYTHONPATH=. bin/run python migrations/0007_add_schedule_to_queries.py
PYTHONPATH=. bin/run python migrations/0008_make_ds_name_unique.py

Is there an easy way to run all known migrations? I tried python manage db migrate with no joy...

@romanblachman
Copy link
Author

it worked! thanks

@arikfr
Copy link
Member

arikfr commented Apr 29, 2015

@jason-turbin the upgrade Fabric script runs migrations automatically. No such solution for the dev box yet.

Let me know if you happen to have other questions.

@arikfr
Copy link
Member

arikfr commented Apr 29, 2015

@romanblachman glad it worked. To hesitate to reach out if you have other questions. Also, I assume your'e in Israel, so we can meet if you like, and I'll walk you through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants