bug: db migration no such revision 2.3.0 -> 2.9.0
See original GitHub issueMeltano Version
2.3.0 -> 2.9.0
Python Version
3.8
Bug scope
API
Operating System
Windows
Description
2.3.0 -> 2.9.0 is causing me errors. I donβt mind so much as I can delete the DB file easily in my case but it slowed me down and Iβm guessing for others itβs a bigger deal.
2022-11-15T17:22:39.340213Z [error ] No such revision or branch '6828cc5b1a4f'
ββββββββββββββββββββββ Traceback (most recent call last) ββββββββββββββββββββββ
β C:\Python39\lib\site-packages\meltano\core\migration_service.py:89 in β
β upgrade β
β β
β 86 β β try: # noqa: WPS229 β
β 87 β β β # try to find the locked version β
β 88 β β β head = LOCK_PATH.open().read().strip() β
β > 89 β β β self.ensure_migration_needed(script, context, head) β
β 90 β β β β
β 91 β β β if not silent: β
β 92 β β β β click.secho(f"Upgrading database to {head}") β
β β
β βββββββββββββββββββββββββββββββββ locals ββββββββββββββββββββββββββββββββββ β
β β cfg = <alembic.config.Config object at β β
β β 0x000002B[207](https://gitlab.com/autoidm/***/-/jobs/3327273153#L207)988340> β β
β β conn = <sqlalchemy.engine.base.Connection object at β β
β β 0x000002B207BEBBE0> β β
β β context = <alembic.runtime.migration.MigrationContext object β β
β β at 0x000002B[209](https://gitlab.com/autoidm/***/-/jobs/3327273153#L209)880670> β β
β β err = ResolutionError("No such revision or branch β β
β β '6828cc5b1a4f'") β β
β β head = '5b43800443d1' β β
β β migration_logger = <_FixedFindCallerLogger alembic.runtime.migration β β
β β (ERROR)> β β
β β original_log_level = 20 β β
β β script = <alembic.script.base.ScriptDirectory object at β β
β β 0x000002B209880B80> β β
β β self = <meltano.core.migration_service.MigrationService β β
β β object at 0x000002B207BEB8B0> β β
β β silent = True β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β C:\Python39\lib\site-packages\meltano\core\migration_service.py:55 in β
β ensure_migration_needed β
β β
β 52 β β """ β
β 53 β β current_head = context.get_current_revision() β
β 54 β β β
β > 55 β β for rev in script.iterate_revisions(current_head, "base"): β
β 56 β β β if rev.revision == target_revision: β
β 57 β β β β raise MigrationUneededException β
β 58 β
β β
β βββββββββββββββββββββββββββββββββ locals ββββββββββββββββββββββββββββββββββ β
β β context = <alembic.runtime.migration.MigrationContext object at β β
β β 0x000002B209880670> β β
β β current_head = '6828cc5b1a4f' β β
β β script = <alembic.script.base.ScriptDirectory object at β β
β β 0x000002B209880B80> β β
β β self = <meltano.core.migration_service.MigrationService β β
β β object at 0x000002B207BEB8B0> β β
β β target_revision = '5b43800443d1' β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β C:\Python39\lib\site-packages\alembic\script\revision.py:799 in β
β iterate_revisions β
β β
β 796 β β else: β
β 797 β β β fn = self._collect_upgrade_revisions β
β 798 β β β
β > 799 β β revisions, heads = fn( β
β 800 β β β upper, β
β 801 β β β lower, β
β 802 β β β inclusive=inclusive, β
β β
β βββββββββββββββββββββββββββββββββ locals ββββββββββββββββββββββββββββββββββ β
β β assert_relative_length = True β β
β β fn = <bound method β β
β β RevisionMap._collect_upgrade_revisions of β β
β β <alembic.script.revision.RevisionMap object at β β
β β 0x000002B209880A00>> β β
β β implicit_base = False β β
β β inclusive = False β β
β β lower = 'base' β β
β β select_for_downgrade = False β β
β β self = <alembic.script.revision.RevisionMap object at β β
β β 0x000002B209880A00> β β
β β upper = '6828cc5b1a4f' β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β C:\Python39\lib\site-packages\alembic\script\revision.py:1426 in β
β _collect_upgrade_revisions β
β β
β 1423 β β """ β
β 1424 β β targets: Collection[Revision] = [ β
β 1425 β β β is_revision(rev) β
β > 1426 β β β for rev in self._parse_upgrade_target( β
β 1427 β β β β current_revisions=lower, β
β 1428 β β β β target=upper, β
β 1429 β β β β assert_relative_length=assert_relative_length, β
β β
β βββββββββββββββββββββββββββββββββ locals ββββββββββββββββββββββββββββββββββ β
β β assert_relative_length = True β β
β β implicit_base = False β β
β β inclusive = False β β
β β lower = 'base' β β
β β self = <alembic.script.revision.RevisionMap object at β β
β β 0x000002B209880A00> β β
β β upper = '6828cc5b1a4f' β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β C:\Python39\lib\site-packages\alembic\script\revision.py:1218 in β
β _parse_upgrade_target β
β β
β 1[215](https://gitlab.com/autoidm/***/-/jobs/3327273153#L215) β β β
β 1[216](https://gitlab.com/autoidm/***/-/jobs/3327273153#L216) β β if not match: β
β 1[217](https://gitlab.com/autoidm/***/-/jobs/3327273153#L217) β β β # No relative destination, target is absolute. β
β > 1[218](https://gitlab.com/autoidm/***/-/jobs/3327273153#L218) β β β return self.get_revisions(target) β
β 1219 β β β
β 1220 β β current_revisions_tup: Union[str, Collection[Optional[str]], β
β 1221 β β current_revisions_tup = util.to_tuple(current_revisions) β
β β
β βββββββββββββββββββββββββββββββββ locals ββββββββββββββββββββββββββββββββββ β
β β assert_relative_length = True β β
β β current_revisions = 'base' β β
β β match = None β β
β β self = <alembic.script.revision.RevisionMap object at β β
β β 0x000002B209880A00> β β
β β target = '6828cc5b1a4f' β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β C:\Python39\lib\site-packages\alembic\script\revision.py:552 in β
β get_revisions β
β β
β 549 β β β β except ValueError: β
β 550 β β β β β # couldn't resolve as integer β
β 551 β β β β β pass β
β > 552 β β β return tuple( β
β 553 β β β β self._revision_for_ident(rev_id, branch_label) β
β 554 β β β β for rev_id in resolved_id β
β 555 β β β ) β
β β
β βββββββββββββββββββββββββββββββββ locals ββββββββββββββββββββββββββββββββββ β
β β branch_label = None β β
β β id_ = '6828cc5b1a4f' β β
β β resolved_id = ('6828cc5b1a4f',) β β
β β self = <alembic.script.revision.RevisionMap object at β β
β β 0x000002B209880A00> β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β C:\Python39\lib\site-packages\alembic\script\revision.py:553 in <genexpr> β
β β
β 550 β β β β β # couldn't resolve as integer β
β 551 β β β β β pass β
β 552 β β β return tuple( β
β > 553 β β β β self._revision_for_ident(rev_id, branch_label) β
β 554 β β β β for rev_id in resolved_id β
β 555 β β β ) β
β 556 β
β β
β βββββββββββββββββββββββββββββββββ locals ββββββββββββββββββββββββββββββββββ β
β β .0 = <tuple_iterator object at 0x000002B2098809A0> β β
β β branch_label = None β β
β β rev_id = '6828cc5b1a4f' β β
β β self = <alembic.script.revision.RevisionMap object at β β
β β 0x000002B209880A00> β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β C:\Python39\lib\site-packages\alembic\script\revision.py:624 in β
β _revision_for_ident β
β β
β 621 β β β if branch_rev: β
β 622 β β β β revs = self.filter_for_lineage(revs, check_branch) β
β 623 β β β if not revs: β
β > 624 β β β β raise ResolutionError( β
β 625 β β β β β "No such revision or branch '%s'%s" β
β 626 β β β β β % ( β
β 627 β β β β β β resolved_id, β
β β
β βββββββββββββββββββββββββββββββββ locals ββββββββββββββββββββββββββββββββββ β
β β branch_rev = None β β
β β check_branch = None β β
β β resolved_id = '6828cc5b1a4f' β β
β β revision = False β β
β β revs = [] β β
β β self = <alembic.script.revision.RevisionMap object at β β
β β 0x000002B209880A00> β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ResolutionError: No such revision or branch '6828cc5b1a4f'
Cannot upgrade the system database. It might be corrupted or was created before database migrations where introduced (v0.34.0)
17:22:43 Running with dbt=1.0.4
Code
No response
Issue Analytics
- State:
- Created 10 months ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
1710222 β [FFU] db migrage fails "No such revision or branch ...
Bug 1710222 - [FFU] db migrage fails "No such revision or branch '7db8cd315b95'" ... "INFO [alembic.runtime.migration] Will assume non-transactional DDL.
Read more >bundle exec rails server failing :/ Β· Issue #5382 - GitHub
I successfully ran all of the preceding steps including bundle rake db:create, bundle rake db:migrate, and RAILS_ENV=test bundle exec rakeΒ ...
Read more >python - Cannot complete Flask-Migration - Stack Overflow
I'm trying to migrate using flask-migrate but, when I run $ python app.py db migrate I get this error... raise util.CommandError("No such revision...
Read more >Bug listing with status UNCONFIRMED as at 2022/12/22 02 ...
Bug :128538 - "sys-apps/coreutils: /bin/hostname should be installed from coreutils not sys-apps/net-tools" status:UNCONFIRMED resolution: severity:enhancementΒ ...
Read more >5.1. Buildbot 2.10.5 ( 2021-04-05 )
5.1.1. Bug fixes . Fixed a race condition in log handling of RpmLint and WarningCountingShellCommand steps resulting in steps crashing occasionally.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tayloramurphy yeah that definitely seems like #6870 would be the culprit there.
Closing this issue as a dupe of that one.
@cjohnhanson it was in a DM. context i have: