I have banged my head on this for 2 days now and i dint find any luck yet. Looking for help on this.
The issue:
Front End makes 10 similar XHR requests ( for different users ) to my Rails API and few of the requests randomly fails with 404 status code.
My Observations:
- If i make the same request again, It passes.
- I dont see any trace of 404 requests even hitting my server ( using logs ).
- I do see different response headers for 200 and 404 ( mentioned below ) and i see
cowboy
( https://github.com/heroku/cowboyku, https://github.com/heroku/vegur)server
for 404 requests. I run my rails production withthin
web server.
- I do see different response headers for 200 and 404 ( mentioned below ) and i see
My theory is that, As few of my requests are not able to hit my thin
server, they are getting 404. Now, the confusion is, Why is it hitting cowboy
[EDITS] response payload for 404 errors is something like below.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<title>No such app</title>
<style media="screen">
html,body,iframe {
margin: 0;
padding: 0;
}
html,body {
height: 100%;
overflow: hidden;
}
iframe {
width: 100%;
height: 100%;
border: 0;
}
</style>
</head>
<body>
<iframe src="//www.herokucdn.com/error-pages/no-such-app.html"></iframe>
</body>
</html>
来源:https://stackoverflow.com/questions/56977433/facing-intermittent-404-issue-when-calling-rails-api