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

Error while running "superset db upgrade" after changing metadata DB to SQL Server #7465

Closed
Damoddhar opened this issue May 7, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@Damoddhar
Copy link

commented May 7, 2019

While running "superset db upgrade" in windows machine and using with pyodbc.

Superset Version: 0.27

It was getting the following error:
INFO [alembic.runtime.migration] Context impl MSSQLImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
INFO [alembic.runtime.migration] Running upgrade -> 4e6a06bad7a8, Init
INFO [alembic.runtime.migration] Running upgrade 4e6a06bad7a8 -> 5a7bad26f2a7, empty message
INFO [alembic.runtime.migration] Running upgrade 5a7bad26f2a7 -> 1e2841a4128, empty message
INFO [alembic.runtime.migration] Running upgrade 1e2841a4128 -> 2929af7925ed, TZ offsets in data sources
INFO [alembic.runtime.migration] Running upgrade 2929af7925ed -> 289ce07647b, Add encrypted password field
INFO [alembic.runtime.migration] Running upgrade 289ce07647b -> 1a48a5411020, adding slug to dash
INFO [alembic.runtime.migration] Running upgrade 1a48a5411020 -> 315b3f4da9b0, adding log model
INFO [alembic.runtime.migration] Running upgrade 315b3f4da9b0 -> 55179c7f25c7, sqla_descr
INFO [alembic.runtime.migration] Running upgrade 55179c7f25c7 -> 12d55656cbca, is_featured
INFO [alembic.runtime.migration] Running upgrade 12d55656cbca -> 2591d77e9831, user_id
INFO [alembic.runtime.migration] Running upgrade 2591d77e9831 -> 8e80a26a31db, empty message
INFO [alembic.runtime.migration] Running upgrade 8e80a26a31db -> 7dbf98566af7, empty message
INFO [alembic.runtime.migration] Running upgrade 7dbf98566af7 -> 43df8de3a5f4, empty message
INFO [alembic.runtime.migration] Running upgrade 43df8de3a5f4 -> d827694c7555, css templates
INFO [alembic.runtime.migration] Running upgrade d827694c7555 -> 430039611635, log more
INFO [alembic.runtime.migration] Running upgrade 430039611635 -> 18e88e1cc004, making audit nullable
INFO [alembic.runtime.migration] Running upgrade 18e88e1cc004 -> 836c0bf75904, cache_timeouts
INFO [alembic.runtime.migration] Running upgrade 18e88e1cc004 -> a2d606a761d9, adding favstar model
INFO [alembic.runtime.migration] Running upgrade a2d606a761d9, 836c0bf75904 -> d2424a248d63, empty message
INFO [alembic.runtime.migration] Running upgrade d2424a248d63 -> 763d4b211ec9, fixing audit fk
INFO [alembic.runtime.migration] Running upgrade d2424a248d63 -> 1d2ddd543133, log dt
INFO [alembic.runtime.migration] Running upgrade 1d2ddd543133, 763d4b211ec9 -> fee7b758c130, empty message
INFO [alembic.runtime.migration] Running upgrade fee7b758c130 -> 867bf4f117f9, Adding extra field to Database model
INFO [alembic.runtime.migration] Running upgrade 867bf4f117f9 -> bb51420eaf83, add schema to table model
INFO [alembic.runtime.migration] Running upgrade bb51420eaf83 -> b4456560d4f3, change_table_unique_constraint
Traceback (most recent call last):
File "D:\python\Test\iis\sample\lib\site-packages\sqlalchemy\engine\base.py", line 1244, in _execute_context
cursor, statement, parameters, context
File "D:\python\Test\iis\sample\lib\site-packages\sqlalchemy\engine\default.py", line 552, in do_execute
cursor.execute(statement, parameters)
pyodbc.ProgrammingError: ('42S02', "[42S02] [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name 'alembic_version'. (208) (SQLExecDirectW)")

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

