2013-04-25 4 views
4

У меня возникли проблемы с загрузкой моего приложения на герою по какой-то причине, получение ошибки приложения при попытке посетить веб-сайт. Получение следующее сообщение об ошибке:NewRelic gem crashing app on heroku

/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/dynamic_matchers.rb:55:in `method_missing': undefined method `create_reflection' for #<Class:0x00000002cd3be0> 

Впервые она появилась, когда я добавил NewRelic камень, версия 3.6.0.83 и не фиксируется, когда обновлена ​​3.6.1.87. Проблема с удалением драгоценного камня устраняет проблему.

Вот полный трассировки стека:

2013-04-25T20:07:05.103138+00:00 heroku[slugc]: Slug compilation started 
2013-04-25T20:08:31.370750+00:00 heroku[api]: Release v30 created by [email protected] 
2013-04-25T20:08:31.416852+00:00 heroku[api]: Deploy cdebc45 by [email protected] 
2013-04-25T20:08:31.967790+00:00 heroku[deployhooks]: Notified New Relic about the deploy 
2013-04-25T20:08:32.438963+00:00 heroku[slugc]: Slug compilation finished 
2013-04-25T20:08:33.740669+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -R config.ru -e $RAILS_ENV -p 21046` 
2013-04-25T20:08:31.500921+00:00 heroku[web.1]: State changed from crashed to starting 
2013-04-25T20:08:37.882708+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2013-04-25T20:08:37.882708+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Starting the New Relic agent in "production" environment. 
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Reading configuration from config/newrelic.yml 
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] WARN : Agent is configured not to use SSL when communicating with New Relic's servers 
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Dispatcher: thin 
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Environment: production 
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : To prevent agent startup add a NEWRELIC_ENABLE=false environment variable or modify the "production" section of your newrelic.yml. 
2013-04-25T20:08:40.983660+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Installing Rails 3.1/3.2 view instrumentation 
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Application: quickies 
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Installing Rails 3 Controller instrumentation 
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Installing Net instrumentation 
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Installing ActiveRecord instrumentation 
2013-04-25T20:08:40.987527+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/associations/builder/belongs_to.rb:14:in `build' 
2013-04-25T20:08:40.987833+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:502:in `load_missing_constant' 
2013-04-25T20:08:40.987527+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/autosave_association.rb:139:in `build' 
2013-04-25T20:08:40.987527+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
2013-04-25T20:08:40.987527+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/associations.rb:1431:in `belongs_to' 
2013-04-25T20:08:40.987833+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:192:in `block in const_missing' 
2013-04-25T20:08:40.983660+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Installing Rails3 Error instrumentation 
2013-04-25T20:08:40.987527+00:00 app[web.1]: from /app/app/models/context.rb:1:in `<top (required)>' 
2013-04-25T20:08:40.983660+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:40 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Starting Agent shutdown 
2013-04-25T20:08:40.987527+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' 
2013-04-25T20:08:40.987833+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in `each' 
2013-04-25T20:08:40.987527+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/dynamic_matchers.rb:55:in `method_missing': undefined method `create_reflection' for #<Class:0x00000002cd3be0> (NoMethodError) 
2013-04-25T20:08:40.987833+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
2013-04-25T20:08:40.983660+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Finished instrumentation 
2013-04-25T20:08:40.987527+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/associations/builder/association.rb:12:in `build' 
2013-04-25T20:08:40.988073+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:260:in `safe_constantize' 
2013-04-25T20:08:40.987527+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/associations/builder/association.rb:25:in `build' 
2013-04-25T20:08:40.987833+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' 
2013-04-25T20:08:40.987833+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:230:in `block in constantize' 
2013-04-25T20:08:40.988307+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:359:in `require_or_load' 
2013-04-25T20:08:40.988528+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run' 
2013-04-25T20:08:40.987833+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in `const_missing' 
2013-04-25T20:08:40.988073+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' 
2013-04-25T20:08:40.988528+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec' 
2013-04-25T20:08:40.987833+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:229:in `constantize' 
2013-04-25T20:08:40.988073+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/railties/routes_helpers.rb:7:in `block (2 levels) in with' 
2013-04-25T20:08:40.988073+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/core_ext/string/inflections.rb:66:in `safe_constantize' 
2013-04-25T20:08:40.988073+00:00 app[web.1]: from /app/app/controllers/contexts_controller.rb:1:in `<top (required)>' 
2013-04-25T20:08:40.988073+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/params_wrapper.rb:152:in `_default_wrap_model' 
2013-04-25T20:08:40.988307+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
2013-04-25T20:08:40.988073+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/railties/paths.rb:7:in `block (2 levels) in with' 
2013-04-25T20:08:40.988073+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/params_wrapper.rb:169:in `_set_wrapper_defaults' 
2013-04-25T20:08:40.988073+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
2013-04-25T20:08:40.987527+00:00 app[web.1]: from /app/app/models/context.rb:6:in `<class:Context>' 
2013-04-25T20:08:40.987833+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:359:in `require_or_load' 
2013-04-25T20:08:40.988307+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' 
2013-04-25T20:08:40.988528+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!' 
2013-04-25T20:08:40.988749+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:181:in `load_rackup_config' 
2013-04-25T20:08:40.988968+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/bin/thin:6:in `<top (required)>' 
2013-04-25T20:08:40.988528+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing' 
2013-04-25T20:08:40.988749+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `load' 
2013-04-25T20:08:40.988749+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:187:in `run_command' 
2013-04-25T20:08:40.987833+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:229:in `each' 
2013-04-25T20:08:40.988307+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:225:in `require_dependency' 
2013-04-25T20:08:40.988528+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each' 
2013-04-25T20:08:40.988307+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:438:in `each' 
2013-04-25T20:08:40.988749+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval' 
2013-04-25T20:08:40.988968+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `<main>' 
2013-04-25T20:08:40.988307+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:436:in `each' 
2013-04-25T20:08:40.988749+00:00 app[web.1]: from config.ru:1:in `new' 
2013-04-25T20:08:40.988073+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/params_wrapper.rb:133:in `inherited' 
2013-04-25T20:08:40.988307+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!' 
2013-04-25T20:08:40.988528+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers' 
2013-04-25T20:08:40.988307+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:436:in `eager_load!' 
2013-04-25T20:08:40.988749+00:00 app[web.1]: from config.ru:1:in `<main>' 
2013-04-25T20:08:40.988307+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:438:in `block in eager_load!' 
2013-04-25T20:08:40.988749+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize' 
2013-04-25T20:08:40.988528+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>' 
2013-04-25T20:08:40.988749+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `eval' 
2013-04-25T20:08:40.988307+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:313:in `depend_on' 
2013-04-25T20:08:40.988528+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers' 
2013-04-25T20:08:40.988749+00:00 app[web.1]: from config.ru:3:in `block in <main>' 
2013-04-25T20:08:40.988528+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>' 
2013-04-25T20:08:40.988749+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:71:in `start' 
2013-04-25T20:08:40.988528+00:00 app[web.1]: from config.ru:3:in `require' 
2013-04-25T20:08:40.988968+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:152:in `run!' 
2013-04-25T20:08:40.988968+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `load' 
2013-04-25T20:08:42.284042+00:00 heroku[web.1]: Process exited with status 1 
2013-04-25T20:08:42.303661+00:00 heroku[web.1]: State changed from starting to crashed 
+0

