2013-04-25 49 views
4

我無法讓我的應用程序在某些情況下啓動,因爲某些原因,當我嘗試訪問該網站時出現應用程序錯誤。收到以下錯誤:heroku上的NewRelic gem crashing應用程序

/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 2013-04-25 20:55:34

+0

我有附加。我收集你不應該把它們兩個都用在一起? – lobati 2013-04-26 05:36:37

+0

這很奇怪,因爲文檔建議他們應該一起工作:https://devcenter.heroku.com/articles/newrelic#standard-addon-installation – lobati 2013-04-26 05:38:19

回答

4

我在New Relic的工作。我知道這是相當古老的,但我想我會迴應,以防其他用戶遇到同樣的問題。

您看到的錯誤看起來像是我們在Ruby代理的3.6.4版中修復的問題的一個實例(請參閱this changelog entry)。

簡單地說,根本原因是我們造成的競爭條件生成有關應用程序在運行的環境報告時,從後臺線程觸發ActiveRecord::Base負載。倫敦定盤恢復到我們之前產生這種行爲報告主線程。

+0

很酷,謝謝。我會試一試。 – lobati 2013-07-18 22:17:32

+0

修復了它。謝謝! – lobati 2013-09-13 02:13:36

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 2013-06-14 21:09:44

相關問題