R
Railway3mo ago
cerwind

Temporary CORS Errors when Deploying new Builds

Hi, I'm experiencing CORS HTTP errors for about 30-40 seconds between my frontend and backend application every time I deploy a Railway build and it resolves itself. My guess is servers are being switched over for a brief period of time the application isn't on the original domain (but shooting in the dark here) or it could be the Railway plan I'm on. It's a Django application and the error still persists even after CORS_ALLOW_ALL_ORIGINS = True. This isn't painful enough yet because I just ask my users to wait a couple of seconds but curious if anyone else has experienced this issue as I imagine as your user base grows this would become a bigger problem? Project ID: c61c1785-a8d8-43d0-9d8b-6bd1f69aa3bf
Solution:
Looks like your Web Server service is still on the Legacy proxy as opposed to the new and improved Edge Proxy, the new Edge Proxy provides improved switch over times compared to the Legacy proxy. Your service is also missing a health check and you are running migrations in the start command (that's fine) but it means Railway doesn't know when your application is actually ready to handle requests and will switch over while it's still running migrations. So to sum up, switch to the new Edge Proxy and add a health check, the switch over time will be greatly reduced but it won't be completely eliminated on account of you having a volume mounted since you can't mount a volume to two deployments at the same time....
Jump to solution
4 Replies
Percy
Percy3mo ago
Project ID: c61c1785-a8d8-43d0-9d8b-6bd1f69aa3bf
Solution
Brody
Brody3mo ago
Looks like your Web Server service is still on the Legacy proxy as opposed to the new and improved Edge Proxy, the new Edge Proxy provides improved switch over times compared to the Legacy proxy. Your service is also missing a health check and you are running migrations in the start command (that's fine) but it means Railway doesn't know when your application is actually ready to handle requests and will switch over while it's still running migrations. So to sum up, switch to the new Edge Proxy and add a health check, the switch over time will be greatly reduced but it won't be completely eliminated on account of you having a volume mounted since you can't mount a volume to two deployments at the same time.
cerwind
cerwind3mo ago
Thanks! I'll switch it over and look at how I can improve this wrt. the volume (the explanation really helps!)
Brody
Brody3mo ago
no problem!
Want results from more Discord servers?
Add your server