skip to Main Content

I am upgrading Apache superset from 0.36.0 to 1.0.0 , on k3s Kubernetes cluster after upgrading it i am facing error specified below . I am using an external postgresql database to connect to superset . Can someone please tell me what could be the issue and how to migrate the old dashboard and every thing to new upgraded version .

I am using these specs in docker file

psycopg2-binary==2.8.6
redis==3.5.3
flower==0.9.7
pybigquery==0.5.0
pymysql==1.0.2
mysqlclient==2.0.3
apache-superset==1.0.1
gunicorn[gevent]==20.0.4
Werkzeug==0.16.0
Pillow==2.2.2

Stacktrace

    Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
    cursor.execute(statement, parameters)
psycopg2.errors.UndefinedColumn: column dashboards.uuid does not exist
LINE 1: SELECT dashboards.uuid AS dashboards_uuid, dashboards.create...
               ^
HINT:  Perhaps you meant to reference the column "dashboards.id".


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/decorators.py", line 109, in wraps
    return f(self, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/superset/utils/log.py", line 162, in wrapper
    value = f(*args, add_extra_log_payload=log, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/superset/views/core.py", line 1803, in dashboard
    dash = qry.one_or_none()
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3459, in one_or_none
    ret = list(self)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
    return self._execute_and_instances(context)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
    return meth(self, multiparams, params)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
    ret = self._execute_context(
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
    util.raise_(
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column dashboards.uuid does not exist
LINE 1: SELECT dashboards.uuid AS dashboards_uuid, dashboards.create...
               ^
HINT:  Perhaps you meant to reference the column "dashboards.id".

[SQL: SELECT dashboards.uuid AS dashboards_uuid, dashboards.created_on AS dashboards_created_on, dashboards.changed_on AS dashboards_changed_on, dashboards.id AS dashboards_id, dashboards.dashboard_title AS dashboards_dashboard_title, dashboards.position_json AS dashboards_position_json, dashboards.description AS dashboards_description, dashboards.css AS dashboards_css, dashboards.json_metadata AS dashboards_json_metadata, dashboards.slug AS dashboards_slug, dashboards.published AS dashboards_published, dashboards.created_by_fk AS dashboards_created_by_fk, dashboards.changed_by_fk AS dashboards_changed_by_fk 
FROM dashboards 
WHERE dashboards.id = %(id_1)s]
[parameters: {'id_1': 1}]
(Background on this error at: http://sqlalche.me/e/13/f405)

3

Answers


  1. Chosen as BEST ANSWER

    Thanks, Guys superset db downgrade and superset db upgrade worked


  2. It looks like you might not have run the database migrations as part of the upgrade.

    superset db upgrade is the command, more information here:
    https://superset.apache.org/docs/installation/upgrading-superset

    Login or Signup to reply.
  3. Can you try running:

    superset db downgrade 18532d70ab98
    superset db upgrade b56500de1855
    

    This should re-run the UUID database migration. Check if dashboards.uuid exists, and then run:

    superset db upgrade
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search