wicked_pdf: Problem upgrading to 1.2.0
After upgrading from 1.1.0 to 1.2.0 all requests to the rails app fail. The system seems to go into an infinite loop when trying to render the page. The log shows
FATAL Rails :
SystemStackError (stack level too deep):
wicked_pdf (1.2.0) lib/wicked_pdf/pdf_helper.rb:30:in render' wicked_pdf (1.2.0) lib/wicked_pdf/pdf_helper.rb:43:in
render_with_wicked_pdf’
… (this goes on and on)…
wicked_pdf (1.2.0) lib/wicked_pdf/pdf_helper.rb:30:in render' wicked_pdf (1.2.0) lib/wicked_pdf/pdf_helper.rb:43:in
render_with_wicked_pdf’
wicked_pdf (1.2.0) lib/wicked_pdf/pdf_helper.rb:30:in render' wicked_pdf (1.2.0) lib/wicked_pdf/pdf_helper.rb:43:in
render_with_wicked_pdf’
wicked_pdf (1.2.0) lib/wicked_pdf/pdf_helper.rb:30:in render' wicked_pdf (1.2.0) lib/wicked_pdf/pdf_helper.rb:43:in
render_with_wicked_pdf’
actionpack (4.2.11.1) lib/action_controller/metal/implicit_render.rb:10:in default_render' actionpack (4.2.11.1) lib/action_controller/metal/implicit_render.rb:5:in
send_action’
System configuration: Ubuntu 18.04 Rails 4.2.11.1 Ruby 2.4.5
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 12
- Comments: 27 (2 by maintainers)
1.2.2 fixed the issue for me
@unixmonkey
We have used 1.1.0 for a long period before the update without a hitch.
@unixmonkey
Thanks for the update. I too still get the stack overflow with version 1.2.1.
Confirmed.
Extra info, ancestor chain:
method(:render).super_method
calls to Remotipart RenderOverrides
#<Method: ActionController::Metal(Remotipart::RenderOverrides)#render(render_with_remotipart)>
Thanks for reporting the issue everyone. I’ve pushed up a fix in #813 and released a new version
1.2.1
that should hopefully fix this for most or all of you (although I’m not quite sure about you @P9GIT). Please install and test the update and report back.If you can provide more info about what other gems might be interfering by stepping into the
render pdf:
call withpry-nav
orbyebug
, it would be very much appreciated.@unixmonkey Yes, for me works, too. Thank you!
I’ve just released a new version of wicked_pdf, version
1.2.2
, that aims to sidestep the issue with remotipart via #821.It may not help with other gems that work similarly, but I wanted to get a fix out there before working on the core issue, which will likely require a release with some deprecation warnings, and a major version bump.
We will be working to provide a better way to hook into Rails’ rendering system for
2.0
, but for now, please upgrade, and let me know if you continue to have trouble or not!@unixmonkey amazing, the master branch fixed the issue for me!
@stewgloves can you please try installing from the master branch? It has a lot of fixes I’m planning on releasing soon.
This version is out-of-date and this issue has been addressed in newer versions. Closing this, but feel free to open a new issue if you are still having this issue on the latest version.
Hi @unixmonkey
UPDATE: moved to separate issue #845
I fell over a new instance of “stack level too deep” even with the new 1.2.2 version. This time it does not to involve the “remotipart” gem but just the “WickedPDF” gem.
Funny thing is that this exception only happens in rspec tests of endpoints which performs HTML rendering and not PDF. So when requesting the same endpoint in normal (non-testing) mode it works without problems.
It seems like an edge case. With the new version of “WickedPDF” coming up, this might not be worth looking into to fix, but for maybe giving helpful info on the root problem?
Reverting to “WickedPDF” version 1.1.0 makes the exception go away.
Example of failing endpoint:
The above “render” command is the line 258 referred to in the backtrace below.
Simplified Rspec code:
Exception:
… (this goes on and on)…
Can confirm I’ve been experiencing the same issue. 1.1.0 works fine, 1.2.0 causes a stack overflow.
I can also confirm the issue(s) in
1.2.1
, my stack: ruby:2.5.3
rails:5.2.2.1
And we have been using this gem for quiet some time. We faced issues when updating our stack due to security fixes in rails and devise and some other gems. And were hit by this, locking to 1.1.1 (version we were using prior) fixes the issue. Didn’t dig deep but it didn’t even let our server load home page with:
And our tests were failing with stack level too deep issue:
Let me know if i can provide any more information to help solve this issue.
@unixmonkey can you take a look at PR #812 as I think it could solve this issue and cleanup things a bit.
@unixmonkey
Thanks for the update. Unfortunately I still get the stack overflow with version 1.2.1. I got a stack trace which resembles what @etal2 reports.
This happens if I just HTTP GET our login page. See attached txt file for full stack trace. stack_trace.txt
Seems gem “remotipart” has something to do with this.