1

When I do rake airbrake:test I get this exception on production. Errbit app hosts on heroku and does not recieving any messages from production. What the problem is?

Airbrake v 3.1.8

Errbit v - last from github

undefined method `method=' for #<BacktraceLine:0x00000005a0d160>

app/models/backtrace.rb:27:in `new'
app/models/backtrace.rb:27:in `block in raw='
app/models/backtrace.rb:26:in `each'
app/models/backtrace.rb:26:in `raw='
app/models/backtrace.rb:18:in `new'
app/models/backtrace.rb:18:in `find_or_create'
app/models/error_report.rb:33:in `backtrace'
app/models/error_report.rb:40:in `generate_notice!'
lib/overrides/hoptoad_notifier/hoptoad_notifier.rb:18:in `send_notice'
Meliborn
  • 6,495
  • 6
  • 34
  • 53
  • Please provide more information. What version of Airbrake and Errbit do you use? Post the full error message. – Substantial Apr 11 '13 at 11:40
  • updated, I don't think that is errbit problem, because production can't send notification to working errbit. – Meliborn Apr 11 '13 at 11:58
  • `hoptoad_notifier.rb` at the bottom of your stacktrace is an [Errbit file](https://github.com/errbit/errbit/tree/master/lib/overrides/hoptoad_notifier). Both `backtrace.rb` and `error_report.rb` models are also [Errbit files](https://github.com/errbit/errbit/tree/master/app/models). – Substantial Apr 11 '13 at 12:16
  • Hmmm, but production does not has an Errbit. Only airbrake gem. I'm confused. – Meliborn Apr 11 '13 at 12:42
  • What is the output of `bundle show | grep airbrake`? – Substantial Apr 11 '13 at 13:19

1 Answers1

1

This is a known issue in Errbit caused by a change in Airbrake after 3.1.8.

A fix was committed to an unnamed branch of Errbit 7 days ago (as of this writing).

Reinstall Errbit from the unnamed branch, or implement the changes manually. Or wait until the fix makes its way to the Errbit trunk, then upgrade per instructions in the Errbit readme.

Alternately, you can downgrade to an older version of Airbrake. Version 3.1.8 does not contain the breaking changes. I verified this by installing Airbrake 3.1.8 on my machine and inspecting the files. Put this in your Gemfile, then run bundle install:

gem "airbrake", "3.1.8"

Edit:

Since you are verifiably using a compatible version of Airbrake, look at Errbit.

In the current Errbit trunk, BacktraceLine#method= (source) is an interface provided by Mongoid. An undefined method error means Mongoid is not providing the method at runtime. You may have an initialization or configuration issue with Mongoid in your test environment.

Edit 2:

Turns out this error is caused by Errbit being installed without Mongoid, which Errbit requires.

Errbit overrides the Airbrake notifier gem with hooks back to Errbit, thus using Airbrake will inadvertently invoke Errbit. Without Mongoid, Errbit will fail.

Two solutions are available:

or...

  • Fully implement Errbit and use it.
Community
  • 1
  • 1
Substantial
  • 6,684
  • 2
  • 31
  • 40
  • Are you sure? What is the output of `bundle show | grep airbrake`? – Substantial Apr 11 '13 at 15:28
  • On production * airbrake (3.1.8) – Meliborn Apr 11 '13 at 16:00
  • enviroment on production or where errbit store? – Meliborn Apr 11 '13 at 16:23
  • Wherever the test is failing. – Substantial Apr 11 '13 at 16:43
  • On production. But it hasn't mongoid. What for? – Meliborn Apr 11 '13 at 16:45
  • **There's your problem:** no Mongoid. You have Errbit files installed that override Airbrake's default behavior to send errors to Errbit instead of Airbrake. **Remove all Errbit files** from your application if you won't be using it, otherwise it interferes with Airbrake's normal operation. Start a new question if you need help with that. – Substantial Apr 11 '13 at 17:01
  • Why I should remove errbit files from production if I should send errors to Errbit application on Heroku? And what you mean by errbit files? I have only one gem - airbrake. – Meliborn Apr 11 '13 at 17:04
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/28050/discussion-between-gg-s-and-meliborn) – Substantial Apr 11 '13 at 17:26