Notifier troubleshooting

When reporting issues about the notifier, or about not seeing exceptions you expect to see in Airbrake, please be sure to include the following information in your tender report:

  • Rails version
  • Ruby version
  • List of plugins and gems in use (contents of /vendor/plugins and /vendor/gems will do nicely)

As of v1.2.0 the notifier now prints out some basic environment information along with the response from Airbrake in your project's log files. Make sure to check that as well if you're having problems with getting the notifier to work.

The rake airbrake:test task runs fine, but some of my exceptions aren't showing up in Airbrake.

There are a number of exceptions that are common enough that we explicitly do not send them to Airbrake at all. These include:

  • ActiveRecord::RecordNotFound
  • CGI::Session::CookieStore::TamperedWithCookie
  • ActionController::RoutingError
  • ActionController::InvalidAuthenticityToken
  • ActionController::UnknownAction

If you're running Rails 2.3.x, or any other rack-based system, then be sure you have the latest version of the notifier plugin. There was a known issue with prior versions of the plugin and rack clients.

I'm getting emails for some exceptions, but not for others. What gives?

There are a number of exceptions that are common enough that we explicitly do not send emails for them. They include:

  • ActiveRecord::RecordNotFound
  • CGI::Session::CookieStore::TamperedWithCookie
  • ActionController::InvalidAuthenticityToken
  • ActionController::RoutingError
  • ActionController::UnknownAction

The notifier also does not to send these to Airbrake by default (see question above), but can be configured to do so. Even if it does send these errors to Airbrake, emails for them are not sent out.

If your exception isn't on this list, then double check that you have checked "**Receive email notifications?**" on your profile page.

I don't see any error notifications from my development environment

Airbrake does not send notifications for the development and test environments. This allows you to test and develop locally without flooding your inbox with noisy false positives.

The airbrake:test rake task works fine on my production server, but not on my development or staging environment.

Running rake airbrake:test generates a real exception inside your rails application. The Airbrake Notifier plugin then catches that exception and sends it on to the Airbrake service. To ensure that Airbrake doesn't receive bogus exceptions, the Notifier only sends them along if it's running in production (well, if config.action_controller.consider_all_requests_local is false, to be more precise). This means that your development exception will get ignored.

To test that Airbrake is properly installed, you'll have to either run the test on staging or production, or convince your local rails application that it's running in production. You can do that by running export RAILS_ENV=production; rake Airbrake:test. You may need to take steps like creating a local production database in order to do the latter and changing config.action_controller.consider_all_requests_local.

I'm concerned with my application's performance in the event that Airbrake goes down.

We completely understand that concern, and have included configurable timeout settings into the notifier. You can specify the http_open_timeout and http_read_timeout values in your Airbrake.rb file:

AirbrakeNotifier.configure do |config|
  config.api_key = 'issekrit'
  config.http_open_timeout = 1 # defaults to 2 (seconds)
  config.http_read_timeout = 3 # defaults to 5 (seconds)

I'm using rescue_from in my controller, but now I don't see the exceptions in Airbrake. Whazzup with that?

Airbrake uses alias_method_chain to hook into the rescue_action_in_public method.

# Overrides the rescue_action method in ActionController::Base, but does not inhibit
# any custom processing that is defined with Rails 2's exception helpers.
def rescue_action_in_public_with_Airbrake exception
  notify_Airbrake(exception) unless ignore?(exception)

The rescue_from system in Rails actually catches the exceptions before rescue_action_in_public happens. The upshot is that if you want to see those exceptions in Airbrake, you'll need to explicitly send them along in your rescue_from method using notify_Airbrake(exception):

rescue_from SillyError, :with => :render_silly_error

def render_silly_error(e)
  render :template => 'i_blowzed_up'

Airbrake appears to be throwing "TypeError (can't dump anonymous class Class):"

This could be because Rack::Bug is installed, make sure to turn it off when in the production environment.

There's an open issue in the Rack::Bug project to attempt to resolve this.

Plugin not found: ["git://"]

This is due to a bug with Rails and Ruby1.9 when using script/plugin install. For now, you can do the following to resolve it from your Rails' app root to get the notifier installed:

git clone git:// vendor/plugins/Airbrake_notifier
rm -rf vendor/plugins/Airbrake_notifier/.git

Errors when submitting custom data through AirbrakeNotifier.notify

Make sure to check out the documentation in Submitting Errors to Airbrake. Also, here's an example gist of a YAML hash that Airbrake accepts that was generated by Sinatra: