-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SystemStackError issue with Rails 5.1 and Ruby 2.4.1 #650
Comments
I downgraded to rails 5.01. It still doesn't work. Error msg below: SystemStackError (stack level too deep): |
I just fired up a brand-new Rails 5.1 project (with Ruby 2.2.5) and was able to use Wicked PDF (1.1.0) without any issues. I then installed Ruby 2.4.1 and re-bundled and again it is working fine for me. Do you have something else in your view that could be causing this, perhaps a partial that renders a partial, or a method that gets called too many times? I've run into code that actually isn't recursive, but calls are repeated too many times triggering a SystemStackError. I've updated the issue title to more accurately reflect what you are experiencing. I wouldn't want people to be incorrectly think it doesn't work at all with 5.1. Let me know how it goes! |
Hi Unixmonkey, Thank you very much for looking into this issue. I upgraded to the most recent version of wicked_pdf from rubugems.org everything now works perfect. I was using an old version of it. Now I am closing this issue. |
I'm having the same issue on any route in the app. Using Rails 5.0.2, Ruby 2.4.0. Here is a part of the stack trace https://gist.github.com/beydogan/f88a81cbead9d20ae65e932f88d6e40d UPDATE: removing remotipart seems to be working. Its probably related to that remotipart. |
@beydogan We've had a documented conflict with Remotipart in #111, but I thought that was fixed in Rails 5+ after #574 was merged. I'd be curious if you could figure out if that patch isn't helping for some reason. Also, I think you might be able to change |
@unixmonkey I will try with |
I am also experiencing this issue. Rails 5.1.4 on Ruby 2.4.1 It completely stops the app from loading. It won't load a single page, even one that has nothing to do with PDF generation. I'm using the latest versions of both remotipart and wickedpdf:
Stack Trace:
|
@chris-gooley That fix isn't in the latest released version. Try against gem 'wicked_pdf', github: 'mileszs/wicked_pdf' |
Sorry, I should have put this in the comment, I'm already using the github version
I'm also using the github release of remotipart
|
Have the same issue.
The problem is somewhere in fact that both remotipart and wicked_pdf override render -> render_with_wicked_pdf -> render_with_remotipart -> render_without_remotipart (which is render) -> ... (https://github.com/JangoSteve/remotipart/blob/master/lib/remotipart/render_overrides.rb#L16) |
For myself I did temporarily monkeypatch to completely remove 'render' method from WickedPdf:
I better will use explicit PS I put this patch to config/initializers/wicked_pdf.rb, here is how it looks now:
|
@sintro This is a clever workaround. Thank you for sharing. |
this is still an issue with wickedpdf master with rails 4.2.0 and ruby 2.2.4. |
I have the same render loop on master with rails 4.2.10 and ruby 2.3.0.
And I'm trying to render a simple json response... |
This issue is still occurring. Just putting the gems in my gemfile causes the SystemStackError seen above. Why would a completely unrelated and still not fixed issue be referenced in closing this? |
@mattnwa You are probably experiencing a similar error with the newly released version which is currently being tracked in #810. I'm actively working on a fix, but it's not really an issue with this gem, but it's interaction with other gems that mess with |
Facing the same issue. Here is the log for any help on it.
Thanks |
Issue resolved with help of below. Thanks @sintro
|
For those who are monkey patching the render method on ActionController themselves (not via a gem), I found out that in my case I could just switch to using a custom Renderer I was overriding the render method to support PLISTs, but it turns out that wasn't necessary in my case. |
See mileszs/wicked_pdf#650 (comment) It seems that the incompatibility is caused by the `prepend` of `WickedPdf::PdfHelper` to `ActionController::Base`: https://github.com/mileszs/wicked_pdf/blob/0d96b8a73fb043490a0800fbdb896b453939f1f8/lib/wicked_pdf/railtie.rb#L12 `view_component` uses a similar, and presumably conflicting, technique: https://github.com/github/view_component/blob/a1635d48ace33103c05dfc96cc88442e4e663ab8/lib/view_component/engine.rb#L49-L51
system stack too deep when rendering any default html action.
The text was updated successfully, but these errors were encountered: