Skip to content

Instantly share code, notes, and snippets.

@rromanchuk
Created December 9, 2011 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rromanchuk/1453178 to your computer and use it in GitHub Desktop.
Save rromanchuk/1453178 to your computer and use it in GitHub Desktop.
Stack level too deep calling Mailer inside rails runner/eventmachine due to super recursion
rdb:1) where
--> #0 AbstractController::Rendering.initialize
at line /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:73
#1 AbstractController::Layouts.initialize
at line /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/layouts.rb:301
#2 ActionDispatch::Routing::UrlFor.initialize
at line /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/action_dispatch/routing/url_for.rb:103
#3 AbstractController::Rendering.initialize
at line /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:75
#4 AbstractController::Layouts.initialize
at line /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/layouts.rb:301
#5 ActionDispatch::Routing::UrlFor.initialize
at line /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/action_dispatch/routing/url_for.rb:103
#6 AbstractController::Rendering.initialize
at line /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:75
#7 AbstractController::Layouts.initialize
at line /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/layouts.rb:301
#8 ActionDispatch::Routing::UrlFor.initialize
at line /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/action_dispatch/routing/url_for.rb:103
#9 AbstractController::Rendering.initialize
at line /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:75
#10 AbstractController::Layouts.initialize
at line /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/layouts.rb:301
#11 ActionDispatch::Routing::UrlFor.initialize
at line /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/action_dispatch/routing/url_for.rb:103
#12 ActionMailer::Base.initialize
at line /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionmailer-3.1.3/lib/action_mailer/base.rb:467
#13 ActionMailer::Base.method_missing(method#Symbol)
at line /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionmailer-3.1.3/lib/action_mailer/base.rb:456
#14 Lot.close! at line /Users/ryan/dev/auction/app/models/lot.rb:128
/Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:73
puts "in initializer of of abstract module"
(rdb:1) l
[68, 77] in /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb
68 def view_context_class
69 @_view_context_class || self.class.view_context_class
70 end
71
72 def initialize(*)
=> 73 puts "in initializer of of abstract module"
74 @_view_context_class = nil
75 super
76 puts "after super in initialize"
77 end
(rdb:1) s
in initializer of of abstract module
/Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:74
@_view_context_class = nil
(rdb:1) l
[69, 78] in /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb
69 @_view_context_class || self.class.view_context_class
70 end
71
72 def initialize(*)
73 puts "in initializer of of abstract module"
=> 74 @_view_context_class = nil
75 super
76 puts "after super in initialize"
77 end
78
(rdb:1) s
/Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:75
super
(rdb:1) l
[70, 79] in /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb
70 end
71
72 def initialize(*)
73 puts "in initializer of of abstract module"
74 @_view_context_class = nil
=> 75 super
76 puts "after super in initialize"
77 end
78
79 # An instance of a view class. The default view class is ActionView::Base
(rdb:1) s
/Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/action_dispatch/routing/url_for.rb:102
@_routes = nil
(rdb:1) l
[97, 106] in /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/action_dispatch/routing/url_for.rb
97 self.default_url_options = {}
98 end
99 end
100
101 def initialize(*)
=> 102 @_routes = nil
103 super
104 end
105
106 def url_options
(rdb:1) s
/Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/action_dispatch/routing/url_for.rb:103
super
(rdb:1) l
[98, 107] in /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/action_dispatch/routing/url_for.rb
98 end
99 end
100
101 def initialize(*)
102 @_routes = nil
=> 103 super
104 end
105
106 def url_options
107 default_url_options
(rdb:1) s
/Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/layouts.rb:300
@_action_has_layout = true
(rdb:1) l
[295, 304] in /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/layouts.rb
295 end
296
297 attr_internal_writer :action_has_layout
298
299 def initialize(*)
=> 300 @_action_has_layout = true
301 super
302 end
303
304 def action_has_layout?
(rdb:1) s
/Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/layouts.rb:301
super
(rdb:1) l
[296, 305] in /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/layouts.rb
296
297 attr_internal_writer :action_has_layout
298
299 def initialize(*)
300 @_action_has_layout = true
=> 301 super
302 end
303
304 def action_has_layout?
305 @_action_has_layout
(rdb:1) s
/Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb:73
puts "in initializer of of abstract module"
(rdb:1) l
[68, 77] in /Users/ryan/.rvm/gems/ruby-1.9.3-p0@r311/gems/actionpack-3.1.3/lib/abstract_controller/rendering.rb
68 def view_context_class
69 @_view_context_class || self.class.view_context_class
70 end
71
72 def initialize(*)
=> 73 puts "in initializer of of abstract module"
74 @_view_context_class = nil
75 super
76 puts "after super in initialize"
77 end
(rdb:1)
@jormon
Copy link

jormon commented Dec 16, 2011

Hey, I've been banging my head against the same error (but different path to it) for a while. Is this posted in a bug somewhere / have you found a solution?

TIA

@rromanchuk
Copy link
Author

I actually did figure it out :) Inside of a rails runner i was including include Rails.application.routes.url_helpers which was causing this bad recursion. I stopped investigating to exactly 'why' this was the case after i figured it out. It definitely involves Rails.application.routes.url_helpers though. Let me know if you have a similar situation.

@jormon
Copy link

jormon commented Dec 19, 2011

likewise, I included the same file in a test to get the 'url_for' function and it just borked everything. taking out the include and refactoring the test to not use url_for fixed everything. thanks!

@rromanchuk
Copy link
Author

glad you were able to find this, i was pulling my hair out for the longest time

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