跳至內容
選單
此問題已被標幟
13 回覆
38252 瀏覽次數

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?

頭像
捨棄

@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?

作者

yep it is on every report.

You test your wkhtmltopdf from linux command line

@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

Do you have selinux installed?

作者 最佳答案

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 
頭像
捨棄
最佳答案

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

 

頭像
捨棄
最佳答案

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

頭像
捨棄
最佳答案

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

頭像
捨棄
最佳答案

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

頭像
捨棄
最佳答案

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 ?

頭像
捨棄
最佳答案

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/

頭像
捨棄
最佳答案

@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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
5月 15
8589
3
2月 19
7377
4
9月 24
3885
3
2月 24
3593
0
2月 23
1837