Server not responding after wkhtmltopdf installation

Keywords: Odoo - Linux - Technical issue - Other
bnsupport ID: 03dbdb44-a0c1-3b6a-85fc-48b0bb261f5c
Description:
Hello,
I've executed bnsupport tool and my support bundle code is:
03dbdb44-a0c1-3b6a-85fc-48b0bb261f5c

I've set up a new server with old Odoo-8.0-17 stack on Ubuntu 18.04
Everything works fine except after I install wkhtmltopdf package server stops to responding with this message:
Cette page ne fonctionne pas

In openerp-server.log I see next error message:
...
Critical bitnami_openerp openerp.modules.module: Couldn't load module report
Critical bitnami_openerp openerp.modules.module: 'NoneType' object has no attribute 'group'
...

The version of the package is : wkhtmltox_0.12.1.4-2.bionic_amd64.deb
To install wkhtmltopdf I've used those commands:

find /opt/odoo-8.0-17/common/bin -name fc-* | sudo xargs -I {} mv {} {}.bak

sudo apt-get install zlib1g fontconfig libxrender1 libfreetype6 libxext6 libx11-6

sudo wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.1.4-2/wkhtmltox_0.12.1.4-2.bionic_amd64.deb

sudo apt install -f ./wkhtmltox_0.12.1.4-2.bionic_amd64.deb
sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin
sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin

Thank you for help!

I see in openrp-server.log this error:
version = re.search('([0-9.]+)', out).group(0)
AttributeError: 'NoneType' object has no attribute 'group'

This means that odoo can not get the version of the wkhtmltopdf package from the system!
Question is how to provide the version info to Odoo?

But if I uninstall the wkhtmltopdf package server start to work fine again.

Hello @kalachnikov_info,

Please note that Odoo 8 is a really old version. Bitnami packages and configures already existing applications. However, we can only offer support and help on basic and most frequent application configurations. Always based on the default configuration or on our guides.

Since the question is related to a third party tool, probably someone with more experience and knowledge about that specific tool can help you better than we can. We suggest you to post your question on the official support forums of the application so others can help you.

https://wkhtmltopdf.org/support.html

Do not hesitate to write us back if you have any other questions regarding the Bitnami solutions or their configuration.

Regards

Hello Daviddg, Yes I understand, but my custom modules are compatible with Odoo 8, so I have to use it for the moment.
I will ask on wkhtml support.
But may be you have an idea,
I'm almost sure that it is some permissions problem related to daemon, because whan I execute this command:
sudo /usr/bin/wkhtmltopdf google.com /tmp/teszt.pdf
it prints out nice pdf file without any problem!
Only odoo function "version = re.search('([0-9.]+)', out).group(0)" can not read or access to wkhtmltopdf on the system.

May be you have some suggestion or idea that I can try before I give up.
Thank you!

Hello @kalachnikov_info,

Checking your permissions it seems all odoo files belong to daemon:daemon which is ok. You could try these commands just to reset odoo permissions in case we could be missing somenthing:

sudo mkdir -p /opt/bitnami/.tmp
sudo chmod -R 777 /opt/bitnami/.tmp
sudo chmod -R 755  /opt/bitnami/apps/odoo/data
sudo chown -R daemon:daemon /opt/bitnami/apps/odoo/data
sudo chown -R daemon:daemon /opt/bitnami/apps/odoo/bin
sudo chown -R daemon:daemon /opt/bitnami/apps/odoo/lib
sudo chown -R daemon:daemon /opt/bitnami/apps/odoo/node_modules
sudo chown -R daemon:daemon /opt/bitnami/apps/odoo/log

Before this, create a backup to avoid possible issues (note that Odoo 8 is not supported, so my guideline is based on Odoo 14):

sudo cp -ra /opt/bitnami/apps/odoo /opt/bitnami/apps/odoo.bck

Regards

Hello David, I've experimented with Ubuntu 16.04 installation and I found out interesting thing!

If I install wkhtmltopdf on Ubuntu 16.04 and than copy binary files from /usr/local/bin to the Ubuntu 18.04 in this case
odoo have no problem to execute wkhtmltopdf and server starts.

I noticed this difference in installed binary wkhtmltopdf files on Ubuntu 16.04 and Ubuntu 18.04 and 20.04!
On Ubuntu 16.04 after installation all files have icon of execuable file
and in Permission tab there is a check box Program:Allow this file to run as a program


On Ubuntu 18.04 - 20.04 : after installation binary files has no icon of executable file they look like ordinary text file and in Permission tab
there is no check box Program:Allow this file to run as a program.
And this command has no effect : sudo chmod +x /usr/local/bin/wkhtmltopdf

Then I've installed Odoo 14 stack on Ubuntu 18.04 and it runs without problem even with binary looking like text files.
So only Odoo 8 stack can not execute wkhtmltopdf files on Ubuntu later than 16.04 because of some installation or compilation difference!
Any ideas on installation command that can compile .deb package in right way on Ubuntu 18.04-20.04?
I used this command on all systems:

for Odoo 8.0 on Ubuntu 18.04

find /opt/odoo-8.0-17/common/bin -name fc-* | sudo xargs -I {} mv {} {}.bak
sudo apt-get install zlib1g fontconfig libxrender1 libfreetype6 libxext6 libx11-6
sudo wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.1.4-2/wkhtmltox_0.12.1.4-2.bionic_amd64.deb
sudo apt install -f ./wkhtmltox_0.12.1.4-2.bionic_amd64.deb
sudo cp /usr/local/bin/wkhtmltopdf /usr/bin
sudo cp /usr/local/bin/wkhtmltoimage /usr/bin

Hello @davidg,

Please note this case is very specific to the tool and the application itself. My suggestion is to open an issue for wkhtmltopdf or Odoo with all this detailed information you obtained:

https://wkhtmltopdf.org/support.html
https://github.com/wkhtmltopdf/wkhtmltopdf/issues
https://github.com/odoo/odoo/issues

Regards

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.