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

Confusing message when attempting downgrade of database schema #7420

Open
p12tic opened this issue Jan 30, 2024 · 0 comments
Open

Confusing message when attempting downgrade of database schema #7420

p12tic opened this issue Jan 30, 2024 · 0 comments

Comments

@p12tic
Copy link
Member

p12tic commented Jan 30, 2024

Buildbot does not support downgrade of database schema. However, when attempting to do so Buildbot throws a confusing error (taken from #7396 (comment)):

db-1        | ERROR:  relation "version" does not exist at character 15
db-1        | STATEMENT:  select * from version limit 1
db-1        | ERROR:  relation "migrate_version" does not exist at character 15
db-1        | STATEMENT:  select * from migrate_version limit 1
buildbot-1  | Got fatal Exception on DB
buildbot-1  | Traceback (most recent call last):
buildbot-1  |   File "/buildbot_venv/lib/python3.9/site-packages/twisted/python/threadpool.py", line 285, in <lambda>
buildbot-1  |     inContext.theWork = lambda: context.call(  # type: ignore[attr-defined]
buildbot-1  |   File "/buildbot_venv/lib/python3.9/site-packages/twisted/python/context.py", line 117, in callWithContext
buildbot-1  |     return self.currentContext().callWithContext(ctx, func, *args, **kw)
buildbot-1  |   File "/buildbot_venv/lib/python3.9/site-packages/twisted/python/context.py", line 82, in callWithContext
buildbot-1  |     return func(*args, **kw)
buildbot-1  |   File "/buildbot_venv/lib/python3.9/site-packages/buildbot/db/pool.py", line 234, in __thd
buildbot-1  |     log.err(e, 'Got fatal Exception on DB')
buildbot-1  | --- <exception caught here> ---
buildbot-1  |   File "/buildbot_venv/lib/python3.9/site-packages/buildbot/db/pool.py", line 207, in __thd
buildbot-1  |     rv = callable(arg, *args, **kwargs)
buildbot-1  |   File "/buildbot_venv/lib/python3.9/site-packages/buildbot/db/model.py", line 1136, in thd
buildbot-1  |     context.run_migrations()
buildbot-1  |   File "/buildbot_venv/lib/python3.9/site-packages/alembic/runtime/migration.py", line 615, in run_migrations
buildbot-1  |     for step in self._migrations_fn(heads, self):
buildbot-1  |   File "/buildbot_venv/lib/python3.9/site-packages/buildbot/db/model.py", line 1122, in upgrade
buildbot-1  |     return alembic_scripts._upgrade_revs(current_script_rev_head, rev)
buildbot-1  |   File "/buildbot_venv/lib/python3.9/site-packages/alembic/script/base.py", line 455, in _upgrade_revs
buildbot-1  |     return [
buildbot-1  |   File "/usr/lib/python3.9/contextlib.py", line 135, in __exit__
buildbot-1  |     self.gen.throw(type, value, traceback)
buildbot-1  |   File "/buildbot_venv/lib/python3.9/site-packages/alembic/script/base.py", line 283, in _catch_revision_errors
buildbot-1  |     raise util.CommandError(resolution) from re
buildbot-1  | alembic.util.exc.CommandError: Can't locate revision identified by '066'

Buildbot should show a proper error message and refuse to do anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant