apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
62.72k stars 13.85k forks source link

"column report_schedule.custom_width does not exist" when migrating from 2.1.x to 3.0.0 #25556

Open sfirke opened 1 year ago

sfirke commented 1 year ago

I saw this error in the logs when migrating to 3.0.0. Someone else in Slack posted it too so I'm putting it here to attract any other info folks have about it. I didn't notice any performance regressions associated with it so far.

Log posted in Slack, which matches mine if I recall correctly:

superset_worker       | [SQL: SELECT report_schedule.created_on AS report_schedule_created_on, report_schedule.changed_on AS report_schedule_changed_on, report_schedule.extra_json AS report_schedule_extra_json, report_schedule.id AS report_schedule_id, report_schedule.type AS report_schedule_type, report_schedule.name AS report_schedule_name, report_schedule.description AS report_schedule_description, report_schedule.context_markdown AS report_schedule_context_markdown, report_schedule.active AS report_schedule_active, report_schedule.crontab AS report_schedule_crontab, report_schedule.creation_method AS report_schedule_creation_method, report_schedule.timezone AS report_schedule_timezone, report_schedule.report_format AS report_schedule_report_format, report_schedule.sql AS report_schedule_sql, report_schedule.chart_id AS report_schedule_chart_id, report_schedule.dashboard_id AS report_schedule_dashboard_id, report_schedule.database_id AS report_schedule_database_id, report_schedule.last_eval_dttm AS report_schedule_last_eval_dttm, report_schedule.last_state AS report_schedule_last_state, report_schedule.last_value AS report_schedule_last_value, report_schedule.last_value_row_json AS report_schedule_last_value_row_json, report_schedule.validator_type AS report_schedule_validator_type, report_schedule.validator_config_json AS report_schedule_validator_config_json, report_schedule.log_retention AS report_schedule_log_retention, report_schedule.grace_period AS report_schedule_grace_period, report_schedule.working_timeout AS report_schedule_working_timeout, report_schedule.force_screenshot AS report_schedule_force_screenshot, report_schedule.custom_width AS report_schedule_custom_width, report_schedule.custom_height AS report_schedule_custom_height, report_schedule.created_by_fk AS report_schedule_created_by_fk, report_schedule.changed_by_fk AS report_schedule_changed_by_fk

superset_worker       | FROM report_schedule

superset_worker       | WHERE report_schedule.active IS true]

superset_worker       | (Background on this error at: https://sqlalche.me/e/14/f405)

superset_worker       | Traceback (most recent call last):

superset_worker       |   File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1819, in _execute_context

superset_worker       |     self.dialect.do_execute(

superset_worker       |   File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 732, in do_execute

superset_worker       |     cursor.execute(statement, parameters)

superset_worker       | psycopg2.errors.UndefinedColumn: column report_schedule.custom_width does not exist

superset_worker       | LINE 1: ...e_screenshot AS report_schedule_force_screenshot, report_sch...

superset_worker       |                                                              ^

superset_worker       |

superset_worker       |

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

superset_worker       |

superset_worker       | Traceback (most recent call last):

superset_worker       |   File "/app/superset/utils/celery.py", line 52, in session_scope

superset_worker       |     yield session

superset_worker       |   File "/app/superset/tasks/scheduler.py", line 45, in scheduler

superset_worker       |     active_schedules = ReportScheduleDAO.find_active(session)

superset_worker       |   File "/app/superset/daos/report.py", line 208, in find_active

superset_worker       |     session.query(ReportSchedule).filter(ReportSchedule.active.is_(True)).all()

superset_worker       |   File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 2768, in all

superset_worker       |     return self._iter().all()

superset_worker       |   File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 2903, in _iter

superset_worker       |     result = self.session.execute(

superset_worker       |   File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 1696, in execute

superset_worker       |     result = conn._execute_20(statement, params or {}, execution_options)

superset_worker       |   File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1631, in _execute_20

superset_worker       |     return meth(self, args_10style, kwargs_10style, execution_options)

superset_worker       |   File "/usr/local/lib/python3.9/site-packages/sqlalchemy/sql/elements.py", line 325, in _execute_on_connection

superset_worker       |     return connection._execute_clauseelement(

superset_worker       |   File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1498, in _execute_clauseelement

superset_worker       |     ret = self._execute_context(

superset_worker       |   File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1862, in _execute_context

superset_worker       |     self._handle_dbapi_exception(

superset_worker       |   File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2043, in _handle_dbapi_exception

superset_worker       |     util.raise_(

superset_worker       |   File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/compat.py", line 207, in raise_

superset_worker       |     raise exception

superset_worker       |   File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1819, in _execute_context

superset_worker       |     self.dialect.do_execute(

superset_worker       |   File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 732, in do_execute

superset_worker       |     cursor.execute(statement, parameters)

superset_worker       | sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column report_schedule.custom_width does not exist

superset_worker       | LINE 1: ...e_screenshot AS report_schedule_force_screenshot, report_sch...
rusackas commented 7 months ago

I wonder if anyone is able to test upgrading from 2.1 to 3.1. It would be nice if this was fixed, but who knows. CC @betodealmeida, since they wrote most of the code around this column, it seems.

betodealmeida commented 7 months ago

@sfirke did you run superset db upgrade after your migration?