December 17, 2008 by alex
When Hoptoad came out we were really excited. No more hundreds or even thousands of emails in case of some server failure or gasp even a bug deployed to the production server. Instead a nice looking website with a clean list. Nice.
Within days we had switched all projects from exception_notifier to Hoptoad - and then that was it. Occasionally Hoptoad would send an email with an exception but most of the time it would be some crawler requesting an invalid URL so we read and forgot about it. The problem was that with Hoptoad to forget about those errors had become be really easy - too easy. So last week a client told me the signup form on our project was showing an error page and nobody had been able to sign up for days.
Wait. We are monitoring the app and get notified about every exception. Of course we did but over the months we had accumulated more than 50 exceptions in Hoptoad and nobody was really paying attention to that big pile of false alarms caused by some crawler anymore. So yes, we did miss that positive alarm.
As a consequence we spent the same day going through all our exceptions in all projects and killed them all.
A big part of the exception came from crawlers requesting non-existent actions and stuff like that. With Rails 2.2 this is relatively easy to fix. In our routes.rb we have declared most of our routes as restful resources:
Now the PostsController
does not implement the index
action but we do get requests on /posts from time to time which result in an Unknown Action exception. The solution is to remove the index
route:
In other cases we had to improve our guards on parameters a little. Passing an empty string for the page
parameter to a paginate
call seems to be a favorite pastime for the google crawler.
So, lessons learned: keep your exception inbox clean. Even if it’s just a bunch of bots.