Traceback (most recent call last):
File "superset", line 15, in
manager.run()
File "D:\python\Test\iis\sample\lib\site-packages\flask_script_init_.py", line 417, in run
result = self.handle(argv[0], argv[1:])
File "D:\python\Test\iis\sample\lib\site-packages\flask_script_init_.py", line 386, in handle
res = handle(*args, **config)
File "D:\python\Test\iis\sample\lib\site-packages\flask_script\commands.py", line 216, in call
return self.run(*args, **kwargs)
File "D:\python\Test\iis\sample\lib\site-packages\flask_migrate_init_.py", line 95, in wrapped
f(*args, **kwargs)
File "D:\python\Test\iis\sample\lib\site-packages\flask_migrate_init_.py", line 280, in upgrade
command.upgrade(config, revision, sql=sql, tag=tag)
File "D:\python\Test\iis\sample\lib\site-packages\alembic\command.py", line 276, in upgrade
script.run_env()
File "D:\python\Test\iis\sample\lib\site-packages\alembic\script\base.py", line 475, in run_env
util.load_python_file(self.dir, "env.py")
File "D:\python\Test\iis\sample\lib\site-packages\alembic\util\pyfiles.py", line 90, in load_python_file
module = load_module_py(module_id, path)
File "D:\python\Test\iis\sample\lib\site-packages\alembic\util\compat.py", line 156, in load_module_py
spec.loader.exec_module(module)
File "", line 678, in exec_module
File "", line 205, in call_with_frames_removed
File "D:\python\Test\iis\sample\lib\site-packages\superset/migrations\env.py", line 103, in
run_migrations_online()
File "D:\python\Test\iis\sample\lib\site-packages\superset/migrations\env.py", line 96, in run_migrations_online
context.run_migrations()
File "", line 8, in run_migrations
File "D:\python\Test\iis\sample\lib\site-packages\alembic\runtime\environment.py", line 839, in run_migrations
self.get_context().run_migrations(**kw)
File "D:\python\Test\iis\sample\lib\site-packages\alembic\runtime\migration.py", line 368, in run_migrations
head_maintainer.update_to_step(step)
File "D:\python\Test\iis\sample\lib\site-packages\alembic\runtime\migration.py", line 594, in update_to_step
self.update_version(from, to
)
File "D:\python\Test\iis\sample\lib\site-packages\alembic\runtime\migration.py", line 540, in update_version
== literal_column("'%s'" % from
)
File "D:\python\Test\iis\sample\lib\site-packages\alembic\ddl\mssql.py", line 36, in _exec
result = super(MSSQLImpl, self)._exec(construct, *args, **kw)
File "D:\python\Test\iis\sample\lib\site-packages\alembic\ddl\impl.py", line 134, in _exec
return conn.execute(construct, *multiparams, **params)
File "D:\python\Test\iis\sample\lib\site-packages\sqlalchemy\engine\base.py", line 988, in execute
return meth(self, multiparams, params)
File "D:\python\Test\iis\sample\lib\site-packages\sqlalchemy\sql\elements.py", line 287, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "D:\python\Test\iis\sample\lib\site-packages\sqlalchemy\engine\base.py", line 1107, in _execute_clauseelement
distilled_params,
File "D:\python\Test\iis\sample\lib\site-packages\sqlalchemy\engine\base.py", line 1248, in _execute_context
e, statement, parameters, cursor, context
File "D:\python\Test\iis\sample\lib\site-packages\sqlalchemy\engine\base.py", line 1466, in _handle_dbapi_exception
util.raise_from_cause(sqlalchemy_exception, exc_info)
File "D:\python\Test\iis\sample\lib\site-packages\sqlalchemy\util\compat.py", line 383, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "D:\python\Test\iis\sample\lib\site-packages\sqlalchemy\util\compat.py", line 128, in reraise
raise value.with_traceback(tb)
File "D:\python\Test\iis\sample\lib\site-packages\sqlalchemy\engine\base.py", line 1244, in _execute_context
cursor, statement, parameters, context
File "D:\python\Test\iis\sample\lib\site-packages\sqlalchemy\engine\default.py", line 552, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (pyodbc.ProgrammingError) ('42S02', "[42S02] [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name 'alembic_version'. (208) (SQLExecDirectW)")
[SQL: UPDATE alembic_version SET version_num='b4456560d4f3' WHERE alembic_version.version_num = 'bb51420eaf83']
(Background on this error at: http://sqlalche.me/e/f405)

@issue-label-bot issue-label-bot bot added the #bug label May 7, 2019

@issue-label-bot

This comment has been minimized.

Copy link

commented May 7, 2019

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.90. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@mistercrunch

This comment has been minimized.

Copy link
Contributor

commented May 8, 2019

Windows isn't supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.