-
Notifications
You must be signed in to change notification settings - Fork 137
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
electron-pdf hangs indefinitevily on Linux #243
Comments
please include the exact command you are running. And try prepending |
Command PS: I retried with the page with SVGs, no problem with |
I don't know if this is helpful, but I put electron-pdf in a Docker container (https://github.com/amaloy/electron-pdf-docker) and had the same problem. I ended up editing |
I'm having the same issue on Debian with a HTML file that contains SVGs. |
I see total hang, too. Steps to reproduce: $ mkdir /tmp/test001 The process hangs, no CPU usage nor disk I/O. System info: $ lsb_release -d $ npm --version $ apt policy nodejs All real browsers (Chrome, Chromium, Firefox etc) do work so this shouldn't be caused by any missing libraries or unsupported features. |
Apparently, electron-pdf does only output any result when --browserConfig '{ "webPreferences": { "sandbox" : true } } is passed. See fraserxu/electron-pdf#243
Apparently, electron-pdf does only output any result when --browserConfig '{ "webPreferences": { "sandbox" : true } } is passed. See fraserxu/electron-pdf#243
Same happens to me on Fedora. I only have this warning:
After that, nothing. |
Same here (Ubuntu 20.04 LTS AFAIK), Tried with One url is working fine (it's a big 'report', so it takes a while to render. You see electron process taking a lot of CPU for some minutes, then a second electron process starts taking CPU and in the CLI I see a debug JSON object being printed... and then the PDF saves and everything clears up). But the same url with different parameters (render the same report for another country) is not working, but 'hanging around'. After a while, the hung-window timeout kicks in and kills the window, but electron still hangs around. Increasing the hung-window timeout just makes this time longer, but no PDF is ever created (not even a 0-byte file). It appears for certain URLs the page renders, but electron-pdf never goes to the 'print as PDF' stage. |
This problem is probably caused by electron/electron#27605 The only known workaround is not to print anything containing an |
I discovered that it appears electron is crashing. It shows with a 'trap int3' in the dmesg output. The same page but rendered chunk by chunk is working fine, so in the end we render it in smaller parts and combine them together with qpdf. Setting ELECTRONPDF_RENDERER_MAX_MEMORY to any amount smaller than 2gb seems to 'fix' it. It seems that, independent of the ELECTRONPDF_RENDERER_MAX_MEMORY setting, electron just crashes when it uses more than 2gb of memory. Restricting it so it doesn't use that much memory fixes the crash, but makes the render times way to long to be practical / usable. |
I tried to run electron-pdf http://fraserxu.me test.pdf, as suggested in the help, but it hangs indefinitively without any message. I tried gooogle.com too.
I also tried the solution in this comment. It works for http://fraserxu.me
but not for my html file, that is full of SVGs (maybe this is the problem)?OS: Lubuntu 18.04.2 (Linux 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux)
Electron Version: 4.0.4
The text was updated successfully, but these errors were encountered: