0

Scenario

I am running Odoo version 10 in a BSD jail. All functionality was working fine until recently, and I am unaware of any changes. My installation of Odoo has lost the ability to generate PDFs using wkhtmltopdf. When I try to print a report, I receive the following:

Unable to find Wkhtmltopdf on this system. The report will be shown in html.

When I try to e-mail a report, I receive the following:

Unable to find Wkhtmltopdf on this system. The PDF can not be created. 

Steps Taken

I logged onto the server to check if wkhtltopdf was installed within the same BSD jail.

# pkg version -vR | grep wkhtmltopdf
wkhtmltopdf-0.12.3.2               =   up-to-date with remote

It is up to date. Maybe it's not in the environment.

# cd /usr/bin
# ls -l wkhtml*
ls: whktmltopdf: No such file or directory

Is it in the local environment at least?

# cd /usr/local/bin
# ls -l wkhtml*
-rwxr-xr-x  2 root  wheel  49432004 Dec 12 07:41 wkhtmltoimage
-rwxr-xr-x  2 root  wheel  49536598 Dec 12 07:41 wkhtmltopdf

Ok, so maybe it needs a link in the global environment.

# cd /usr/bin
# ln -s /usr/local/bin/wkhtmltopdf wkhtmltopdf
# ln -s /usr/local/bin/wkhtmltoimage wkhtmtoimage

Tried to print and e-mail reports, and continue to experience the same issue.

I also tried to see if wkhtmltopdf was working properly.

# wkhtmltopdf http://wkhtmltopdf.org testpdf.pdf

This successfully generated the PDF.

How you can help

  1. Is there maybe some setting within Odoo somewhere that is pointing to an errant location?
  2. Is there some troubleshooting step I may have overlooked?
  3. How can I regain this important functionality?

--EDIT--

I verified the PATH of the user of the Odoo application within the jail.

I also see in my original post that I forgot to mention that I had attempted a number restarts, which include simple service restarts, to jail restarts and even to hard booting the server machine, itself. None of the restarts seemed to make any difference. I also made sure to clear my browser cache before trying again.

While I was working on an unrelated script to restart specific jails remotely, I used my Odoo jail as my guinea pig. It must have received half a dozen restarts while testing and fine-tuning those scripts. It seems that is what it needed. The jail needed to be stopped and started six times.

A new error came up though. It could find wkhtmltopdf just fine, but couldn't locate another resource. Did all the same checks as with wkhtmltopdf, and nothing was out of place. Ran my remote jail restart script, and everything is working fine, for now.

2 Answers2

1

Make sure /usr/local/bin is in the PATH of the user running Odoo inside the jail.

arved
  • 764
1

follow this steps

  1. https://downloads.wkhtmltopdf.org/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
  2. dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
  3. sudo cp /usr/local/bin/wkhtmltopdf /usr/bin
  4. sudo cp /usr/local/bin/wkhtmltoimage /usr/bin
  5. set system parameter in settings in odoo

    • key: webkit_path
    • value: /usr/bin/wkhtmltopdf
Toto
  • 19,304