Linux version cannot write on STDOUT when wkhtmltopdf used as a child-process. #3119
Comments
a workaround is to pipe the result to like so : |
I am experiencing a very similar issue when attempting to use wkhtmltopdf from a Ruby application. The issue does not occur for my application when running in Heroku, but does appear when running the same application on Docker containers. In both cases the command works when writing the output to a file, but not when writing to STDOUT. Like miccarr, I can even pipe the output to Heroku Dyno with Ruby Buildpack (working)
Docker Container (not-working)
In the Docker case, For reference, PDFKit is issuing this command, as copied from the application logs (again, works in Heroku, doesn't work in Docker):
The error message generated in Docker application logs is:
Seems to be the same issue reported in: edit: formatting |
I have tried monkey patching PDFKit to append
My issue may be a Docker issue. @miccarr, did you experience this issue on non-Dockerized Linux? See moby/moby#11462 |
@sleighter this doesn't work in Flynn due to flynn/flynn#3535, we'll work on a patch. By the way, the |
@sleighter @miccarr It is possible to use a container to pipe in and stream it back out. I think the main trick is the switches you pass when invoking docker run. I have a container that exposes only the
Without the attach or interactive flags, I was unable to get the piping working. |
as much as it sounds weird, I solved the same issue of yours I had with a simple exec() call with php by |
Facing the same issue. |
strace output:
|
It turns out |
in src/lib/pdfconverter.cc line 347 replace: if (QFile::exists("/dev/stdout")) with: if ((QFile::exists("/dev/stdout")) && (QFileInfo("/dev/stdout").isWritable())) Should fix this issue. |
…ng it directly
Hi,
When wkhtmltopdf is spawned as a child-process on linux (via a NodeJS app in my case, seems to have same problem on other languages), it cannot output to STDOUT by throwing :
When I do the same command (
wkhtmltopdf whatever.html -
like) on a shell, it works.I don't have this problem on osX, only on Docker & Linux.
The text was updated successfully, but these errors were encountered: