Skip to Content
Menu
This question has been flagged
4 Replies
2332 Views

i download a module like purchasing, but when i clicked print and choose Purchase Order, i got that error:
Wkhtmltopdf failed (error code: -11). Memory limit too low or maximum file number of subprocess reached. Message : 

I'm using odoo14 and MacOS

Avatar
Discard
Best Answer

any solution

Avatar
Discard
Best Answer

i tried the proposed solution above and i still got the same error.
I got the same configuration as Andikha.

No problem on windows or linux. But on MacOs, printing a report is a nightmare

Avatar
Discard
Author Best Answer

i made it like this on odoo.conf:

limit_memory_hard = 900000000000000

limit_memory_soft = 2147483648

limit_request = 8192

limit_time_cpu = 60

limit_time_real = 120

limit_time_real_cron = -1


but still error, and i already check my Wkhtmltopdf:

wkhtmltopdf --help

Name:

  wkhtmltopdf 0.12.6 (with patched qt)


Avatar
Discard
Best Answer

The error you’re encountering with Wkhtmltopdf and Odoo 14 on MacOS suggests that the memory limit is too low or the maximum number of files that can be opened by a subprocess has been reached. Here are a few steps you can try to resolve this issue:


Increase the Memory Limit: You might need to increase the limit_memory_hard parameter in your Odoo configuration file. This sets the maximum allowed memory per worker1.

Increase File Descriptors Limit: The error could also be due to the limitation of max handle file per process. You can increase this limit by running the command ulimit -n 10000 in your terminal.

Check Wkhtmltopdf Installation: Ensure that Wkhtmltopdf is installed correctly on your system. You can test it by running wkhtmltopdf --help from the command line to see if it works.

Modify the Report Template: If the error occurs when generating large PDFs or when empty content is drawn on the last page, you might need to adjust the report template. For instance, setting the table width to 99% can sometimes prevent the error by ensuring there’s content on the last page.

Avatar
Discard

I think I've found a solution!

I downloaded an old version of wkhtmltopdf (0.12.4) and installed it on my Mac. Then, I copied and pasted the contents of wkhtmltopdf into the virtual environment (venv) of my Odoo installation, where Homebrew had installed the latest version. No more errors so far.

Since macOS and Homebrew only allow you to install the latest version (which can be frustrating), you can copy and paste the version you want into the packages of your virtual environment.

I'm a newbie in computer science, but I'm stubborn!

Related Posts Replies Views Activity
0
May 24
853
0
May 24
979
0
May 24
526
1
May 25
360
1
May 25
139