Notifications working in production, but not in staging or development environments.
I'm running the airbrake-3.0.2 gem with Rails 3.2.5 and Ruby 1.8.7.
Aibrake seems to be collecting errors in my production environment, but I can't get it to do so in my staging or dev environments. (I want the latter so that I can be confident Airbrake is catching errors properly.)
The rake airbrake:test task works properly in all
environments.
config.action_controller.consider_all_requests_local
is set to false in all environments. I have reviewed the
troubleshooting guide and tried the suggestions there, to no
avail.
Errors in the dev environment produce a stack trace like this one:
HTTP_X:
CAUGHT A 500 ERROR AND RENDERING A 500
RuntimeError (Michael is awesome.):
app/controllers/home_controller.rb:13:in `index'
haml (2.2.3) lib/sass/plugin/rails.rb:19:in `process'
airbrake (3.0.2) [v] lib/airbrake/rack.rb:27:in `call'
airbrake (3.0.2) [v] lib/airbrake/user_informer.rb:12:in `call'
/Users/hoffm/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/Users/hoffm/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/Users/hoffm/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/Users/hoffm/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:162:in `start'
/Users/hoffm/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/Users/hoffm/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:95:in `start'
/Users/hoffm/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:92:in `each'
/Users/hoffm/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:92:in `start'
/Users/hoffm/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:23:in `start'
/Users/hoffm/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:82:in `start'
Airbrake seems to be consulted, but no notification is produced. Any idea what's going on here?
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Morgan on 12 Sep, 2012 11:44 PM
Hi,
Please try adding
To your config block in
config/initializers/airbrake.rbThat should enable logging for all environments.
Also We released airbrake gem version 3.1.4 which has more features and bug fixes.
That makes it a good time to run
bundle update airbrakePlease let me know how it goes!
From,
Morgan
Morgan closed this discussion on 12 Sep, 2012 11:44 PM.
Morgan re-opened this discussion on 12 Sep, 2012 11:44 PM
Support Staff 3 Posted by Morgan on 12 Sep, 2012 11:47 PM
Oops, 3.1.4 does not support your version of rails. Please disregard the upgrading message. :)
4 Posted by food52 on 13 Sep, 2012 02:01 PM
Hi, Morgan. This didn't seem to make a difference.
Here's my
config/initializers/airbrake.rb:Here's the trace:
5 Posted by food52 on 14 Sep, 2012 05:03 PM
It also appears that not all 500s are being captured by airbrake even in production, though as you can see by looking at my account, some are. I'd appreciate any guidance you might have.
6 Posted by food52 on 17 Sep, 2012 05:28 PM
Hey, Morgan, just wondering of you have any further guidance for me here. I'd love to get Airbrake up and running.
Support Staff 7 Posted by Morgan on 20 Sep, 2012 12:41 AM
Hi again!
Not all 500 errors will show up.
ActiveRecord::RecordNotFoundis ignored by default.you can see what errors are ignored by default by booting up the rails console for your environment and running
Airbrake.configuration.ignoreyou can also chose to report on every error if you set the following in yourconfig/initializers/airbrake.rbYou can customize the airbrake.rb in other ways as well.
By default these are ignored:
Please let me know if this does not clear things up. Happy to dive deeper into this if needed.
From,
Morgan
8 Posted by Michael Hoffman on 20 Sep, 2012 08:37 PM
Morgan, as you can see from the trace above, the intentional error I'm using for testing is a simple RuntimeError. This is caused by
raise "some string"in the application controller.I have also tested with other error types, being careful o avoid those in the ignored list.
Support Staff 9 Posted by Morgan on 24 Sep, 2012 02:21 AM
Hi Michael,
I found the last piece of this puzzle, to report upon 500 errors in the environments other than production you have to adjust 2 things:
1 add the following line in config/initializers/airbrake.rb
2 In config/environments/development.rb change config.consider_all_requests_local from true to false
I was able to replicate and solve the problem like this! Please confirm with me that it works for you as well!
From,
Morgan
10 Posted by Ryan on 18 Feb, 2013 07:34 PM
Hello, we are currently revisiting tickets that seem that have been resolved. If you have any further questions let us know. Send an Email to
[email blocked].
Thanks,
Ryan
Ryan closed this discussion on 18 Feb, 2013 07:34 PM.