fix: Database migration race condition in docker with Redis#6296
Open
Walkablenormal wants to merge 4 commits intokeephq:mainfrom
Open
fix: Database migration race condition in docker with Redis#6296Walkablenormal wants to merge 4 commits intokeephq:mainfrom
Walkablenormal wants to merge 4 commits intokeephq:mainfrom
Conversation
Updated entrypoint.sh to run database migration and modified execution of the command. Signed-off-by: Walkablenormal <rubenvankomen@gmail.com>
Removed database migration call from server startup. Called separately on entrypoint Signed-off-by: Walkablenormal <rubenvankomen@gmail.com>
Signed-off-by: Walkablenormal <rubenvankomen@gmail.com>
Signed-off-by: Walkablenormal <rubenvankomen@gmail.com>
Contributor
Author
|
Hi, Even with the failing tests, this seems to be safe to merge. The E2E test and unit test failing seems to be unrelated to this PR. I'll take a look if I can fix these tests in a separate PR. EDIT: Fixed unit test in #6298, if you want, you can/may merge that first and check if this PR correctly runs the unit tests. @shahargl Can you look at this and merge please? |
This was referenced Apr 25, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #6294
📑 Description
As stated in issue #6294, when deploying in Docker with Redis a race condition is triggered which only allows for a little over 5 seconds for database migration until the API workers start, and try to query the database. In this PR, database migration is moved up and out of the workers. Now it will run before the workers start. The migrate_db() function handles if the user has set SKIP_DB_CREATION to true.
✅ Checks
ℹ Additional Information