We're seeing quite a lot of Error H18 (Request Interrupted) in the logs. How should these be interpreted, since sock=client in all cases I assume that it is the client that is disconnecting. Should it therefore be safe to ignore these?
Simply use heroku logs to display the last 100 lines of your logs. Heroku only saves the last 1500 lines of logs, which you can access using heroku logs -n 1500 . If you want more logging, check out Heroku add-ons like Logentries or Papertrail.
There are some errors which only occur when the app is rebooting so you will need to restart the app to see these log messages appear. For most apps, we also recommend enabling one of the free logging addons from https://elements.heroku.com/addons#logging to make sure that your historical log data is being saved.
This typically indicates either that the user's network was disconnected (e.g. this happens with some frequency for mobile users) or the end-user closed their browser or similar (e.g. pressed Stop, went to a different page, etc).
You can safely ignore those that are tagged as being client-end in nature with "sock=client", but might want to investigate those that are being closed by the Server end ("sock=server").
Edit (Aug 10, 2015): My answer below for H18 errors is out of date. Heroku has changed the behavior of H18 errors making them more specific (and serious) than before. This Answer is now more correct.
I recently asked Heroku support about a significant number of H18 errors (3-4 an hour sometimes) my app was receiving and being surfaced in the Metrics section of the new Heroku dashboard (screenshot above). I referenced catsby's response on this thread and asked to confirm if they were in fact not actionable. This was the response I received from Heroku Support:
I just went through the last 24 hours of H18s on your app. They are all sock=client and looking at the User-Agent I see a lot of the usual culprits. Mobile browsers for the most part and also the latest Chrome which I have seen other apps have issue with as well since a few days ago. Unless you see a pattern such as for a particular URL or user then it often is just network issues.
[That these H18 errors are] Not actionable is not always true. Some apps do care about it, and sometimes it can also mean a client crash rather than a network error. Browsers do crash from time to time but in particular mobile browsers can be pretty fragile. If an app uses a lot of assets and triggers "page not responding" errors you might see spikes in H18s. In that case sometimes there is something you can do about it. Other apps are serviced entirely in wired networks and would never expect it, in that case there could be a faulty switch or firewall. For the sake of transparency we still want to report these errors as there is no way to tell if they are or aren't actionable.
To summarize, most of the time you can ignore them if they are sock=client
errors, but that does indicate that clients are disconnecting which could indicate a real issue depending on how your application is networked to its clients (e.g. mobile or really bad network connection)... but probably you can safely ignore them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With