Search code examples
phplaravelherokuhttp-status-code-503

Heroku H18 503 "Request Interrupted" errors


I see quite a few of these. I understand what they mean, which is why I can't understand why it is happening. Is very inconsistent, and does not appear to be a timeout issue.

Relevant stuff:

  • Php/laravel/Postgres Heroku
  • I force SSL
  • I route / to /anotherroute
  • I can't replicate with any client myself
  • The route is not always the same, sometimes a simple load of an asset
  • I have seen no application errors reported
  • sock=client
  • The service time is always < 1 second

Some log data:

Oct 29 18:22:12 myapp-web-production heroku/router: sock=client at=error code=H18 desc="Request Interrupted" method=GET path="/aroute" host=... request_id=... fwd="##.##.##.###" dyno=web.1 connect=2ms service=34ms status=503 bytes=3816

Oct 29 18:22:13 myapp-web-production heroku/router: sock=client at=error code=H18 desc="Request Interrupted" method=GET path="/aroute" host=... request_id=... fwd="##.##.##.###" dyno=web.1 connect=1ms service=538ms status=503 bytes=3822

Oct 29 18:22:14 myapp-web-production heroku/router: sock=client at=error code=H18 desc="Request Interrupted" method=GET path="/aroute" host=... request_id=... fwd="##.##.##.###" dyno=web.1 connect=1ms service=406ms status=503 bytes=13927

I'm stuck. Any help would be appreciated.


Solution

  • I take the sock=client attribute to mean that the client is just disconnecting before the server can respond. We can reproduce this by adding an artificial 10s delay to the handler and then, for example, requesting the endpoint in a web browser and closing it before the server can respond.

    We just filter all H18s with sock=client out of our logs.