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

fix: Prevent misinterpreting alembic migration errors as event loop errors #2879

Merged

Conversation

achimnol
Copy link
Member

@achimnol achimnol commented Sep 30, 2024

This PR removes the extra exception context to check if there is no event loop running when executing alembic migrations, which makes it often confusing whether the migration failure is from the event loop handling mistake or actual migration scripts.

Before:

INFO  [alembic.runtime.migration] Running upgrade 20218a73401b -> 1d42c726d8a3, Migrate container registry config storage from `Etcd` to `PostgreSQL`
Traceback (most recent call last):
  ...
RuntimeError: no running event loop

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  ...
asyncpg.exceptions.NotNullViolationError: column "registry_id" of relation "images" contains null values

After:

INFO  [alembic.runtime.migration] Running upgrade 20218a73401b -> 1d42c726d8a3, Migrate container registry config storage from `Etcd` to `PostgreSQL`
There is no container registries data to migrate in etcd.
Traceback (most recent call last):
  ...
asyncpg.exceptions.NotNullViolationError: column "registry_id" of relation "images" contains null values

Checklist: (if applicable)

  • Milestone metadata specifying the target backport version

@achimnol achimnol added this to the 23.09 milestone Sep 30, 2024
@achimnol achimnol added comp:manager Related to Manager component type:refactor Refactor codes or add tests. skip:changelog Make the action workflow to skip towncrier check labels Sep 30, 2024
@achimnol achimnol self-assigned this Sep 30, 2024
@achimnol achimnol added this pull request to the merge queue Sep 30, 2024
Merged via the queue into main with commit f50010c Sep 30, 2024
34 checks passed
@achimnol achimnol deleted the topic/prevent-misinterpreting-alembic-migration-errors branch September 30, 2024 22:40
lablup-octodog pushed a commit that referenced this pull request Sep 30, 2024
…rrors (#2879)

Backported-from: main (24.09)
Backported-to: 23.09
Backport-of: 2879
lablup-octodog pushed a commit that referenced this pull request Sep 30, 2024
…rrors (#2879)

Backported-from: main (24.09)
Backported-to: 24.03
Backport-of: 2879
github-merge-queue bot pushed a commit that referenced this pull request Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:manager Related to Manager component skip:changelog Make the action workflow to skip towncrier check type:refactor Refactor codes or add tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant