-
Notifications
You must be signed in to change notification settings - Fork 429
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
After upgrade from v2.66.2 to 2.104.0 some POST calls fail when REPLICA_DATABASE_URLS is set #3681
Comments
When the error happens the api server logs:
There are no tracebacks in the logs corresponding to the times these internal server errors occur |
Was able to recreate this on v2.104.0 using a brand new blank DB (Aurora RDS/Postgres15) running 1 writer and 1 reader. Initially did not add REPLICA_DATABASE_URLS and was able to create a feature. Then added REPLICA_DATABASE_URLS and again received the Internal Server Error (and no tracebacks recorded). So appears to unrelated to any DB migrations from older flagsmith versions |
The env vars I'm setting in the flagsmith-api
|
As a test I actually set DATABASE_URL and REPLICA_DATABASE_URLS to both point to the same Aurora RDS writer instance (taking the reader instance out of the picture) and still get a 500 error from api server when trying to create a feature. So it seems just the fact that the REPLICA_DATABASE_URLS exists at all breaks it. Also, for point of reference, other things create just fine (orgs, projects, environments). Can also create a segment if a feature is already existing. But can't create new feature or if a feature exists a feature segment override. Both throw 500 from api server. |
Yeah that was my test yesterday as well. I followed the stack trace and it looks like the issue is pretty deep down in the internals of Django. An instance that was supposed to be present raised a |
Yeah, I am running into the same error, glad I found this. I can confirm once I remove the replica variable I am able to create a feature. |
@zachaysan and I have narrowed this issue down to this commit. More investigation needed to understand why... |
How are you running Flagsmith
Describe the bug
We use Aurora RDS/Postgres with one writer and one reader. We've been using REPLICA_DATABASE_URLS to split reads/writes between these 2 instances. After upgrading from v2.66.2 to v2.104.0, we've seen failing POSTS (both directly through the api and also the UI) that throw a 500 error. Things like creating feature, create segment override. When we don't set REPLICA_DATABASE_URLS, these all work just fine. Seems like some of the POSTS are not routing to the write instance.
Steps To Reproduce
Set REPLICA_DATABASE_URLS
Create environment
Try to create feature fails with 500 error
Expected behavior
Set REPLICA_DATABASE_URLS
Create environment
Try to create feature succeeds
Screenshots
No response
The text was updated successfully, but these errors were encountered: