You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an issue on prod system where a migration fails, but the error of why it failed is never displayed. All I see is the exit code: 1
No log line, or any other indication that something went wrong.
I stepped through the code, and found alembic raises: util.CommandError with the string:
Can't locate revision identified by '%s', but that error is never displayed.
I'm attaching pdb output of running the migration command until it exits:
`> /project/app.py(18)create_app()
-> app = Flask(name, static_url_path="/assets", static_folder="assets")
(Pdb) r
--Return--
/project/app.py(58)create_app()-><Flask 'some_app.app'>
-> return app
(Pdb) r
/project/.venv/lib/python3.11/site-packages/flask/cli.py(178)find_app_by_string()
-> if isinstance(app, Flask):
(Pdb) r
--Return--
/project/.venv/lib/python3.11/site-packages/flask/cli.py(179)find_app_by_string()-><Flask 'shipi...p_server.app'>
-> return app
(Pdb) r
--Return--
/project/.venv/lib/python3.11/site-packages/flask/cli.py(237)locate_app()-><Flask 'some_app.app'>
-> return find_app_by_string(module, app_name)
(Pdb) r
/project/.venv/lib/python3.11/site-packages/flask/cli.py(317)load_app()
-> if not app:
(Pdb) r
--Return--
/project/.venv/lib/python3.11/site-packages/flask/cli.py(331)load_app()-><Flask 'some_app.app''>
-> return app
(Pdb) r
/project/.venv/lib/python3.11/site-packages/flask/cli.py(586)get_command()
-> if not current_app or current_app._get_current_object() is not app:
(Pdb) r
--Return--
/project/.venv/lib/python3.11/site-packages/flask/cli.py(589)get_command()->
-> return app.cli.get_command(ctx, name)
(Pdb) r
/project/.venv/lib/python3.11/site-packages/click/core.py(1702)resolve_command()
-> if cmd is None and ctx.token_normalize_func is not None:
(Pdb) r
--Return--
/project/.venv/lib/python3.11/site-packages/click/core.py(1716)resolve_command()->('db', , ['upgrade'])
-> return cmd_name if cmd else None, cmd, args[1:]
(Pdb) r
/project/.venv/lib/python3.11/site-packages/click/core.py(1652)invoke()
-> assert cmd is not None
(Pdb) r
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
--Return--
/project/.venv/lib/python3.11/site-packages/click/core.py(1657)invoke()->None
-> return _process_result(sub_ctx.command.invoke(sub_ctx))
(Pdb) r
SystemExit: 1
/project/.venv/lib/python3.11/site-packages/click/core.py(1055)main()
-> rv = self.invoke(ctx)
(Pdb) r
--Return--
/project/.venv/lib/python3.11/site-packages/click/core.py(1094)main()->None
-> except Abort:
(Pdb) r
SystemExit: 1
/project/.venv/lib/python3.11/site-packages/flask/cli.py(1047)main()
-> cli.main()
(Pdb) r
--Return--
/project/.venv/lib/python3.11/site-packages/flask/cli.py(1047)main()->None
-> cli.main()
(Pdb) r
SystemExit: 1
/project/.venv/bin/flask(8)()
-> sys.exit(main())
(Pdb) r
--Return--
/project/.venv/bin/flask(8)()->None
-> sys.exit(main())
(Pdb) r
`
I tried playing with logging settings in alembic.ini file, but nothing I did there produced the error, am I missing something, or is that a bug?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey everyone.
I ran into an issue on prod system where a migration fails, but the error of why it failed is never displayed. All I see is the exit code: 1
No log line, or any other indication that something went wrong.
I stepped through the code, and found alembic raises: util.CommandError with the string:
Can't locate revision identified by '%s', but that error is never displayed.
I'm attaching pdb output of running the migration command until it exits:
`> /project/app.py(18)create_app()
-> app = Flask(name, static_url_path="/assets", static_folder="assets")
(Pdb) r
--Return--
I tried playing with logging settings in alembic.ini file, but nothing I did there produced the error, am I missing something, or is that a bug?
Beta Was this translation helpful? Give feedback.
All reactions