-
Notifications
You must be signed in to change notification settings - Fork 238
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
Randomly fails and there are multiple wkhtmltopdf processes #378
Comments
Errors like this are extremely hard to fix. We already refactored the execution of wkhtmltopdf a lot to fix hanging issues (see mikehaertl/php-shellcommand#20). But this only affects Linux systems. So what OS are you on? If you're on Windows I strongly recommend to consider using Linux (e.g. in a Docker container). It's much more stable. If you don't use Windows I can only recommend to study the linked issue above and the code we used to fix the problem. Then see if you can add some debugging output here and there to find out, where it hangs. |
I am on Debian. It actually works fantastically almost all the time, it really is an awesome library. So it’s unpredictable as to when the issue happens. The only time I know there’s an issue is when the pdfs don’t generate - this is when I log into the server and run “ps aux”, which shows that the list has multiple wkhtmltopdf processes. So it seems like whenever there is one wkhtmltopdf process that hangs, from there this affects all others calls to also hang. |
The main logic is probably best explained in my comment here: mikehaertl/php-shellcommand#20 (comment) You can try to edit the main loop in
Also check the lines below where That's basically all help I can provide. You need to be creative how to get more information out of the running process. |
Thanks Mike , I will have a look and fingers crossed
At most I will try out the timeout setting to make sure there are no multiple processes jamming the whole thing
On 13 Dec 2021, at 20:06, Michael Härtl ***@***.***> wrote:
The main logic is probably best explained in my comment here: mikehaertl/php-shellcommand#20 (comment)
You can try to edit the main loop in mikehaertl/php-shellcommand/src/Command.php and e.g. write something to a log file. Maybe write the current $status to a file after this line:
while ($isRunning) {
$status = proc_get_status($process);
Also check the lines below where stdin and stdout are read. This part (or the lack of it) caused the processes to hang: The output buffer for stdout was full and wkhtmltopdf was waiting that it was read.
That's basically all help I can provide. You need to be creative how to get more information out of the running process.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Most of the time this works (often for months) without any issues. However, once in a while pdf fails to download and when I check the server , ps aux shows multiple wkhtmltopdf processes.
Once I killall wkhtmltopdf , then the pdf generation works again. Is there a way to overcome this or find out why there are multiple processes?
Could it be two requests to phpwkhtmltopdf at once hangs wkhtmltopdf?
Looking for a way to fix this. Appreciate any help
The text was updated successfully, but these errors were encountered: