Report this

What is the reason for this report?

Problems with odoo and wkhtmltopdf in Kubernetes

Posted on June 17, 2025

We have several Odoo instances in several Kubernetes clusters at Digitalocean. This normally works without any problems.

With one customer we have a problem that we run into a limitation with the “max open files” when generating a large PDF with wkhtmltopdf.

The system returns the following error:

{"level": "WARNING", "time": "2025-06-16 21:06:31.400712Z", "msg": "ERROR while sending the delivery slips for CUSTOMER.\nWkhtmltopdf ist fehlgeschlagen (Fehlercode: -6). Nachricht: QEventDispatcherUNIXPrivate(): Unable to create thread pipe: Too many open files\nQEventDispatcherUNIXPrivate(): Can not continue without a thread pipe\n”}

(Unfortunately, we do not currently know how large the PDF is or how many files there are as it is executed in a job.)

Google and AI basically tell us that the limit for the “open files” is probably too low. So we tried to increase this limit.

But the limit is already absurdly high (1048576) in my eyes. In addition, I cannot increase it above the hard limit.

root@pros-69d849fd7-zwc6z:/# ulimit -aH
real-time non-blocking time  (microseconds, -R) unlimited
core file size              (blocks, -c) unlimited
data seg size               (kbytes, -d) unlimited
scheduling priority                 (-e) 0
file size                   (blocks, -f) unlimited
pending signals                     (-i) 31610
max locked memory           (kbytes, -l) 8192
max memory size             (kbytes, -m) unlimited
open files                          (-n) 1048576
pipe size                (512 bytes, -p) 8
POSIX message queues         (bytes, -q) 819200
real-time priority                  (-r) 0
stack size                  (kbytes, -s) unlimited
cpu time                   (seconds, -t) unlimited
max user processes                  (-u) unlimited
virtual memory              (kbytes, -v) unlimited
file locks                          (-x) unlimited
root@pros-69d849fd7-zwc6z:/# ulimit -n 2000000
bash: ulimit: open files: cannot modify limit: Operation not permitted

Is my assumption correct that we cannot increase the “hard limit” (nofile) in DigitalOcean’s managed kubernetes?

If anyone has an idea what else could be the problem, I am open to suggestions.

The container is an Ubuntu (Ubuntu 22.04.5 LTS x86_64) the default image of odoo.

Thanks in advance Marcel



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey Marcel 👋

Yeah, I think tht your assumption sounds right, in DigitalOcean’s managed Kubernetes, you can’t raise the hard nofile limit beyond what’s set at the node level, and since the nodes are managed, you don’t have root access to tweak system-level limits directly.

That said, 1,048,576 is already super high, if wkhtmltopdf is still crashing with that, it might not actually be hitting the ulimit but something else internally (e.g. thread or pipe exhaustion, or a bug in Qt/wkhtmltopdf under load).

You could try to run the PDF generation outside the pod in a one-off job or dedicated VM with tighter control.

Also, try switching to a different wkhtmltopdf build, some custom builds behave more reliably under load.

If it’s a threading issue, playing with --no-outline or --disable-smart-shrinking might reduce resource pressure (not 100% sure, but worth testing).

Also, you could reach out to DigitalOcean support, they might be able to confirm the current limits on the worker nodes or offer more insight.

Let me know if you spot anything weird in dmesg or container logs!

- Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.