Repository navigation
fix: Exit with code 1 when the maintenance role fails to apply migrations - #5719
Merged
FXschwartz merged 1 commit intoSep 17, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Running
--role maintenance --apply-migrationsexited with code 0 after a failed migration in every run mode exceptdevelopment, so CI jobs passed and deployed against an unmigrated database. #3852 made the exit on a failed integrity check development-only to keep running servers up, but the condition ignored the role and took the exit code away from the maintenance role, which has no other way to report the result.--apply-migrationsor--apply-repair-migrationnow sets the exit code to 1 when applying fails or the database doesn't match the target state afterward.developmentthey log the failure and keep starting.ExitException.Closes #5709
Docs PR - serverpod/serverpod_docs#851
Pre-launch Checklist
///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.If you need help, consider asking for advice on the discussion board.
Breaking changes
None