Help

0

Wkhtmltopdf failed (error code: -11)

Avatar
Lucas Huber

When I try to generate a PDF from a quotation or something else the following error messge appears:

Report (PDF)
Wkhtmltopdf failed (error code: -11). Message

/var/log/syslog:

Feb  9 10:50:01 SRV02 kernel: [2175649.190455] wkhtmltopdf[35674]: segfault at bbadbeef ip 00000000004f3449 sp 00007fff9c574870 error  6 in wkhtmltopdf[400000+2274000]

I having an Ubuntu 14.4 Server, Wkhtmltopdf was installed as follows:

sudo wget http://downloads.sourceforge.net/project/wkhtmltopdf/archive/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb

sudo cp /usr/local/bin/wkhtmltopdf /usr/bin
sudo cp /usr/local/bin/wkhtmltoimage /usr/bin

Am I the only one having this issue?

5Opmerkingen
Avatar
Negeren

@Lucas removed my answer as I looked wrong. My apologies! Do you get this error on every report? Did you modify the report code or is it still the same as from the source?

Avatar
Lucas Huber
-

yep it is on every report.

Avatar
Zbik
-

You test your wkhtmltopdf from linux command line

Avatar
Antonio M. Vigliotti
-

@Lucas, 1.st - you should test if wkhtmltopdf wkhtmltopdf works. From bash you should issuue *wkhtmltopdf --help* 2.nd - If wkhrmltopdf works you should look at your report, because may be it has wrong data inside. Try to repeat commnda n odoo log with bash and see in /tmp what is created Hope this help Antonio

Avatar
Shaun Haddrill
-

Do you have selinux installed?

13Antwoorden
3
Avatar
Lucas Huber
Beste antwoord

The solution in my question was relatively simple.

Because normally odoo is started from the root user, so the environment variable from the odoo user are not active. The  environment variables are coming from the process, eg are normally stated in the /etc/init.d/odoo-server startup file.

This variable should solve the problem:  Please ad or correct in the startup script.

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin 
Avatar
Negeren
2
Avatar
Ivan Elizaryev
Beste antwoord

The solution is to increase value for limit_memory_hard parameter in odoo config file

 

Avatar
Negeren
1
Beste antwoord

Dear, When you try to generate a big pdf (over 200 pages) with header and footer, you are an error -11. It is a limitation of max handle file per process. (default is 256). But the wkhtmltopdf open for each page the header and the footer. to change this value : http://stackoverflow.com/questions/16526783/python-subprocess-too-many-open-files In terminal : ulimit -n 10000

Avatar
Negeren
1
Avatar
Johann Müller
Beste antwoord

We run on wkhtmltopdf 0.12.2.1 and got the errorcode -11 only in some rare cases. So the error could appear for a sale order. Only by changing the saleorder lines or other information like deleting the notes, save, paste the old notes, we could get through the error.


How we solved the problem:

In our case, the error was not consistent. We changed the limit_memory_hard and tried other solutions, which finally didnt help us. We've been building the report styles by replacing it without inherit_id
so the new customer reportstyle template was like

<template id="report.style"> CSS HERE </template>


and we went to....

<template id="report_style_custom" inherit_id="report.style">
<xpath expr=".">
<t>
CSS HERE
</t>
</xpath>
</template>

While in 0.12.1 this error didnt occure nearly once,

in 0.12.2.1 this solution helped us at www.myodoo.de and for our customers

Avatar
Negeren
0
Avatar
Shaun Haddrill
Beste antwoord

In my case it was selinux getting in the way, have you checked your /etc/log/audit/audit.log?

Avatar
Negeren
0
Avatar
Odoo Agency
Beste antwoord

Hi

I am getting same issues to my vm (Debian 7.0). When I restart server it works well but after sometime I get it again. I dont know how to fix it.

Can anybody help me ?

Avatar
Negeren
0
Avatar
zahid
Beste antwoord

Hi i had the same probleme, i solved it by installing wkhtmtopdf compiled with patched Qt libs. You can download it here

http://download.gna.org/wkhtmltopdf/0.12/0.12.2/

Avatar
Negeren
0
Beste antwoord

@Lucas,

It happened also to me after some change of document header. Combination of header.html + body.html + footer.html goes in crash.

Be patient, restore original file html and do 1 change per time, until you'll discover what is wrong.

Be patient, very patient

Antonio

Avatar
Negeren