CORS Issue 502
cmaccarone
PROOP

a year ago

We are facing an issue where, intermittently as we are deploying, sometimes our clients are getting a 502 CORS issue. If we clear the cache and then refresh, the CORS issue disappears, Sometimes it disappears without clearing the cache too. Since this is a transient issue it seems to be railway related. Anyone else seeing this or have any ideas.

Solved

1 Replies

brody
EMPLOYEE

a year ago

Hello,

You say these 502 are when you redeploy, this leads me to recommend you to implement readiness based health checks because it sounds like we are directing traffic to your app before it's ready to handle requests.

Have an endpoint such as /health that will test every external service, Postgres, Redis, Facebook, Shopify, Stripe, Twillo, etc.

Only once your app can reach all external services then return a 200 status code.

Then configure that health endpoint in your service settings.

This way Railway knows when your app is actually ready to handle the incoming requests.

https://docs.railway.com/reference/healthchecks

https://docs.railway.com/guides/healthchecks-and-restarts

Hope this helps, but please let me know if you have anymore questions!

Best,
Brody


Status changed to Awaiting User Response Railway about 1 year ago


Railway
BOT

5 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 6 months ago


Loading...