Deploy notification failing on Rails 2.3.14 / Ruby 1.8.7 #162

Closed
minter opened this Issue Dec 31, 2012 · 11 comments

Comments

Projects
None yet
4 participants

minter commented Dec 31, 2012

We're trying to use the deploy notification feature of airbrake in our Rails 2.3.14 app. In recent days, it's started failing.

If we use the capistrano method, we get this:

  * executing `airbrake:deploy'
 ** Notifying Airbrake of Deploy (cd /usr/www/teamsnap/current; bundle exec rake RAILS_ENV=staging airbrake:deploy TO=staging REVISION=414b535afda6d82a26687ce547408519a67b0cda
 ** REPO=git@github.com:teamsnap/teamsnap.git USER=minter)
  * executing "cd /usr/www/teamsnap/current; bundle exec rake RAILS_ENV=staging airbrake:deploy TO=staging REVISION=414b535afda6d82a26687ce547408519a67b0cda\\\n REPO=git@github.com:teamsnap/teamsnap.git USER=minter"
    servers: ["stage-web2.teamsnap.com"]
    [stage-web2.teamsnap.com] executing command
    command finished in 2031ms
failed: "sh -c 'cd /usr/www/teamsnap/current; bundle exec rake RAILS_ENV=staging airbrake:deploy TO=staging REVISION=414b535afda6d82a26687ce547408519a67b0cda\\\n REPO=git@github.com:teamsnap/teamsnap.git USER=minter'" on stage-web2.teamsnap.com

If we use the command line client, we get this:

minter:(git)teamsnap[master]/$ bundle exec airbrake deploy -k OUR_API_KEY
/Users/minter/.rvm/gems/ruby-1.8.7-p370@teamsnap/gems/airbrake-3.1.6/lib/airbrake/cli/runner.rb:1:in `require': /Users/minter/.rvm/gems/ruby-1.8.7-p370@teamsnap/gems/airbrake-3.1.6/lib/airbrake/cli/project_factory.rb:16: undefined (?...) sequence: /<name[^>]*>(?<name>.*?)<\/name>/ (SyntaxError)
/Users/minter/.rvm/gems/ruby-1.8.7-p370@teamsnap/gems/airbrake-3.1.6/lib/airbrake/cli/project_factory.rb:18: undefined (?...) sequence: /<id[^>]*>(?<id>.*?)<\/id>/
/Users/minter/.rvm/gems/ruby-1.8.7-p370@teamsnap/gems/airbrake-3.1.6/lib/airbrake/cli/project_factory.rb:20: undefined (?...) sequence: /<api-key[^>]*>(?<api_key>.*?)<\/api-key>/
    from /Users/minter/.rvm/gems/ruby-1.8.7-p370@teamsnap/gems/airbrake-3.1.6/lib/airbrake/cli/runner.rb:1
    from /Users/minter/.rvm/gems/ruby-1.8.7-p370@teamsnap/gems/airbrake-3.1.6/bin/airbrake:4:in `require'
    from /Users/minter/.rvm/gems/ruby-1.8.7-p370@teamsnap/gems/airbrake-3.1.6/bin/airbrake:4
    from /Users/minter/.rvm/gems/ruby-1.8.7-p370@teamsnap/bin/airbrake:19:in `load'
    from /Users/minter/.rvm/gems/ruby-1.8.7-p370@teamsnap/bin/airbrake:19
    from /Users/minter/.rvm/gems/ruby-1.8.7-p370@teamsnap/bin/ruby_noexec_wrapper:14

Any ideas?

Contributor

shime commented Jan 8, 2013

Hey @minter!

Thanks for reporting.

We were using named groups in the CLI regexes, which are not ruby 1.8.7 compatible. This should provide a fix for the executable.

Could you please provide some kind of stack trace for Capistrano, so we can fix that too?

shime was assigned Jan 8, 2013

Hi @shime. Capistrano ultimately runs the following rake command bundle exec rake RAILS_ENV=staging airbrake:deploy TO=staging REVISION=ed5ef3fc69cbdd241fdc54050457868415dad5c8. If done the same manually and included --trace for you. Please let me know if the below information helps.

** Invoke airbrake:deploy (first_time)
** Execute airbrake:deploy
rake aborted!
uninitialized constant ActionController
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:469:in `load_missing_constant'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:106:in `const_missing'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:118:in `const_missing'
/usr/www/teamsnap/current/config/initializers/airbrake.rb:3
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/airbrake-3.1.6/lib/airbrake.rb:79:in `configure'
/usr/www/teamsnap/current/config/initializers/airbrake.rb:1
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:171:in `load_without_new_constant_marking'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:171:in `load'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:171:in `load'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/airbrake-3.1.6/lib/airbrake/shared_tasks.rb:10
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/usr/www/teamsnap/shared/bundle/ruby/1.8/gems/rake-0.9.2.2/bin/rake:33
/usr/www/teamsnap/shared/bundle/ruby/1.8/bin/rake:19:in `load'
/usr/www/teamsnap/shared/bundle/ruby/1.8/bin/rake:19
Tasks: TOP => airbrake:deploy
Contributor

shime commented Jan 8, 2013

@semmons99 it helps! 😸

Thanks!

Looking into it right now...

Contributor

shime commented Jan 8, 2013

@semmons99 I'm unable to replicate this. Are you using the edge version from Github?

@shime: We're using airbrake v3.1.6

Contributor

shime commented Jan 8, 2013

@semmons99 Just tried with that too. No good. :/

Anything funky in airbrake.rb? Are you using Bundler?

What happens if you add:

require "action_controller"

on top of your airbrake.rb?

@shime: Below is our airbrake.rb. Looking at it now, it's obvious that ActionController must no longer be loaded at this point (same goes for Fog I tried that). What's strange (to me) is this works fine when we deploy our Rails 3.2 using Ruby 1.9.3-p0 code. Did the airbrake gem previously load the application? Should we be sending these as strings or something?

Airbrake.configure do |config|
  config.api_key = 'OUR_API_KEY'
  config.ignore << ActionController::UnknownHttpMethod
  config.ignore << Fog::Storage::Rackspace::NotFound
end

Oh, and yes we're using Bundler.

AaronH commented Jan 10, 2013

EDIT: I was confused by the secondary issue being listed here. Using the commit referenced at the top of this thread fixed the problem for us. Thanks!

I'm having this same issue with 2.3.15 and Airbrake 3.1.6. Our airbrake.rb has only the API key and nothing more. Failure occurs on deploy and when using the Airbrake command line tool. Manually calling the task with a rake air brake:deploy TO="production"... works properly.

One thing of I thought about was that we are using .rbenv locally with the global version of ruby being 1.9.3 while this project is running under 1.8.7. However, changing the global version to 1.8.7 and attempting to notify fails with the same error. So, I guess that's not it.

Contributor

shime commented Jan 11, 2013

@AaronH 👍

sorry about the mess, I've used regex grouping that works with Ruby 1.9 only. 💣

@shime: So I noticed on your wiki that you use strings instead of the Class/Module constants. My guess is the prior version had the app loaded before it was called and now it doesn't I've switched to strings and things work in 1.8.7 again.

Feel free to close this issue. 😄

Contributor

shime commented Jan 11, 2013

Closing. Sorry for not helping you more!

shime closed this Jan 11, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment