SamEBae opened a new issue #16909:
URL: https://github.com/apache/superset/issues/16909


   
   #### How to reproduce the bug
   
   1. Go to '...'
   2. Click on '....'
   3. Scroll down to '....'
   4. See error
   
   ### Expected results
   
   - `superset db upgrade`  runs alembic migrations
   
   ### Actual results
   
   -  does not progress the migration
   - it stalls at 
https://github.com/apache/superset/blob/master/superset/migrations/versions/07071313dd52_change_fetch_values_predicate_to_text.py
   - 
   
   #### Screenshots
   
   
   `superset --version`
   
   
   ```
   Loaded your LOCAL configuration at [/etc/superset/superset_config.py]
   Python 3.8.12
   Flask 1.1.4
   ```
   
   
   `superset db show`
   
   
   ```
   Loaded your LOCAL configuration at [/etc/superset/superset_config.py]
   logging was configured successfully
   2021-09-29 20:38:57,101:INFO:superset.utils.logging_configurator:logging was 
configured successfully
   2021-09-29 20:38:57,107:INFO:root:Configured event logger of type <class 
'superset.utils.log.DBEventLogger'>
   Rev: 07071313dd52 (head)
   Parent: 6d20ba9ecb33
   Path: 
/usr/local/lib/python3.8/site-packages/superset/migrations/versions/07071313dd52_change_fetch_values_predicate_to_text.py
   
       change_fetch_values_predicate_to_text
   
       Revision ID: 07071313dd52
       Revises: 6d20ba9ecb33
       Create Date: 2021-08-09 17:32:56.204184
   ```
   
   `superset db upgrade`
   
   
   ```
   Loaded your LOCAL configuration at [/etc/superset/superset_config.py]
   logging was configured successfully
   2021-09-29 20:39:18,796:INFO:superset.utils.logging_configurator:logging was 
configured successfully
   2021-09-29 20:39:18,801:INFO:root:Configured event logger of type <class 
'superset.utils.log.DBEventLogger'>
   INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
   INFO  [alembic.runtime.migration] Will assume transactional DDL.
   ```
   
   
   `superset init`
   
   ```
   Loaded your LOCAL configuration at [/etc/superset/superset_config.py]
   logging was configured successfully
   2021-09-29 20:40:35,587:INFO:superset.utils.logging_configurator:logging was 
configured successfully
   2021-09-29 20:40:35,592:INFO:root:Configured event logger of type <class 
'superset.utils.log.DBEventLogger'>
   Syncing role definition
   2021-09-29 20:40:39,462:INFO:superset.security.manager:Syncing role 
definition
   Syncing Admin perms
   2021-09-29 20:40:39,492:INFO:superset.security.manager:Syncing Admin perms
   Syncing Alpha perms
   2021-09-29 20:40:40,197:INFO:superset.security.manager:Syncing Alpha perms
   Syncing Gamma perms
   2021-09-29 20:40:40,890:INFO:superset.security.manager:Syncing Gamma perms
   Syncing granter perms
   2021-09-29 20:40:41,581:INFO:superset.security.manager:Syncing granter perms
   Syncing sql_lab perms
   2021-09-29 20:40:42,271:INFO:superset.security.manager:Syncing sql_lab perms
   Fetching a set of all perms to lookup which ones are missing
   2021-09-29 20:40:42,969:INFO:superset.security.manager:Fetching a set of all 
perms to lookup which ones are missing
   Creating missing datasource permissions.
   2021-09-29 20:40:43,669:INFO:superset.security.manager:Creating missing 
datasource permissions.
   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 dbs.configuration_method does not 
exist
   LINE 1: ...as, dbs.expose_in_sqllab AS dbs_expose_in_sqllab, dbs.config...
                                                                ^
   
   
   The above exception was the direct cause of the following exception:
   
   Traceback (most recent call last):
     File "/usr/local/bin/superset", line 8, in <module>
       sys.exit(superset())
     File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in 
__call__
       return self.main(*args, **kwargs)
     File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 586, in 
main
       return super(FlaskGroup, self).main(*args, **kwargs)
     File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in 
main
       rv = self.invoke(ctx)
     File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in 
invoke
       return _process_result(sub_ctx.command.invoke(sub_ctx))
     File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in 
invoke
       return ctx.invoke(self.callback, **ctx.params)
     File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in 
invoke
       return callback(*args, **kwargs)
     File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 
21, in new_func
       return f(get_current_context(), *args, **kwargs)
     File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 426, in 
decorator
       return __ctx.invoke(f, *args, **kwargs)
     File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in 
invoke
       return callback(*args, **kwargs)
     File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 
21, in new_func
       return f(get_current_context(), *args, **kwargs)
     File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 426, in 
decorator
       return __ctx.invoke(f, *args, **kwargs)
     File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in 
invoke
       return callback(*args, **kwargs)
     File "/usr/local/lib/python3.8/site-packages/superset/cli.py", line 90, in 
init
       security_manager.sync_role_definitions()
     File 
"/usr/local/lib/python3.8/site-packages/superset/security/manager.py", line 
704, in sync_role_definitions
       self.create_missing_perms()
     File 
"/usr/local/lib/python3.8/site-packages/superset/security/manager.py", line 
648, in create_missing_perms
       merge_pv("datasource_access", datasource.get_perm())
     File 
"/usr/local/lib/python3.8/site-packages/superset/connectors/sqla/models.py", 
line 621, in get_perm
       return f"[{self.database}].[{self.table_name}](id:{self.id})"
     File 
"/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/attributes.py", line 
294, in __get__
       return self.impl.get(instance_state(instance), dict_)
     File 
"/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/attributes.py", line 
730, in get
       value = self.callable_(state, passive)
     File 
"/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/strategies.py", line 
759, in _load_for_state
       return self._emit_lazyload(
     File "<string>", line 1, in <lambda>
     File 
"/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/strategies.py", line 
847, in _emit_lazyload
       q(session)
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/ext/baked.py", 
line 615, in _load_on_pk_identity
       result = list(bq.for_session(self.session).params(**params))
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/ext/baked.py", 
line 444, in __iter__
       return q._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 
dbs.configuration_method does not exist
   LINE 1: ...as, dbs.expose_in_sqllab AS dbs_expose_in_sqllab, dbs.config...
   ```
   
   seems to be related to: 
https://github.com/apache/superset/blob/b064cc12ff42b7a968ad0dd537f12b8455cbb005/superset/migrations/versions/453530256cea_add_save_option_column_to_db_model.py
   maybe this didnt run somehow?
   
   ### Environment
   
   (please complete the following information):
   
   - browser type and version: Not applicable since server-side issue
   - superset version: `Superset 1.3.0`
   - python version: `Python 3.8.12`
   
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [X] I have checked the superset logs for python stacktraces and included 
it here as text if there are 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.
   
   ### Additional context
   
   Add any other context about the problem here.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to