-
Notifications
You must be signed in to change notification settings - Fork 14
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
Better error handling #36
Comments
Hi!
Errors like this are from the native poppler library. It seems for poppler that your PDF is malformed.
This should not happen if wrapped in try/catch. How exactly this crash looks? |
It took many hours to find out more about this problem. First, the PDF is not malformed as it was successfully converted with poppler-utils->pdftocairo. I sadly switched from poppler to graphicsmagick now and the conversion process works fine now (although it is slower). The biggest problem was that there was no error messages or crash logs shown. I am running the server inside a docker container and after these three lines the server just restarts. No exceptuon, crash log or anything. On the host system inside journalctl I found out that there was a SIGSEGV thrown by the node process. Another important but strange note is that after switching to graphicsmagick, the conversion process worked, but I still got a few crashes (also SIGSEGV) on other situations. After a few hours I found out, they were caused by using the "sharp" library (which is using some poppler-native bindings as far as I know). After replacing sharp by graphicsmagick, everything works fine again. I tried all the above on two different servers with two different node versions. In conclusion it seems like a native poppler issue, but without further logs being thrown it is hard to find out the real cause of the problem. |
Seems like a job for gdb. If it's possible to create a small reproducible example, then it may be reported to the poppler's issue tracker. |
As a side note: I don't think you should compare poppler-simple with Cairo. I'm quite sure that PS is not using Cairo. Does your PDF convert successfully with I need to use Cario myself because my PDFs are mostly vector graphics which is best rendered by Cario IMO. My solution:
|
I am using this package in production for several months. Unfortunately it causes some server crashes when converting different files.
For example I get the following error messages (from server logs):
After this line, the server crashes, although I am using a try/catch clause.
Is there any way to better handle these errors?
OS: Alpine 3.13 running in Docker container
Poppler: 20.12.1
The text was updated successfully, but these errors were encountered: