Intermittent V8::JSError: private method `open' called for nil:NilClass when rendering handlebars templates

71 views
Skip to first unread message

Justin Ip

unread,
Apr 25, 2012, 9:01:22 PM4/25/12
to The Ruby Racer
I'm receiving the weird error below in production (nginx / unicorn)
very intermittently (a few times a day out of several hundred thousand
requests). Refreshing the page fixes it, but I'd like to try to get
the bottom of it. Any help is very much appreciated!

V8::JSError: private method `open' called for nil:NilClass when
rendering handlebars templates

----

[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/environment.rb:28:in
`new_object'
[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/module.rb:10:in
`initialize'
[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/environment.rb:17:in `new'
[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/environment.rb:17:in
`require'
[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/module.rb:18:in `block in
require_function'
:
[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/environment.rb:18:in
`require'
[GEM_ROOT]/gems/handlebars-0.3.1/lib/handlebars/context.rb:20:in
`block in initialize'
[GEM_ROOT]/gems/handlebars-0.3.1/lib/handlebars/context.rb:19:in
`each'
[GEM_ROOT]/gems/handlebars-0.3.1/lib/handlebars/context.rb:19:in
`initialize'
app/assets/templates/feeds/_trail_review.hbs:1:in `new'
app/assets/templates/feeds/_trail_review.hbs:1:in
`_app_assets_templates_feeds__trail_review_hbs___706614882_120756020'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/template.rb:171:in
`block in render'

Charles Lowell

unread,
Apr 26, 2012, 12:06:53 PM4/26/12
to therub...@googlegroups.com
On Apr 25, 2012, at 8:01 PM, Justin Ip wrote:

I'm receiving the weird error below in production (nginx / unicorn)
very intermittently (a few times a day out of several hundred thousand
requests). Refreshing the page fixes it, but I'd like to try to get
the bottom of it. Any help is very much appreciated!

V8::JSError: private method `open' called for nil:NilClass when
rendering handlebars templates


This is strange. Can you get the full backtrace without any cleaners applied?

Also, which handelbars template handler are you using? This one?


cheers,
Charles


----

[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/environment.rb:28:in
`new_object'
[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/module.rb:10:in
`initialize'
[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/environment.rb:17:in `new'
[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/environment.rb:17:in
`require'
[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/module.rb:18:in `block in
require_function'
:
[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/environment.rb:18:in
`require'
[GEM_ROOT]/gems/handlebars-0.3.1/lib/handlebars/context.rb:20:in
`block in initialize'
[GEM_ROOT]/gems/handlebars-0.3.1/lib/handlebars/context.rb:19:in
`each'
[GEM_ROOT]/gems/handlebars-0.3.1/lib/handlebars/context.rb:19:in
`initialize'
app/assets/templates/feeds/_trail_review.hbs:1:in `new'
app/assets/templates/feeds/_trail_review.hbs:1:in
`_app_assets_templates_feeds__trail_review_hbs___706614882_120756020'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/template.rb:171:in
`block in render'

Charles Lowell 
thefrontside.net | twitter: @cowboyd | github: cowboyd




Justin Ip

unread,
Apr 27, 2012, 2:18:07 AM4/27/12
to The Ruby Racer
I'm using https://github.com/cowboyd/handlebars.rb

Here's the full airbrake trace:
[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/environment.rb:28:in
`new_object'
[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/module.rb:10:in
`initialize'
[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/environment.rb:17:in `new'
[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/environment.rb:17:in
`require'
[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/module.rb:18:in `block in
require_function'
:
[GEM_ROOT]/gems/commonjs-0.2.6/lib/commonjs/environment.rb:18:in
`require'
[GEM_ROOT]/gems/handlebars-0.3.1/lib/handlebars/context.rb:20:in
`block in initialize'
[GEM_ROOT]/gems/handlebars-0.3.1/lib/handlebars/context.rb:19:in
`each'
[GEM_ROOT]/gems/handlebars-0.3.1/lib/handlebars/context.rb:19:in
`initialize'
app/assets/templates/status_updates/_status_update_item.hbs:1:in `new'
app/assets/templates/status_updates/_status_update_item.hbs:1:in
`_app_assets_templates_status_updates__status_update_item_hbs__651180844_112971550'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/template.rb:171:in
`block in render'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/
notifications.rb:55:in `instrument'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/template.rb:169:in
`render'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/
partial_renderer.rb:256:in `render_partial'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/
partial_renderer.rb:228:in `block (2 levels) in render'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/
abstract_renderer.rb:33:in `block in instrument'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/
notifications.rb:53:in `block in instrument'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/notifications/
instrumenter.rb:21:in `instrument'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/
notifications.rb:53:in `instrument'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/
abstract_renderer.rb:33:in `instrument'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/
partial_renderer.rb:227:in `block in render'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/
abstract_renderer.rb:22:in `wrap_formats'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/
partial_renderer.rb:219:in `render'
[GEM_ROOT]/gems/newrelic_rpm-3.3.4.1/lib/new_relic/agent/
instrumentation/rails3/action_controller.rb:172:in `block in
render_with_newrelic'
[GEM_ROOT]/gems/newrelic_rpm-3.3.4.1/lib/new_relic/agent/
method_tracer.rb:242:in `trace_execution_scoped'
[GEM_ROOT]/gems/newrelic_rpm-3.3.4.1/lib/new_relic/agent/
instrumentation/rails3/action_controller.rb:171:in
`render_with_newrelic'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/renderer.rb:
41:in `render_partial'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/renderer.rb:
15:in `render'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/helpers/
rendering_helper.rb:24:in `render'
app/views/users/profiles/show.html.erb:107:in `block in
_app_views_users_profiles_show_html_erb__662199917_97957070'
[GEM_ROOT]/gems/activerecord-3.1.3/lib/active_record/relation.rb:15:in
`each'
[GEM_ROOT]/gems/activerecord-3.1.3/lib/active_record/relation.rb:15:in
`each'
app/views/users/profiles/show.html.erb:106:in
`_app_views_users_profiles_show_html_erb__662199917_97957070'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/template.rb:171:in
`block in render'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/
notifications.rb:55:in `instrument'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/template.rb:169:in
`render'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/
template_renderer.rb:40:in `block (2 levels) in render_template'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/
abstract_renderer.rb:33:in `block in instrument'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/
notifications.rb:53:in `block in instrument'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/notifications/
instrumenter.rb:21:in `instrument'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/
notifications.rb:53:in `instrument'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/
abstract_renderer.rb:33:in `instrument'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/
template_renderer.rb:39:in `block in render_template'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/
template_renderer.rb:47:in `render_with_layout'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/
template_renderer.rb:38:in `render_template'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/
template_renderer.rb:12:in `block in render'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/
abstract_renderer.rb:22:in `wrap_formats'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/
template_renderer.rb:9:in `render'
[GEM_ROOT]/gems/newrelic_rpm-3.3.4.1/lib/new_relic/agent/
instrumentation/rails3/action_controller.rb:156:in `block in
render_with_newrelic'
[GEM_ROOT]/gems/newrelic_rpm-3.3.4.1/lib/new_relic/agent/
method_tracer.rb:242:in `trace_execution_scoped'
[GEM_ROOT]/gems/newrelic_rpm-3.3.4.1/lib/new_relic/agent/
instrumentation/rails3/action_controller.rb:155:in
`render_with_newrelic'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/renderer.rb:
36:in `render_template'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_view/renderer/renderer.rb:
17:in `render'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:
120:in `_render_template'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_controller/metal/
streaming.rb:250:in `_render_template'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:
114:in `render_to_body'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_controller/metal/
renderers.rb:30:in `render_to_body'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_controller/metal/
compatibility.rb:43:in `render_to_body'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:
99:in `render'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_controller/metal/
rendering.rb:16:in `render'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_controller/metal/
instrumentation.rb:40:in `block (2 levels) in render'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/core_ext/
benchmark.rb:5:in `block in ms'
/usr/local/rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/benchmark.rb:
295:in `realtime'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/core_ext/
benchmark.rb:5:in `ms'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_controller/metal/
instrumentation.rb:40:in `block in render'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_controller/metal/
instrumentation.rb:78:in `cleanup_view_runtime'
[GEM_ROOT]/gems/activerecord-3.1.3/lib/active_record/railties/
controller_runtime.rb:24:in `cleanup_view_runtime'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_controller/metal/
instrumentation.rb:39:in `render'
app/controllers/users_controller.rb:32:in `show'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_controller/metal/
implicit_render.rb:4:in `send_action'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/abstract_controller/base.rb:
167:in `process_action'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_controller/metal/
rendering.rb:10:in `process_action'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/abstract_controller/callbacks.rb:
18:in `block in process_action'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/callbacks.rb:
461:in `_run__645882025__process_action__710930771__callbacks'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/callbacks.rb:
386:in `_run_process_action_callbacks'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/callbacks.rb:
81:in `run_callbacks'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/abstract_controller/callbacks.rb:
17:in `process_action'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_controller/metal/rescue.rb:
17:in `process_action'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_controller/metal/
instrumentation.rb:30:in `block in process_action'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/
notifications.rb:53:in `block in instrument'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/notifications/
instrumenter.rb:21:in `instrument'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/
notifications.rb:53:in `instrument'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_controller/metal/
instrumentation.rb:29:in `process_action'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_controller/metal/
params_wrapper.rb:201:in `process_action'
[GEM_ROOT]/gems/activerecord-3.1.3/lib/active_record/railties/
controller_runtime.rb:18:in `process_action'
[GEM_ROOT]/gems/newrelic_rpm-3.3.4.1/lib/new_relic/agent/
instrumentation/rails3/action_controller.rb:34:in `block in
process_action'
[GEM_ROOT]/gems/newrelic_rpm-3.3.4.1/lib/new_relic/agent/
instrumentation/controller_instrumentation.rb:255:in `block in
perform_action_with_newrelic_trace'
[GEM_ROOT]/gems/newrelic_rpm-3.3.4.1/lib/new_relic/agent/
method_tracer.rb:242:in `trace_execution_scoped'
[GEM_ROOT]/gems/newrelic_rpm-3.3.4.1/lib/new_relic/agent/
instrumentation/controller_instrumentation.rb:250:in
`perform_action_with_newrelic_trace'
[GEM_ROOT]/gems/newrelic_rpm-3.3.4.1/lib/new_relic/agent/
instrumentation/rails3/action_controller.rb:33:in `process_action'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/abstract_controller/base.rb:
121:in `process'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:
45:in `process'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_controller/metal.rb:193:in
`dispatch'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_controller/metal/
rack_delegation.rb:14:in `dispatch'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_controller/metal.rb:236:in
`block in action'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_dispatch/routing/
route_set.rb:65:in `call'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_dispatch/routing/
route_set.rb:65:in `dispatch'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_dispatch/routing/
route_set.rb:29:in `call'
[GEM_ROOT]/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:152:in
`block in call'
[GEM_ROOT]/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:
96:in `block in recognize'
[GEM_ROOT]/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:
173:in `optimized_each'
[GEM_ROOT]/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:
95:in `recognize'
[GEM_ROOT]/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:141:in
`call'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_dispatch/routing/
route_set.rb:532:in `call'
[GEM_ROOT]/gems/omniauth-1.0.3/lib/omniauth/strategy.rb:168:in `call!'
[GEM_ROOT]/gems/omniauth-1.0.3/lib/omniauth/strategy.rb:148:in `call'
[GEM_ROOT]/gems/omniauth-1.0.3/lib/omniauth/strategy.rb:168:in `call!'
[GEM_ROOT]/gems/omniauth-1.0.3/lib/omniauth/strategy.rb:148:in `call'
[GEM_ROOT]/gems/omniauth-1.0.3/lib/omniauth/builder.rb:42:in `call'
[GEM_ROOT]/gems/newrelic_rpm-3.3.4.1/lib/new_relic/rack/
browser_monitoring.rb:23:in `call'
[GEM_ROOT]/gems/barista-1.2.1/lib/barista/server.rb:33:in `call'
[GEM_ROOT]/gems/rack-ssl-enforcer-0.2.4/lib/rack/ssl-enforcer.rb:41:in
`call'
[GEM_ROOT]/gems/warden-1.1.1/lib/warden/manager.rb:35:in `block in
call'
[GEM_ROOT]/gems/warden-1.1.1/lib/warden/manager.rb:34:in `catch'
[GEM_ROOT]/gems/warden-1.1.1/lib/warden/manager.rb:34:in `call'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_dispatch/middleware/
best_standards_support.rb:17:in `call'
[GEM_ROOT]/gems/rack-1.3.6/lib/rack/etag.rb:23:in `call'
[GEM_ROOT]/gems/rack-1.3.6/lib/rack/conditionalget.rb:25:in `call'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_dispatch/middleware/
head.rb:14:in `call'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_dispatch/middleware/
params_parser.rb:21:in `call'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_dispatch/middleware/
flash.rb:247:in `call'
[GEM_ROOT]/gems/rack-1.3.6/lib/rack/session/abstract/id.rb:195:in
`context'
[GEM_ROOT]/gems/rack-1.3.6/lib/rack/session/abstract/id.rb:190:in
`call'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_dispatch/middleware/
cookies.rb:331:in `call'
[GEM_ROOT]/gems/activerecord-3.1.3/lib/active_record/query_cache.rb:
64:in `call'
[GEM_ROOT]/gems/activerecord-3.1.3/lib/active_record/
connection_adapters/abstract/connection_pool.rb:477:in `call'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_dispatch/middleware/
callbacks.rb:29:in `block in call'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/callbacks.rb:
392:in `_run_call_callbacks'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/callbacks.rb:
81:in `run_callbacks'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_dispatch/middleware/
callbacks.rb:28:in `call'
[GEM_ROOT]/gems/rack-1.3.6/lib/rack/sendfile.rb:101:in `call'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_dispatch/middleware/
remote_ip.rb:48:in `call'
[GEM_ROOT]/gems/actionpack-3.1.3/lib/action_dispatch/middleware/
show_exceptions.rb:47:in `call'
[GEM_ROOT]/gems/railties-3.1.3/lib/rails/rack/logger.rb:13:in `call'
[GEM_ROOT]/gems/rack-1.3.6/lib/rack/methodoverride.rb:24:in `call'
[GEM_ROOT]/gems/rack-1.3.6/lib/rack/runtime.rb:17:in `call'
[GEM_ROOT]/gems/activesupport-3.1.3/lib/active_support/cache/strategy/
local_cache.rb:72:in `call'
[GEM_ROOT]/gems/rack-1.3.6/lib/rack/lock.rb:15:in `call'
[GEM_ROOT]/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in
`forward'
[GEM_ROOT]/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in
`fetch'
[GEM_ROOT]/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in
`lookup'
[GEM_ROOT]/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
[GEM_ROOT]/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
[GEM_ROOT]/gems/railties-3.1.3/lib/rails/engine.rb:456:in `call'
[GEM_ROOT]/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in
`method_missing'
[GEM_ROOT]/gems/unicorn-4.3.0/lib/unicorn/http_server.rb:530:in
`process_client'
[GEM_ROOT]/gems/unicorn-4.3.0/lib/unicorn/http_server.rb:605:in
`worker_loop'
[GEM_ROOT]/gems/newrelic_rpm-3.3.4.1/lib/new_relic/agent/
instrumentation/unicorn_instrumentation.rb:17:in `call'
[GEM_ROOT]/gems/newrelic_rpm-3.3.4.1/lib/new_relic/agent/
instrumentation/unicorn_instrumentation.rb:17:in `block (4 levels) in
<top (required)>'
[GEM_ROOT]/gems/unicorn-4.3.0/lib/unicorn/http_server.rb:487:in
`spawn_missing_workers'
[GEM_ROOT]/gems/unicorn-4.3.0/lib/unicorn/http_server.rb:498:in
`maintain_worker_count'
[GEM_ROOT]/gems/unicorn-4.3.0/lib/unicorn/http_server.rb:272:in `join'
[GEM_ROOT]/gems/unicorn-4.3.0/bin/unicorn:121:in `<top
(required)>'
bin/unicorn:16:in `load'
bin/unicorn:16:in `<main>'
Reply all
Reply to author
Forward
0 new messages