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

table query has no column named tracking_url #3219

Closed
ciwei100000 opened this issue Aug 1, 2017 · 1 comment
Closed

table query has no column named tracking_url #3219

ciwei100000 opened this issue Aug 1, 2017 · 1 comment

Comments

@ciwei100000
Copy link

Make sure these boxes are checked before submitting your issue - thank you!

  • [x ] I have checked the superset logs for python stacktraces and included it here as text if any
  • [x ] I have reproduced the issue with at least the latest released version of superset
  • [x ] I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

commit 774ad45

Actual results

Both sql_lab and query search failed as shown below

bugimage

bugimage_2

The console shows the following errors

2017-08-01 19:40:33,807:INFO:werkzeug:127.0.0.1 - - [01/Aug/2017 19:40:33] "GET /users/api/read HTTP/1.1" 200 -
2017-08-01 19:40:33,854:INFO:werkzeug:127.0.0.1 - - [01/Aug/2017 19:40:33] "GET /databaseasync/api/read?_flt_0_expose_in_sqllab=1 HTTP/1.1" 200 -
2017-08-01 19:40:33,904:INFO:root:[stats_logger] (incr) search_queries
2017-08-01 19:40:33,932:INFO:werkzeug:127.0.0.1 - - [01/Aug/2017 19:40:33] "GET /superset/search_queries?status=success&from=1499168433782&to=1501587633784 HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/home/liushu/venv/lib/python2.7/site-packages/flask/app.py", line 1997, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/liushu/venv/lib/python2.7/site-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/home/liushu/venv/lib/python2.7/site-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/liushu/venv/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/liushu/venv/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/liushu/venv/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/liushu/venv/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/liushu/venv/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/liushu/PycharmProjects/incubator-superset/superset/utils.py", line 574, in wraps
    return f(self, *args, **kwargs)
  File "/home/liushu/PycharmProjects/incubator-superset/superset/models/core.py", line 759, in wrapper
    value = f(*args, **kwargs)
  File "/home/liushu/PycharmProjects/incubator-superset/superset/views/core.py", line 2245, in search_queries
    .limit(query_limit)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2703, in all
    return list(self)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2855, in __iter__
    return self._execute_and_instances(context)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2878, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 945, in execute
    return meth(self, multiparams, params)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
    context)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
    exc_info
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
OperationalError: (sqlite3.OperationalError) no such column: query.tracking_url [SQL: u'SELECT "query".id AS query_id, "query".client_id AS query_client_id, "query".database_id AS query_database_id, "query".tmp_table_name AS query_tmp_table_name, "query".user_id AS query_user_id, "query".status AS query_status, "query".tab_name AS query_tab_name, "query".sql_editor_id AS query_sql_editor_id, "query".schema AS query_schema, "query".sql AS query_sql, "query".select_sql AS query_select_sql, "query".executed_sql AS query_executed_sql, "query"."limit" AS query_limit, "query".limit_used AS query_limit_used, "query".select_as_cta AS query_select_as_cta, "query".select_as_cta_used AS query_select_as_cta_used, "query".progress AS query_progress, "query".rows AS query_rows, "query".error_message AS query_error_message, "query".results_key AS query_results_key, "query".start_time AS query_start_time, "query".start_running_time AS query_start_running_time, "query".end_time AS query_end_time, "query".end_result_backend_time AS query_end_result_backend_time, "query".tracking_url AS query_tracking_url, "query".changed_on AS query_changed_on \nFROM "query" \nWHERE "query".status = ? AND "query".start_time > ? AND "query".start_time < ? ORDER BY "query".start_time ASC\n LIMIT ? OFFSET ?'] [parameters: (u'success', 1499168433782, 1501587633784, 1000, 0)]

and

2017-08-01 19:40:33,807:INFO:werkzeug:127.0.0.1 - - [01/Aug/2017 19:40:33] "GET /users/api/read HTTP/1.1" 200 -
2017-08-01 19:40:33,854:INFO:werkzeug:127.0.0.1 - - [01/Aug/2017 19:40:33] "GET /databaseasync/api/read?_flt_0_expose_in_sqllab=1 HTTP/1.1" 200 -
2017-08-01 19:40:33,904:INFO:root:[stats_logger] (incr) search_queries
2017-08-01 19:40:33,932:INFO:werkzeug:127.0.0.1 - - [01/Aug/2017 19:40:33] "GET /superset/search_queries?status=success&from=1499168433782&to=1501587633784 HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/home/liushu/venv/lib/python2.7/site-packages/flask/app.py", line 1997, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/liushu/venv/lib/python2.7/site-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/home/liushu/venv/lib/python2.7/site-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/liushu/venv/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/liushu/venv/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/liushu/venv/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/liushu/venv/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/liushu/venv/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/liushu/PycharmProjects/incubator-superset/superset/utils.py", line 574, in wraps
    return f(self, *args, **kwargs)
  File "/home/liushu/PycharmProjects/incubator-superset/superset/models/core.py", line 759, in wrapper
    value = f(*args, **kwargs)
  File "/home/liushu/PycharmProjects/incubator-superset/superset/views/core.py", line 2245, in search_queries
    .limit(query_limit)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2703, in all
    return list(self)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2855, in __iter__
    return self._execute_and_instances(context)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2878, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 945, in execute
    return meth(self, multiparams, params)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
    context)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
    exc_info
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/home/liushu/venv/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
OperationalError: (sqlite3.OperationalError) table query has no column named tracking_url [SQL: u'INSERT INTO "query" (client_id, database_id, tmp_table_name, user_id, status, tab_name, sql_editor_id, schema, sql, select_sql, executed_sql, "limit", limit_used, select_as_cta, select_as_cta_used, progress, rows, error_message, results_key, start_time, start_running_time, end_time, end_result_backend_time, tracking_url, changed_on) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'] [parameters: (u'H1egNOJCI-', 1, None, 2, u'running', u'', u'', None, u'SELECT id,\n       permission_id,\n       view_menu_id\nFROM main.ab_permission_view\nLIMIT 100\nOFFSET 0', None, None, 1000000, 0, 0, 0, 0, None, None, None, 1501587496350.92, None, None, None, None, '2017-08-01 11:38:16.357399')]

Checkout to the commit before #3187 and it will no longer produce this error

@xrmx
Copy link
Contributor

xrmx commented Aug 1, 2017

You forgot to run the migrations after upgrading...

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