Вы используете [NewRelic дополнение к Heroku] (https://addons.heroku.com/newrelic) или само по себе? Если вы используете голый драгоценный камень, может быть намного проще использовать надстройку. – jefflunt

+0

У меня есть добавление. Полагаю, вы не должны использовать их обоих вместе? – lobati

+0

Что странно, потому что документация предполагает, что они должны работать вместе: https://devcenter.heroku.com/articles/newrelic#standard-addon-installation – lobati

ответ

4

Я работаю в Нью-Relic. Я знаю, что это довольно старый, но я решил, что я бы ответил, если у других пользователей будет такая же проблема.

Ошибка, которую вы видите, выглядит как экземпляр проблемы, исправленной в версии 3.6.4 агента Ruby (см. this changelog entry).

Вкратце, основной причиной было вызванное нами состояние гонки, вызвавшее загрузку ActiveRecord::Base из фонового потока при создании отчета об окружающей среде, в которой выполнялось приложение. Исправление было связано с возвратом к предыдущему поведению создания этого отчет по основной теме.

+0

Прохладный, спасибо. Я попробую. – lobati

+0

Это исправлено. Благодаря! – lobati

0

Похоже, проблема заключается в app/app/models/context.rb

Из бревен:

2013-04-25T20:08:40.987527+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/dynamic_matchers.rb:55:in `method_missing': undefined method `create_reflection' for #<Class:0x00000002cd3be0> (NoMethodError)

+0

Интересно, есть ли у NewRelic класс, который сталкивается с моим собственным ... – lobati

Смежные вопросы