superset icon indicating copy to clipboard operation
superset copied to clipboard

Flask-Migrate output is not logged during alembic migrations

Open nytai opened this issue 3 years ago • 3 comments

Due to the changes mentioned here https://github.com/miguelgrinberg/Flask-Migrate/issues/384 the output of flask_migrate is not being logged during alembic migrations. Looks like the alembic.ini file needs to be updated to include logging config for flask_migrate.

These changes should work:

[loggers]
keys = root,sqlalchemy,alembic,flask_migrate

...

[logger_flask_migrate]
level = DEBUG
handlers =
qualname = flask_migrate

...

nytai avatar Jan 11 '22 00:01 nytai

Is this in master branch? I am able to see the migration runs while I run superset db upgrade from master branch (git hash=46715b295), without this additional configuration.

For example:

....
INFO  [alembic.runtime.migration] Running upgrade 3ba29ecbaac5 -> fe23025b9441, rename_big_viz_total_form_data_fields
INFO  [alembic.runtime.migration] Running upgrade fe23025b9441 -> 31bb738bd1d2, move_pivot_table_v2_legacy_order_by_to_timeseries_limit_metric
INFO  [alembic.runtime.migration] Running upgrade 31bb738bd1d2 -> bb38f40aa3ff, Add force_screenshot to alerts/reports

jayakrishnankk avatar Jan 11 '22 17:01 jayakrishnankk

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

stale[bot] avatar Apr 17 '22 19:04 stale[bot]

I can take over this if it hasn't been by anyone.

vedantprajapati avatar Nov 22 '22 14:11 vedantprajapati

I'm having this issue too, when initializing superset 2.0.1. Running superset db upgrade fails with error code 1, but with no logging information as to why, which makes it pretty hard to figure out what's going on. cf https://stackoverflow.com/a/74474278

When I apply the changes in this PR to the alembic.ini file, superset db upgrade then logs the flask-migrate error, which I was then able to resolve manually, cf https://stackoverflow.com/a/67015509

ERROR [flask_migrate] Error: Can't locate revision identified by '4ce1d9b25135'

Can this PR be merged so that others who may encounter errors with flask-migrate can see them?

pomegranited avatar Jan 12 '23 03:01 pomegranited

Looks like this should've been closed by a linked PR quite some time ago!

rusackas avatar Feb 15 '24 16:02 rusackas