Skip to content

Improve error message when start and rollack fails #781

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

Merged
merged 2 commits into from
Apr 7, 2025

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Apr 7, 2025

When pgroll fails to execute start phase of the migration, it runs rollback immediately. If rollback fails as well, the errors are joined. This made the error message hard to understand.

Previously, pgroll emitted this message:

Error: unable to execute start operation: pq: relation "qsdf" does not exist
pq: current transaction is aborted, commands ignored until end of transaction block

From now on, the message is clearer.

Error: unable to execute start operation of 'my_migration_name': pq: relation "qsdf" does not exist
unable to roll back failed operation: pq: current transaction is aborted, commands ignored until end of transaction block

If start fails but rollback succeeds, we emit a clearer error message:

Error: rolled back 'my_migration_name' because start command has failed: pq: relation "qsdf" does not exist

@github-actions github-actions bot temporarily deployed to Docs Preview April 7, 2025 11:00 Inactive
@kvch kvch force-pushed the fix-improve-rollback-error-message branch from b00f7f8 to b35c19e Compare April 7, 2025 11:05
@kvch kvch requested a review from exekias April 7, 2025 11:05
@github-actions github-actions bot temporarily deployed to Docs Preview April 7, 2025 11:05 Inactive
Co-authored-by: Carlos Pérez-Aradros Herce <exekias@gmail.com>
@kvch kvch enabled auto-merge (squash) April 7, 2025 14:04
@github-actions github-actions bot temporarily deployed to Docs Preview April 7, 2025 14:04 Inactive
@kvch kvch merged commit f39a9a0 into xataio:main Apr 7, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants