odoo tricks

Tips and tricks for Odoo (OpenERP)

Installing Odoo 8 on CentOS 6 with Python 2.7

Update 28 May 2016: This tutorial has been re-tested and updated to include the latest changes. It’s confirmed working. Thank you to everyone for your contributions in the comments section. I hope you find the tutorial useful!

This tutorial will walk you through the process of installing the latest version of Odoo on CentOS 6. It is intended for those who might not be experienced Linux administrators but who want to run their own Odoo server. You can simply copy-paste the commands into your terminal or SSH window.

The tutorial is fully tested on CentOS 6.5 but should work for any 6.x version. Please see my other tutorial for CentOS 7 instructions.

First we will install the PostgreSQL database server, then install the necessary package dependencies. Next we will create a virtual Python environment (so we don’t interfere with the CentOS version) and install all the modules Odoo requires. Then it’s time to pull the latest Odoo code from GitHub and create a CentOS 6 compatible init script. Finally we will add the necessary firewall rules and connect to the server.

This tutorial assumes you have already performed a minimal install of the latest version of CentOS 6.5 on a server dedicated to just running Odoo. It also assumes you will be running Odoo on the same server as the PostgreSQL database. You will need at least 1GB of available RAM for lxml to install, although this can include SWAP space.

Odoo is a complicated installation with many dependencies and can be quite resource intensive. I highly recommend you install on a server (or real or virtual) that is dedicated to Odoo. Co-locating Odoo with existing websites/applications is likely to cause problems at some point.

1: Generate Odoo Passwords

Before starting installation we will generate two passwords. The first line generates a strong random password for the odoo server to access the PostgreSQL database that we will install. The second line is the master password you will use to create the Odoo database after the installation is complete. Don’t worry about these for now. After the installation is complete you will find both these passwords in the Odoo configuration file (/etc/odoo-server.conf).

Important: You must run these commands as the root user

ODOO_POSTGRES_PASSWORD=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-20};echo;`
ODOO_DB_ADMIN_PASSWORD=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-20};echo;`
echo && echo "**** Make a note of these generated passwords ****" && echo "Odoo Postgres DB User Password:" $ODOO_POSTGRES_PASSWORD && echo "Odoo Master Password:" $ODOO_DB_ADMIN_PASSWORD && echo

2: Install and configure PostgreSQL

First will install the PostgreSQL version 9.5. Unfortunately the CentOS 6 official respository only contains older versions, so we will need to install directly from the PostgreSQL repositories. We use the repository rather than simply downloading an RPM because it’s easier to keep up to date with important security and maintenance updates. This command will add the PostgreSQL repository to your server:

rpm -ivh https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6-x86_64/pgdg-redhat95-9.5-2.noarch.rpm

It’s important we exclude postgresql from the official CentOS repository files, otherwise we will encounter problems when we run updates:

sed -i 's/^gpgkey.*/&\nexclude=postgresql*/' /etc/yum.repos.d/CentOS-Base.repo

Installing PostgreSQL and some associated libraries is now straightforward. We then need to initialise the database.

yum -y install postgresql95 postgresql95-server postgresql95-devel postgresql95-libs
service postgresql-9.5 initdb

Next we need to configure PostgreSQL so it will accept connections using MD5 hashed passwords so it’s compatible with the Python modules:

sed -i "/^host/s/ident/md5/g" /var/lib/pgsql/9.5/data/pg_hba.conf

Finally let’s add PostgreSQL to the list of services which will be enabled at startup. We then start the PostgreSQL server and add the Odoo user with the password we generated in step 1.

/sbin/chkconfig --level 35 postgresql-9.5 on
service postgresql-9.5 start

echo -e "$ODOO_POSTGRES_PASSWORD\n$ODOO_POSTGRES_PASSWORD\n" | su - postgres -c "createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo"

3: Installing Python

Odoo requires a modern version of Python lot of additional libraries. Potentially these could conflict with the Python libraries supplied in CentOS 6 and relied upon by the built in administration tools. So to avoid this risk we will create a virtual environment under the Odoo system user account which will be used solely by the Odoo server.

First lets make sure all the packages on your CentOS install are up-to-date. If we don’t do this, then you will end up with endless version conflicts:

yum clean all
yum -y update

Next let’s install the Odoo package dependencies:

yum -y install wget gcc zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libffi-devel libxslt libxslt-devel libxml2 libxml2-devel openldap-devel libjpeg-turbo-devel openjpeg-devel libtiff-devel git libpng libXext libz.so.1 xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi curl cabextract

We also need the wkhtmltopdf package in order to generate PDF reports in Odoo. This link is for the 64bit version of CentOS. For 32bit change ‘amd64’ to ‘i386’ in the filename below.

rpm -ivh http://download.gna.org/wkhtmltopdf/0.12/0.12.2/wkhtmltox-0.12.2_linux-centos6-amd64.rpm
ln -s /usr/local/bin/wkhtmltopdf /usr/bin/

Optional: You may wish to install Microsoft’s Core Fonts so they are available when you generate reports in Odoo. First we need to install some dependencies, then the msttcore-fonts-installer rpm downloads the fonts from sourceforge, installs them and activates them on your CentOS server.

For 64 bit (x86) CentOS installs ONLY:

rpm -ivh https://dl.fedoraproject.org/pub/epel/6/x86_64/libmspack-0.5-0.1.alpha.el6.x86_64.rpm
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/cabextract-1.5-1.el6.x86_64.rpm
rpm -ivh https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm

For 32 bit (i386) CentOS installs ONLY:

rpm -ivh https://dl.fedoraproject.org/pub/epel/6/i686/libmspack-0.5-0.1.alpha.el6.i686.rpm
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i686/cabextract-1.5-1.el6.i686.rpm
rpm -ivh https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm

Now let’s download and install Python 2.7.8 from source. The first command removes any existing python2.7 installs from previous attempts. Note after compiling we use “altinstall” to prevent overwriting the CentOS default python installation. We will do the Python build in the root users home directory as some CentOS installs prevent the execution of compiled C programs in the /tmp/ directory for security reasons (see “noexec” in /etc/fstab):

rm -rf /usr/local/lib/python2.7
cd /root/
wget http://python.org/ftp/python/2.7.9/Python-2.7.9.tgz
tar -xzf Python-2.7.9.tgz
cd Python-2.7.9
./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make
make altinstall

With Python successfully installed it’s time to add the Python virtual environment (virtualenv) and the PIP module installation utility:

wget https://bootstrap.pypa.io/ez_setup.py -O - | /usr/local/bin/python2.7
/usr/local/bin/easy_install-2.7 pip virtualenv

Next let’s create an Odoo user and setup the virtual environment.

adduser odoo

DIR="/var/run/odoo /var/log/odoo /opt/odoo"
for NAME in $DIR
do
if [ ! -d $NAME ]; then
   mkdir $NAME
   chown odoo.odoo $NAME
fi
done

4: Installing Python modules in a virtual environment

Odoo requires a lot of Python modules to run. With the Python virtual environment successfully created we now need to add all the additional modules.

Important note for WHM/cPanel users: If your hosting provider is using WHM/cPanel to manager your server, you must enable compiler access for the odoo user otherwise the Python and additional modules installation will fail. See here for instructions on how to enable compiler access. You can disable compiler access again after Odoo installation is completed.

Important: Commands in this section must be run as the odoo user

First let’s switch from root to the odoo user, then create a new virtual environment called odoo and activate it:

su - odoo

/usr/local/bin/virtualenv --python=/usr/local/bin/python2.7 odoo
source odoo/bin/activate

Before starting the module installation we need to add the path to the PostgreSQL binaries, otherwise the PsycoPG2 module install will fail:

export PATH=/usr/pgsql-9.5/bin:$PATH

To avoid warnings about “SNIMissing” you need to update ndg-httpsclient:

pip install --upgrade ndg-httpsclient

5: Installing Odoo 8 from GitHub

Now it’s finally time to install Odoo itself. We are going to download the latest version of Odoo 8 from the GitHub repository. Note that we are installing into the /opt directory so we can easily manage the installation in a single location and keep it separate from the rest of the operating system.

Important: These commands must be run as the odoo user

cd /opt
git clone https://github.com/odoo/odoo.git --branch 8.0
chown -R odoo.odoo odoo

Now let’s install all the Python module dependencies. We will use the list included with the Odoo distribution to ensure we install the correct versions. Once installed we exit the Odoo user account and return to the root user.

export PATH=/usr/pgsql-9.5/bin:$PATH
pip install -r /opt/odoo/requirements.txt
exit

Let’s create a basic Odoo server configuration file. The passwords we created earlier should be automatically populated from the environment variables. I’ve also dialled back the logging so we only see warnings and fatal errors. I’m located in the UK, so the timezone is set to Europe/London.

Important: All the following commands must be run as the root user

cat > /etc/odoo-server.conf << EOF
[options]
; This is the password that allows database operations:
admin_passwd = $ODOO_DB_ADMIN_PASSWORD
; DATABASE OPTIONS
db_host = localhost
db_port = 5432
db_user = odoo
db_password = $ODOO_POSTGRES_PASSWORD
; MISC SETTINGS
addons_path = /opt/odoo/addons
load = web
timezone = Europe/London
without-demo=all
; LOG SETTINGS
logfile = /var/log/odoo/odoo-server.log
log_handler = werkzeug:WARNING
log_level = warn
no-logrotate = True

EOF

chown root.odoo /etc/odoo-server.conf
chmod 640 /etc/odoo-server.conf

I also like to enable logrotation using the built in CentOS tools so the logs are managed in the same way as all the other applications.

cat > /etc/logrotate.d/odoo-server << EOF
/var/log/odoo/*.log {
    copytruncate
    missingok
    notifempty
}
EOF

Next we create a script to easily start and stop the Odoo server. We download a pre-created init script, then use a sed script to modify the startup command so it plays nicely with the virtual Python environment we created earlier.

wget -O /etc/init.d/odoo https://raw.githubusercontent.com/Johnzero/OE7/master/install/openerp-server.init

sed -i "s/openerp/odoo/g" /etc/init.d/odoo
sed -i "s/OpenERP/Odoo/g" /etc/init.d/odoo

sed -i "s/\/usr\/bin\/setsid \/usr\/bin\/odoo-server/~\/odoo\/bin\/python \/opt\/odoo\/openerp-server/" /etc/init.d/odoo

chmod +x /etc/init.d/odoo
/sbin/chkconfig --level 35 odoo on

The final step in this section is to add the necessary firewall rules. The redirect command accepts connection on port 80 and redirects them to the default Odoo port 8069. This avoids your users having to remember to enter the port number each time.

/sbin/iptables -A INPUT -p tcp --dport 5432 -i lo -j ACCEPT -m comment --comment "Accept local connections to PostgreSQL"
/sbin/iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8069 -m comment --comment="Redirect Odoo HTTP requests to 8069"
/sbin/iptables -A INPUT -p tcp --dport 8069 -j ACCEPT -m comment --comment "Accept inbound Odoo connections"
/etc/init.d/iptables save

6: Launching Odoo and logging in

To start Odoo, simply run the init script:

/etc/init.d/odoo start

You should be able to open a browser and connect to your Odoo server IP address on port 80.

The first time you login, the “Create a New Database” page should appear. You should enter the following details to setup the first database:

Master password = [the “admin_password” in /etc/odoo-server.conf]
Select a database name = [any name you want]
Load demonstration data = [I recommend you tick this box for your first database]
Default language = [select your language as appropriate]
Choose a password = [choose a password for your “admin” user]
Confirm password = [confirm a password for your “admin” user]

Click “Create Database” and after a few seconds you should be automatically logged into Odoo as the “admin” user. Hooray!

To login subsequent times, at the login page instead of entering an email address you should enter “admin” and the password you created on the “Create a New Database” page.

If you create multiple databases then you can switch between them by browsing to this address: http://x.x.x.x/web/database/selector (where x.x.x.x is your server IP address)

If something isn’t working, you can check the logfiles in /var/log/messages and /var/log/odoo/odoo-server.log to make sure everything started correctly. Note you can also use “/etc/init.d/odoo restart” and “/etc/init.d/odoo stop” to restart and stop Odoo as required.

tail -50f /var/log/odoo/odoo-server.log

7: Updating Odoo

If you want to update the Odoo code to the latest version you can easily do that by stopping the server then performing a “git pull”. Note that you must only do the git pull as the odoo user.

/etc/init.d/odoo stop
su - odoo
cd /opt/odoo
git pull
exit
/etc/init.d/odoo start

I hope this guide helps you get Odoo 8 up and running on CentOS 6.5. Let me know how you get on in the comment section, and also check out my other tutorials.

Advertisements

187 responses to “Installing Odoo 8 on CentOS 6 with Python 2.7

  1. Richard March 8, 2017 at 4:51 pm

    Hello,

    thanks for the useful tutorial.
    I can start odoo using the command line: openerp-server –config=/etc/odoo/openerp-server.conf –xmlrpc-port=8069 although i had to change the shebang to “#!/usr/bin/env python2.7”

    however I can’t get the init script to work. I get this error:

    Démarrage de Odoo Server Daemon (openerp-server) : [ OK ]

    File “/opt/odoo/openerp-server”, line 2, in
    import openerp
    File “/opt/odoo/openerp/__init__.py”, line 76, in
    import modules
    File “/opt/odoo/openerp/modules/__init__.py”, line 27, in
    from . import db, graph, loading, migration, module, registry
    File “/opt/odoo/openerp/modules/graph.py”, line 32, in
    import openerp.osv as osv
    File “/opt/odoo/openerp/osv/__init__.py”, line 22, in
    import osv
    File “/opt/odoo/openerp/osv/osv.py”, line 23, in
    from .orm import Model, TransientModel, AbstractModel
    File “/opt/odoo/openerp/osv/orm.py”, line 1, in
    import simplejson
    ImportError: No module named simplejson

    Simplejson is installed.
    Any idea? can you share your working init script for CentOS 6 ?
    best regards!

    Like

  2. Eirhylien November 16, 2016 at 11:42 am

    I used your install guide but i have an error :
    UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0xe0 in position 1517: invalid continuation byte

    when i try to create my first database. I use a vanilla/fresh install of odoo and pull git repo today the 11/16. I can’t create database but i can change master pwd.

    I use odoo v8 / python 2.7.9 / pg 8.4.20. thanks

    Like

  3. Javhaa October 20, 2016 at 8:48 am

    Hello
    I followed steps then it works correctly.
    It is format here:
    /sbin/iptables -A INPUT -p tcp –dport 5432 -i lo -j ACCEPT -m comment –comment “Accept local connections to PostgreSQL”
    /sbin/iptables -t nat -I PREROUTING -p tcp –dport 80 -j REDIRECT –to-port 8069 -m comment –comment=”Redirect Odoo HTTP requests to 8069″
    /sbin/iptables -A INPUT -p tcp –dport 8069 -j ACCEPT -m comment –comment “Accept inbound Odoo connections”

    But now need to be connect ssl. I typed above syntax. It doesn’t work now. How can I connect to ssl?
    /sbin/iptables -t nat -I PREROUTING -p tcp –dport 80 -j REDIRECT –to-port 443 -m comment –comment=”Redirect apache 80 -> HTTPS requests to 443″
    /sbin/iptables -t nat -I PREROUTING -p tcp –dport 443 -j REDIRECT –to-port 8069 -m comment –comment=”Redirect Odoo 443 HTTPS requests to 8069″

    Like

  4. linccce September 16, 2016 at 7:56 pm

    Can’t install lxml I get this:

    Collecting lxml
      Using cached lxml-3.6.4-cp27-cp27m-manylinux1_x86_64.whl
    Installing collected packages: lxml
    Exception:
    Traceback (most recent call last):
      File "/opt/odoo/odoo/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
        status = self.run(options, args)
      File "/opt/odoo/odoo/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run
        prefix=options.prefix_path,
      File "/opt/odoo/odoo/lib/python2.7/site-packages/pip/req/req_set.py", line 742, in install
        **kwargs
      File "/opt/odoo/odoo/lib/python2.7/site-packages/pip/req/req_install.py", line 831, in install
        self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
      File "/opt/odoo/odoo/lib/python2.7/site-packages/pip/req/req_install.py", line 1032, in move_wheel_files
        isolated=self.isolated,
      File "/opt/odoo/odoo/lib/python2.7/site-packages/pip/wheel.py", line 346, in move_wheel_files
        clobber(source, lib_dir, True)
      File "/opt/odoo/odoo/lib/python2.7/site-packages/pip/wheel.py", line 317, in clobber
        ensure_dir(destdir)
      File "/opt/odoo/odoo/lib/python2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
        os.makedirs(path)
      File "/opt/odoo/odoo/lib/python2.7/os.py", line 157, in makedirs
        mkdir(name, mode)
    OSError: [Errno 13] Permission denied: '/opt/odoo/odoo/lib/python2.7/site-packages/lxml-3.6.4.dist-info'
    

    when doing this:
    (odoo) [odoo@hosting ndg-httpsclient]$ pip install -b /opt/odoo/ndg-httpsclient --upgrade lxml

    Like

    • linccce September 16, 2016 at 8:12 pm

      Guess -b /opt/odoo solved this one as well. When ran from ~ dir with source odoo/bin/activate applied.

      So basically, just do it like that:

      1. su - odoo
      2. source odoo/bin/activate
      3. pip install -r /opt/odoo/requirements.txt -b /opt/odoo/ -U
      

      Like

  5. linccce September 16, 2016 at 3:29 pm

    How do you reslove these:
    ImportError: /tmp/pip-build-XvaHva/cryptography/.eggs/cffi-1.8.2-py2.7-linux-x86_64.egg/_cffi_backend.so: failed to map segment from shared object: Operation not permitted

    Failed building wheel for cryptography

    ImportError: /tmp/pip-build-XvaHva/cryptography/.eggs/cffi-1.8.2-py2.7-linux-x86_64.egg/_cffi_backend.so: failed to map segment from shared object: Operation not permitted

    —————————————-
    Failed cleaning build dir for cryptography

    ImportError: /tmp/pip-build-XvaHva/cryptography/.eggs/cffi-1.8.2-py2.7-linux-x86_64.egg/_cffi_backend.so: failed to map segment from shared object: Operation not permitted

    —————————————-
    Failed cleaning build dir for cryptography

    Failed to build cryptography

    (odoo) [odoo@hosting ~]$ pip install --upgrade ndg-httpsclient
    Collecting ndg-httpsclient
      Downloading ndg_httpsclient-0.4.2.tar.gz
    Collecting PyOpenSSL (from ndg-httpsclient)
      Downloading pyOpenSSL-16.1.0-py2.py3-none-any.whl (43kB)
        100% |████████████████████████████████| 51kB 1.4MB/s
    Collecting six>=1.5.2 (from PyOpenSSL->ndg-httpsclient)
      Downloading six-1.10.0-py2.py3-none-any.whl
    Collecting cryptography>=1.3.4 (from PyOpenSSL->ndg-httpsclient)
      Downloading cryptography-1.5.tar.gz (400kB)
        100% |████████████████████████████████| 409kB 1.7MB/s
    Collecting idna>=2.0 (from cryptography>=1.3.4->PyOpenSSL->ndg-httpsclient)
      Downloading idna-2.1-py2.py3-none-any.whl (54kB)
        100% |████████████████████████████████| 61kB 4.5MB/s
    Collecting pyasn1>=0.1.8 (from cryptography>=1.3.4->PyOpenSSL->ndg-httpsclient)
      Downloading pyasn1-0.1.9-py2.py3-none-any.whl
    Requirement already up-to-date: setuptools>=11.3 in ./odoo/lib/python2.7/site-packages (from cryptography>=1.3.4->PyOpenSSL->ndg-httpsclient)
    Collecting enum34 (from cryptography>=1.3.4->PyOpenSSL->ndg-httpsclient)
      Downloading enum34-1.1.6-py2-none-any.whl
    Collecting ipaddress (from cryptography>=1.3.4->PyOpenSSL->ndg-httpsclient)
      Downloading ipaddress-1.0.17-py2-none-any.whl
    Collecting cffi>=1.4.1 (from cryptography>=1.3.4->PyOpenSSL->ndg-httpsclient)
      Downloading cffi-1.8.2-cp27-cp27m-manylinux1_x86_64.whl (386kB)
        100% |████████████████████████████████| 389kB 1.4MB/s
    Collecting pycparser (from cffi>=1.4.1->cryptography>=1.3.4->PyOpenSSL->ndg-httpsclient)
      Downloading pycparser-2.14.tar.gz (223kB)
        100% |████████████████████████████████| 225kB 3.6MB/s
    Building wheels for collected packages: ndg-httpsclient, cryptography, pycparser
      Running setup.py bdist_wheel for ndg-httpsclient ... done
      Stored in directory: /home/odoo/.cache/pip/wheels/44/6b/b1/eef816d523c0aa93f350fd2a78d74769e010e2f26623921b76
      Running setup.py bdist_wheel for cryptography ... error
      Complete output from command /home/odoo/odoo/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-XvaHva/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp9ACDuGpip-wheel- --python-tag cp27:
    
      Installed /tmp/pip-build-XvaHva/cryptography/.eggs/cffi-1.8.2-py2.7-linux-x86_64.egg
      Searching for pycparser
      Reading https://pypi.python.org/simple/pycparser/
      Downloading https://pypi.python.org/packages/6d/31/666614af3db0acf377876d48688c5d334b6e493b96d21aa7d332169bee50/pycparser-2.14.tar.gz#md5=a2bc8d28c923b4fe2b2c3b4b51a4f935
      Best match: pycparser 2.14
      Processing pycparser-2.14.tar.gz
      Writing /tmp/easy_install-QPdUwJ/pycparser-2.14/setup.cfg
      Running pycparser-2.14/setup.py -q bdist_egg --dist-dir /tmp/easy_install-QPdUwJ/pycparser-2.14/egg-dist-tmp-VR81V3
      warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
      warning: no previously-included files matching 'lextab.*' found under directory 'tests'
      warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
      warning: no previously-included files matching 'lextab.*' found under directory 'examples'
      zip_safe flag not set; analyzing archive contents...
      Moving pycparser-2.14-py2.7.egg to /tmp/pip-build-XvaHva/cryptography/.eggs
    
      Installed /tmp/pip-build-XvaHva/cryptography/.eggs/pycparser-2.14-py2.7.egg
      Traceback (most recent call last):
        File "", line 1, in 
        File "/tmp/pip-build-XvaHva/cryptography/setup.py", line 334, in 
          **keywords_with_side_effects(sys.argv)
        File "/usr/local/lib/python2.7/distutils/core.py", line 111, in setup
          _setup_distribution = dist = klass(attrs)
        File "/home/odoo/odoo/lib/python2.7/site-packages/setuptools/dist.py", line 318, in __init__
          _Distribution.__init__(self, attrs)
        File "/usr/local/lib/python2.7/distutils/dist.py", line 287, in __init__
          self.finalize_options()
        File "/home/odoo/odoo/lib/python2.7/site-packages/setuptools/dist.py", line 375, in finalize_options
          ep.load()(self, ep.name, value)
        File "/tmp/pip-build-XvaHva/cryptography/.eggs/cffi-1.8.2-py2.7-linux-x86_64.egg/cffi/setuptools_ext.py", line 181, in cffi_modules
          add_cffi_module(dist, cffi_module)
        File "/tmp/pip-build-XvaHva/cryptography/.eggs/cffi-1.8.2-py2.7-linux-x86_64.egg/cffi/setuptools_ext.py", line 48, in add_cffi_module
          execfile(build_file_name, mod_vars)
        File "/tmp/pip-build-XvaHva/cryptography/.eggs/cffi-1.8.2-py2.7-linux-x86_64.egg/cffi/setuptools_ext.py", line 24, in execfile
          exec(code, glob, glob)
        File "src/_cffi_src/build_openssl.py", line 81, in 
          extra_link_args=extra_link_args(compiler_type()),
        File "/tmp/pip-build-XvaHva/cryptography/src/_cffi_src/utils.py", line 61, in build_ffi_for_binding
          extra_link_args=extra_link_args,
        File "/tmp/pip-build-XvaHva/cryptography/src/_cffi_src/utils.py", line 69, in build_ffi
          ffi = FFI()
        File "/tmp/pip-build-XvaHva/cryptography/.eggs/cffi-1.8.2-py2.7-linux-x86_64.egg/cffi/api.py", line 56, in __init__
          import _cffi_backend as backend
      ImportError: /tmp/pip-build-XvaHva/cryptography/.eggs/cffi-1.8.2-py2.7-linux-x86_64.egg/_cffi_backend.so: failed to map segment from shared object: Operation not permitted
    
      ----------------------------------------
      Failed building wheel for cryptography
      Running setup.py clean for cryptography
      Complete output from command /home/odoo/odoo/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-XvaHva/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" clean --all:
      Traceback (most recent call last):
        File "", line 1, in 
        File "/tmp/pip-build-XvaHva/cryptography/setup.py", line 334, in 
          **keywords_with_side_effects(sys.argv)
        File "/usr/local/lib/python2.7/distutils/core.py", line 111, in setup
          _setup_distribution = dist = klass(attrs)
        File "/home/odoo/odoo/lib/python2.7/site-packages/setuptools/dist.py", line 318, in __init__
          _Distribution.__init__(self, attrs)
        File "/usr/local/lib/python2.7/distutils/dist.py", line 287, in __init__
          self.finalize_options()
        File "/home/odoo/odoo/lib/python2.7/site-packages/setuptools/dist.py", line 375, in finalize_options
          ep.load()(self, ep.name, value)
        File "/tmp/pip-build-XvaHva/cryptography/.eggs/cffi-1.8.2-py2.7-linux-x86_64.egg/cffi/setuptools_ext.py", line 181, in cffi_modules
          add_cffi_module(dist, cffi_module)
        File "/tmp/pip-build-XvaHva/cryptography/.eggs/cffi-1.8.2-py2.7-linux-x86_64.egg/cffi/setuptools_ext.py", line 48, in add_cffi_module
          execfile(build_file_name, mod_vars)
        File "/tmp/pip-build-XvaHva/cryptography/.eggs/cffi-1.8.2-py2.7-linux-x86_64.egg/cffi/setuptools_ext.py", line 24, in execfile
          exec(code, glob, glob)
        File "src/_cffi_src/build_openssl.py", line 81, in 
          extra_link_args=extra_link_args(compiler_type()),
        File "/tmp/pip-build-XvaHva/cryptography/src/_cffi_src/utils.py", line 61, in build_ffi_for_binding
          extra_link_args=extra_link_args,
        File "/tmp/pip-build-XvaHva/cryptography/src/_cffi_src/utils.py", line 69, in build_ffi
          ffi = FFI()
        File "/tmp/pip-build-XvaHva/cryptography/.eggs/cffi-1.8.2-py2.7-linux-x86_64.egg/cffi/api.py", line 56, in __init__
          import _cffi_backend as backend
      ImportError: /tmp/pip-build-XvaHva/cryptography/.eggs/cffi-1.8.2-py2.7-linux-x86_64.egg/_cffi_backend.so: failed to map segment from shared object: Operation not permitted
    
      ----------------------------------------
      Failed cleaning build dir for cryptography
      Running setup.py bdist_wheel for pycparser ... done
      Stored in directory: /home/odoo/.cache/pip/wheels/9b/f4/2e/d03e949a551719a1ffcb659f2c63d8444f4df12e994ce52112
    Successfully built ndg-httpsclient pycparser
    Failed to build cryptography
    Installing collected packages: six, idna, pyasn1, enum34, ipaddress, pycparser, cffi, cryptography, PyOpenSSL, ndg-httpsclient
      Running setup.py install for cryptography ... done
    Successfully installed PyOpenSSL-16.1.0 cffi-1.8.2 cryptography-1.5 enum34-1.1.6 idna-2.1 ipaddress-1.0.17 ndg-httpsclient-0.4.2 pyasn1-0.1.9 pycparser-2.14 six-1.10.0
    

    Like

    • daviddean99 September 16, 2016 at 3:39 pm

      Make sure the /tmp partition doesn’t have “noexec” set. Have a look in /etc/fstab.

      Try using an alternative build directory on a partition without “noexec” when running pip with “-b /path/to/build/dir”.

      Like

      • linccce September 16, 2016 at 7:54 pm

        I did this:
        (odoo) [odoo@hosting ndg-httpsclient]$ pip install -b /opt/odoo/ndg-httpsclient --upgrade lxml
        And I got this:

        Requirement already up-to-date: ndg-httpsclient in /opt/odoo/odoo/lib/python2.7/site-packages
        Requirement already up-to-date: PyOpenSSL in /opt/odoo/odoo/lib/python2.7/site-packages (from ndg-httpsclient)
        Requirement already up-to-date: six>=1.5.2 in /opt/odoo/odoo/lib/python2.7/site-packages (from PyOpenSSL->ndg-httpsclient)
        Requirement already up-to-date: cryptography>=1.3.4 in /opt/odoo/odoo/lib/python2.7/site-packages (from PyOpenSSL->ndg-httpsclient)
        Requirement already up-to-date: idna>=2.0 in /opt/odoo/odoo/lib/python2.7/site-packages (from cryptography>=1.3.4->PyOpenSSL->ndg-httpsclient)
        Requirement already up-to-date: pyasn1>=0.1.8 in /opt/odoo/odoo/lib/python2.7/site-packages (from cryptography>=1.3.4->PyOpenSSL->ndg-httpsclient)
        Requirement already up-to-date: setuptools>=11.3 in /opt/odoo/odoo/lib/python2.7/site-packages (from cryptography>=1.3.4->PyOpenSSL->ndg-httpsclient)
        Requirement already up-to-date: enum34 in /opt/odoo/odoo/lib/python2.7/site-packages (from cryptography>=1.3.4->PyOpenSSL->ndg-httpsclient)
        Requirement already up-to-date: ipaddress in /opt/odoo/odoo/lib/python2.7/site-packages (from cryptography>=1.3.4->PyOpenSSL->ndg-httpsclient)
        Requirement already up-to-date: cffi>=1.4.1 in /opt/odoo/odoo/lib/python2.7/site-packages (from cryptography>=1.3.4->PyOpenSSL->ndg-httpsclient)
        Requirement already up-to-date: pycparser in /opt/odoo/odoo/lib/python2.7/site-packages (from cffi>=1.4.1->cryptography>=1.3.4->PyOpenSSL->ndg-httpsclient)
        

        Like

  6. pat August 25, 2016 at 8:56 am

    Hi i execute this command on my server now I cannot access any website.
    what can I do
    /sbin/iptables -A INPUT -p tcp –dport 5432 -i lo -j ACCEPT -m comment –comment “Accept local connections to PostgreSQL”
    /sbin/iptables -t nat -I PREROUTING -p tcp –dport 80 -j REDIRECT –to-port 8069 -m comment –comment=”Redirect Odoo HTTP requests to 8069″
    /sbin/iptables -A INPUT -p tcp –dport 8069 -j ACCEPT -m comment –comment “Accept inbound Odoo connections”
    /etc/init.d/iptables save

    Like

    • daviddean99 August 25, 2016 at 8:59 am

      Are you hosting websites using Apache on the same server as you installed Odoo? If yes, then you won’t be able to use this IPTables rule. Instead you will need to access Odoo using http://yourserverip:8069. My recommendation is to not host anything other than Odoo on the server to make things simpler.

      Like

    • Esteban Adrián Pérez August 25, 2016 at 1:36 pm

      The offending rule is:
      /sbin/iptables -t nat -I PREROUTING -p tcp –dport 80 -j REDIRECT –to-port 8069 -m comment –comment=”Redirect Odoo HTTP requests to 8069″
      Remove it and access your Odoo installation as David suggest…
      With this one you redirect all the http traffic (port 80) to the port 8069 (Odoo’s port) then Apache never receive a request 😉

      Like

  7. Ahmed El-Attar August 10, 2016 at 11:00 pm

    hi All

    I have a problem while installing the ooo 8 on a cents 6.8 server

    I installed everything according to a tutorial, one time from github and another from nighty in both cases when I write

    /etc/init.d/odoo start

    it gives me this

    Starting Odoo Server Daemon (odoo-server): [ OK ]

    root@vps21029 [~]# Traceback (most recent call last):

    File /opt/odoo/openerp-server, line 5, in openerp.cli.main()

    File /opt/odoo/openerp/cli/__init__.py, line 68, in main o.run(args)

    File /opt/odoo/openerp/cli/server.py, line 180, in run main(args)

    File /opt/odoo/openerp/cli/server.py, line 140, in main openerp.tools.config.parse_config(args)

    File /opt/odoo/openerp/tools/config.py, line 359, in parse_config openerp.netsvc.init_logger()

    File /opt/odoo/openerp/netsvc.py, line 138, in init_logger resetlocale()

    File /opt/odoo/openerp/tools/translate.py, line 1110, in resetlocale for ln in get_locales():

    File /opt/odoo/openerp/tools/translate.py, line 1078, in get_locales lang = locale.getdefaultlocale()[0]

    File /home/odoo/odoo/lib/python2.7/locale.py, line 543, in getdefaultlocale return _parse_localename(localename)

    File /home/odoo/odoo/lib/python2.7/locale.py, line 475, in _parse_localename raise

    ValueError, unknown locale: %s % localename

    ValueError: unknown locale: UTF-8

    and stops and I cant access it from any browser

    I tried adding value to the default/locale but no use

    do you have any idea?

    I appreciate your help

    Like

  8. amer August 6, 2016 at 1:14 pm

    Hello daviddean99
    Thanks for that great tutorial
    when i finished all scripts i tried to open localhost and got no result so i tried http://localhost:8069/ i got the following error: Internal Server Error

    The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

    when i checked the error log i found:
    2016-08-06 14:13:40,914 1956 ERROR ? openerp.sql_db: Connection to the database failed
    Traceback (most recent call last):
    File “/opt/odoo/openerp/sql_db.py”, line 560, in borrow
    result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
    File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
    OperationalError: fe_sendauth: no password supplied

    2016-08-06 14:13:40,915 1956 ERROR ? openerp.addons.bus.bus: Bus.loop error, sleep and retry
    Traceback (most recent call last):
    File “/opt/odoo/addons/bus/bus.py”, line 136, in run
    self.loop()
    File “/opt/odoo/addons/bus/bus.py”, line 114, in loop
    with openerp.sql_db.db_connect(‘postgres’).cursor() as cr:
    File “/opt/odoo/openerp/sql_db.py”, line 609, in cursor
    return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
    File “/opt/odoo/openerp/sql_db.py”, line 181, in __init__
    self._cnx = pool.borrow(dsn)
    File “/opt/odoo/openerp/sql_db.py”, line 498, in _locked
    return fun(self, *args, **kwargs)
    File “/opt/odoo/openerp/sql_db.py”, line 560, in borrow
    result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
    File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
    OperationalError: fe_sendauth: no password supplied

    any help please?

    Like

  9. Agustina June 29, 2016 at 11:51 am

    I finally made it, thanks a lot! great post!!

    Like

  10. Agustina June 27, 2016 at 12:06 pm

    Hi daviddean99!
    Thanks for your post!

    I have trouble running the ODOO, when I try “/etc/init.d/odoo start” I get:

    Iniciando Odoo Server Daemon (odoo-server):bash: /root/.bashrc: Permiso denegado
    bash: /home/odoo/odoo/bin/python: No existe el fichero o el directorio
    [ OK ]

    Do you know what did I do wrong? And how can I solve it?
    Thanks!!

    Like

  11. Mike Powell June 15, 2016 at 4:27 pm

    Hello David:

    I’d just like to add that, personally, I found the red comments defining when to run commands as root, and when to run as odoo, a little ambiguous.

    For example, in section 4, I initially interpreted the red comment to mean the box immediately beneath the comment, but it turns out it refers to the entire section. Additionally, in that section, changing user is one thing, but also appears to be vital that one is in the correct directory in order to execute the virtualenv command, so a cd /home/odoo comment might be useful there.

    I think the reason I was confused is that in the next section, section 5, the red comments do refer to the boxes immediately beneath them (and the second box in the case of the git clone and the pip install requirements.txt commands.

    I have never been able to make the automatic password generation work and populate into the config file, so I did that manually each time.

    Other than that, as almost universally stated, this tutorial takes the sting out of a very complicated installation, and now I have a working Odoo server ready to configure, so thank you again.

    Regards
    Mike.

    Like

  12. Mike Powell June 15, 2016 at 4:18 pm

    CentOS 6.5 running on VPS

    Hi David – Again thank you for putting this tutorial together. To be honest, I’m asking a lot, and ignoring your advice and installing on a VPS with a Magento shop, multiple other websites and a Zimbra mail server. However, I’ve done in, but came across this issue which took a bit of headbanging to get over:

    In my case, the default PostgreSQL install with a non UTF8 encoding (SQL_ASCII), something which I found Odoo does not like, as I found out when I came to the stage where I create my first database, I got a “DataError: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)”

    It turns out, for me at least, the the issue was with the initialisation of the PostgreSQL database in section 2.

    I found that running the standard service postgresql-9.5 initdb was the issue, and that if I was able to explicitely specify during the initialisation, this issue went away as follows (for CentOS 6.5):

    1. Change user to postgres: su postgres
    2. Navigate to where the initdb executable is located: cd /usr/pgsql-9.5/bin
    3. Switch user to postgreSQL owner: su postgres
    3. Execute initdb, passing the encoding and data location as follows: ./initdb -E UTF8 -D /var/lib/pgsql/9.5/data
    4. Now, PostgreSQL is initialised in a way that Odoo likes, and database creation can continue.

    Regards,
    Mike.

    Like

  13. Mike Powell June 14, 2016 at 7:56 pm

    Hi David, thank you for this tutorial. To be honest, I’m having problems, and maybe I’ll post a question a bit later. Meanwhile though, in section 3, where Python is being downloaded and installed, shouldn’t the first line read ‘rm -rf /usr/local/lib/python2.7’ rather than ‘…python2.9?’. Thanks, Mike.

    Like

  14. daviddean99 May 28, 2016 at 4:52 pm

    A big thank you to everyone who has taken the time to comment on my tutorial. Today I have updated it to fix some broken links, update versions, tidy up the instructions and generally improve it. It’s now working perfectly on CentOS 6.5. Enjoy!

    Like

    • Erastus Grassie Coetzee May 29, 2016 at 4:06 pm

      Can any one please help me. I followed the guide. Got no errors. If I do the commeand ps -ef I get:
      ps -ef | grep pyth
      odoo 2739 1 0 17:27 ? 00:00:04 /home/odoo/odoo/bin/python /opt/odoo/openerp-server -c /etc/odoo-server.conf –pidfile=/var/run/odoo/odoo-server.pid –logfile=/var/log/odoo/odoo-server.log

      But I can not connect to odoo. I also disable the firewall. If I do # tail -50f /var/log/odoo/odoo-server.log. File is empty. Any way I can do more checks? My first try on odoo.|
      THank you and than you for the tutorial

      Like

      • daviddean99 May 29, 2016 at 4:42 pm

        If you have disabled the firewall then the redirect from port 80 to 8069 won’t work. Try browsing to http://x.x.x.x:8069 where x.x.x.x equals your server IP address. Hopefully you should see the database manager website. If not then you should see some errors in the Odoo logs. Also try checking /var/log/messages to see if you have any errors there. Good luck!

        Like

        • Erastus Coetzee May 29, 2016 at 4:47 pm

          Hi David,

          Many thanls :8069 worked
          I did try it but now it is working.
          gr8 tutorial!!!!!

          Like

        • Erastus Coetzee May 29, 2016 at 5:01 pm

          THis is working and I am creating my database. Many thanls will see how it goes

          Like

        • Erastus Coetzee May 30, 2016 at 9:54 am

          David,

          Compliments on the nice tutorial. It works very well. I had to adapt a a few commands as I am using a 32 bit system. This was very easy. I also checked it is better to install centos without progres db. It works better that way with your script. Also had to change two line of rpm. For that I used the browser down loaded it and installed it.

          Other than that it simply worked. Will check why the firewall is creating a problem with port forwarding. But then it is better to simply use 8069. I tried a few procedures asked for help. Eventually I got yours on google and then voila it all is working.

          Many thanks!!!

          Like

    • Bun Hin August 2, 2016 at 11:52 am

      Hi David,
      Several times installing odoo with this tutorial (also with tutorial for install in centos 7) and success.

      A bit annoying with error message IOError (13) permission error for /odoo/lib64/lib-dynload/..zlibmodule.so,
      when starting the odoo server although it is running, then I check that the modules (zlibmodule.so) actually not there in the Lib or Lib64 of odoo, then i copy the modul into path pointed by the error. This causing the odoo can not be started at all, saying that to many level of symlink,

      then i remove again the module, but the odoo server still can not start, the error message only fail to start.

      Then i remove the python (reintalling the python, and the modules), but still can not start.

      Could you please give me a clue to how to recover from this error.

      I look in error log, there are no record after since this fail to start happen.

      Please help.

      Thank you,
      Bun

      Like

  15. Esteban May 27, 2016 at 7:49 pm

    I know this is an old guide… But, there was some changes actually…

    Step 3:
    wkhtmltopdf was moved and you need install this before to avoid dependencies error …
    # yum install xorg-x11-fonts-75dpi

    then, install wkhtmltopdf
    # rpm -ivh http://download.gna.org/wkhtmltopdf/0.12/0.12.2/wkhtmltox-0.12.2_linux-centos6-amd64.rpm

    The package libmspack was updated:
    # rpm -ivh https://dl.fedoraproject.org/pub/epel/6/x86_64/libmspack-0.5-0.1.alpha.el6.x86_64.rpm
    (Usually it’s already installed)

    The same for cabextract:
    # rpm -ivh https://dl.fedoraproject.org/pub/epel/6/x86_64/cabextract-1.5-1.el6.x86_64.rpm

    ez_setup.py was moved too:
    # wget https://bootstrap.pypa.io/ez_setup.py -O – | /usr/local/bin/python2.7

    Just for do it more simple:
    To avoid the warning about SNIMissingWarnin and SNIMissingWarning update ndg-httpsclient
    $ pip install –upgrade ndg-httpsclient

    And then install the libraries:
    $ pip install http://download.gna.org/pychart/PyChart-1.39.tar.gz babel docutils feedparser gdata Jinja2 mako mock psutil psycopg2 pydot python-dateutil python-openid pytz pywebdav pyyaml reportlab simplejson unittest2 vatnumber vobject werkzeug xlwt pyopenssl lxml python-ldap decorator requests pillow pyPdf passlib

    With these updates, the installation was successfull in a CentOS 6.7…

    PS: Why I’m using this guide instead other more actual? Because it’s the most detailed and accurate… And the instructions for 9 are a nightmare…

    Like

  16. Gourav April 19, 2016 at 8:29 am

    Works well. Though a few links are broken now which need to be updated.

    These are the ones:
    yum -y install xorg-x11-fonts-75dpi : dependency for below
    rpm -ivh http://download.gna.org/wkhtmltopdf/0.12/0.12.2/wkhtmltox-0.12.2_linux-centos6-amd64.rpm

    core fonts:
    rpm -ivh https://dl.fedoraproject.org/pub/epel/6/x86_64/libmspack-0.5-0.1.alpha.el6.x86_64.rpm
    rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/cabextract-1.5-1.el6.x86_64.rpm

    Like

  17. Raj Maharjan March 15, 2016 at 6:38 am

    /etc/init.d/odoo start
    Starting Odoo Server Daemon (odoo-server): [ OK ]
    [root@software ~]# Traceback (most recent call last):
    File “/opt/odoo/openerp-server”, line 2, in
    import openerp
    File “/opt/odoo/openerp/__init__.py”, line 76, in
    import modules
    File “/opt/odoo/openerp/modules/__init__.py”, line 27, in
    from . import db, graph, loading, migration, module, registry
    File “/opt/odoo/openerp/modules/graph.py”, line 32, in
    import openerp.osv as osv
    File “/opt/odoo/openerp/osv/__init__.py”, line 22, in
    import osv
    File “/opt/odoo/openerp/osv/osv.py”, line 23, in
    from .orm import Model, TransientModel, AbstractModel
    File “/opt/odoo/openerp/osv/orm.py”, line 2, in
    from lxml import etree
    ImportError: /home/odoo/odoo/lib/python2.7/site-packages/lxml/etree.so: undefined symbol: PyUnicodeUCS2_DecodeLatin1

    Like

  18. raid February 19, 2016 at 3:56 am

    /etc/init.d/odoo start
    Starting Odoo Server Daemon (odoo-server): [ OK ]
    [root@software ~]# Traceback (most recent call last):
    File “/opt/odoo/openerp-server”, line 2, in
    import openerp
    File “/opt/odoo/openerp/__init__.py”, line 76, in
    import modules
    File “/opt/odoo/openerp/modules/__init__.py”, line 27, in
    from . import db, graph, loading, migration, module, registry
    File “/opt/odoo/openerp/modules/graph.py”, line 32, in
    import openerp.osv as osv
    File “/opt/odoo/openerp/osv/__init__.py”, line 22, in
    import osv
    File “/opt/odoo/openerp/osv/osv.py”, line 23, in
    from .orm import Model, TransientModel, AbstractModel
    File “/opt/odoo/openerp/osv/orm.py”, line 2, in
    from lxml import etree
    ImportError: No module named lxml
    i have already installed lxml as well
    pip install lxml
    Requirement already satisfied (use –upgrade to upgrade): lxml in /usr/local/lib/python2.7/site-packages

    Like

  19. bunhin January 18, 2016 at 4:09 am

    Hi David,

    I have odoo v8 installed follow this tutorial and it works, now can I install odoo v9 in the same machine side by side without disturbing odoo v8? How to do that?

    Would you please write step by step guide?

    Thank you,
    Bun

    Like

  20. Hardik Shah September 9, 2015 at 4:39 pm

    I prefer using pip install -r requrements.txt as this has right versions of python dependencies. @David, please see if you want to amend your text.

    Like

  21. patsigma September 8, 2015 at 5:14 pm

    Traceback (most recent call last):
    File “/opt/odoo/openerp/http.py”, line 537, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
    File “/opt/odoo/openerp/http.py”, line 574, in dispatch
    result = self._call_function(**self.params)
    File “/opt/odoo/openerp/http.py”, line 311, in _call_function
    return self.endpoint(*args, **kwargs)
    File “/opt/odoo/openerp/http.py”, line 803, in __call__
    return self.method(*args, **kw)
    File “/opt/odoo/openerp/http.py”, line 403, in response_wrap
    response = f(*args, **kw)
    File “/opt/odoo/addons/web/controllers/main.py”, line 704, in create
    params[‘create_admin_pwd’])
    File “/opt/odoo/openerp/http.py”, line 879, in proxy_method
    result = dispatch_rpc(self.service_name, method, args)
    File “/opt/odoo/openerp/http.py”, line 115, in dispatch_rpc
    result = dispatch(method, params)
    File “/opt/odoo/openerp/service/db.py”, line 65, in dispatch
    security.check_super(passwd)
    File “/opt/odoo/openerp/service/security.py”, line 32, in check_super
    raise openerp.exceptions.AccessDenied()
    AccessDenied: Access denied.

    Like

  22. Ignatius Matimu August 28, 2015 at 6:47 am

    Hey awesome tutorial
    I have this

    admin_passwd = $ODOO_DB_ADMIN_PASSWORD
    ; DATABASE OPTIONS
    db_host = localhost
    db_port = 5432
    db_user = odoo
    db_password = $ODOO_POSTGRES_PASSWORD

    and still get error

    File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
    OperationalError: FATAL: password authentication failed for user “odoo”

    Like

  23. Houses August 6, 2015 at 3:17 pm

    That is because in /etc/odoo-server.conf you have to change:

    admin_passwd = $ODOO_DB_ADMIN_PASSWORD <— put here the password
    ; DATABASE OPTIONS
    db_host = localhost
    db_port = 5432
    db_user = odoo
    db_password = $ODOO_POSTGRES_PASSWORD <— put here the password

    If you don't know the pass autogenerated, you can write this:

    echo $ODOO_DB_ADMIN_PASSWORD
    echo $ODOO_POSTGRES_PASSWORD

    And the system will tell you the pass generated.

    Like

  24. Artem July 29, 2015 at 11:38 am

    hello
    The same problem
    2015-07-29 11:19:47,564 6143 ERROR ? openerp.addons.bus.bus: Bus.loop error, sleep and retry
    Traceback (most recent call last):
    File “/opt/odoo/addons/bus/bus.py”, line 136, in run
    self.loop()
    File “/opt/odoo/addons/bus/bus.py”, line 114, in loop
    with openerp.sql_db.db_connect(‘postgres’).cursor() as cr:
    File “/opt/odoo/openerp/sql_db.py”, line 575, in cursor
    return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
    File “/opt/odoo/openerp/sql_db.py”, line 181, in __init__
    self._cnx = pool.borrow(dsn)
    File “/opt/odoo/openerp/sql_db.py”, line 464, in _locked
    return fun(self, *args, **kwargs)
    File “/opt/odoo/openerp/sql_db.py”, line 526, in borrow
    result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
    File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
    OperationalError: fe_sendauth: no password supplied

    Like

  25. ajeet July 23, 2015 at 8:03 am

    When i run using http://107.6.166.82/
    Internal Server Error

    The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

    perhaps in tutorial port 8069 diverted to 80 and apache server is not working .please help

    Like

  26. ajeet July 23, 2015 at 8:00 am

    when i am giving command /etc/init.d/odoo start

    Starting Odoo Server Daemon (odoo-server): [ OK ]
    root@serv01 [~]# /home/odoo/odoo/bin/python: can’t open file ‘/opt/odoo/odoo-server’: [Errno 2] No such file or directory

    Like

  27. ajeet July 23, 2015 at 7:31 am

    /home/odoo/odoo/bin/python: can’t open file ‘/opt/odoo/odoo-server’: [Errno 2] No such file or directory

    Like

  28. Omar June 26, 2015 at 11:57 am

    try to follow this article, i got this error:

    Traceback (most recent call last):
    File “/opt/odoo/openerp-server”, line 2, in
    import openerp
    File “/opt/odoo/openerp/__init__.py”, line 76, in
    import modules
    File “/opt/odoo/openerp/modules/__init__.py”, line 27, in
    from . import db, graph, loading, migration, module, registry
    File “/opt/odoo/openerp/modules/graph.py”, line 32, in
    import openerp.osv as osv
    File “/opt/odoo/openerp/osv/__init__.py”, line 22, in
    import osv
    File “/opt/odoo/openerp/osv/osv.py”, line 23, in
    from .orm import Model, TransientModel, AbstractModel
    File “/opt/odoo/openerp/osv/orm.py”, line 5, in
    from ..models import (
    File “/opt/odoo/openerp/models.py”, line 54, in
    import babel.dates
    ImportError: No module named babel.dates

    It means that the package babel is not installed !!

    Like

  29. mobin June 17, 2015 at 10:16 am

    Hello,

    I have configured the oddo as per your document and i did the insatllation successfully but i am getting error page “Internal Server Error”

    The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

    # tail -50f /var/log/odoo/odoo-server.log
    File “/opt/odoo/openerp/sql_db.py”, line 464, in _locked
    return fun(self, *args, **kwargs)
    File “/opt/odoo/openerp/sql_db.py”, line 526, in borrow
    result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
    File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
    OperationalError: fe_sendauth: no password supplied
    2015-06-17 10:09:13,498 13107 ERROR None werkzeug: Error on request:
    Traceback (most recent call last):
    File “/home/odoo/odoo/lib/python2.7/site-packages/werkzeug/serving.py”, line 180, in run_wsgi
    execute(self.server.app)
    File “/home/odoo/odoo/lib/python2.7/site-packages/werkzeug/serving.py”, line 168, in execute
    application_iter = app(environ, start_response)
    File “/opt/odoo/openerp/service/server.py”, line 290, in app
    return self.app(e, s)
    File “/opt/odoo/openerp/service/wsgi_server.py”, line 216, in application
    return application_unproxied(environ, start_response)
    File “/opt/odoo/openerp/service/wsgi_server.py”, line 202, in application_unproxied
    result = handler(environ, start_response)
    File “/opt/odoo/openerp/http.py”, line 1290, in __call__
    return self.dispatch(environ, start_response)
    File “/opt/odoo/openerp/http.py”, line 1264, in __call__
    return self.app(environ, start_wrapped)
    File “/home/odoo/odoo/lib/python2.7/site-packages/werkzeug/wsgi.py”, line 591, in __call__
    return self.app(environ, start_response)
    File “/opt/odoo/openerp/http.py”, line 1406, in dispatch
    self.setup_db(httprequest)
    File “/opt/odoo/openerp/http.py”, line 1348, in setup_db
    httprequest.session.db = db_monodb(httprequest)
    File “/opt/odoo/openerp/http.py”, line 1478, in db_monodb
    dbs = db_list(True, httprequest)
    File “/opt/odoo/openerp/http.py”, line 1452, in db_list
    dbs = dispatch_rpc(“db”, “list”, [force])
    File “/opt/odoo/openerp/http.py”, line 115, in dispatch_rpc
    result = dispatch(method, params)
    File “/opt/odoo/openerp/service/db.py”, line 73, in dispatch
    return fn(*params)
    File “/opt/odoo/openerp/service/db.py”, line 313, in exp_list
    with closing(db.cursor()) as cr:
    File “/opt/odoo/openerp/sql_db.py”, line 575, in cursor
    return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
    File “/opt/odoo/openerp/sql_db.py”, line 181, in __init__
    self._cnx = pool.borrow(dsn)
    File “/opt/odoo/openerp/sql_db.py”, line 464, in _locked
    return fun(self, *args, **kwargs)
    File “/opt/odoo/openerp/sql_db.py”, line 526, in borrow
    result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
    File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
    OperationalError: fe_sendauth: no password supplied

    Like

  30. Costin June 4, 2015 at 8:49 am

    Hello

    PLEASE PLEASE Help !!!
    All your procedure worked like a charm with no errors. the service starts with no error, everything in OK, in log there are no errors, but i have no port opened. I performed a strace on the odoo process and there is nothing there…

    “Process 2806 attached – interrupt to quit
    select(0, NULL, NULL, NULL, {24, 891503}
    ) = 0 (Timeout)
    select(0, NULL, NULL, NULL, {60, 0}) = 0 (Timeout)
    select(0, NULL, NULL, NULL, {60, 0}) = 0 (Timeout)
    select(0, NULL, NULL, NULL, {60, 0}) = 0 (Timeout)
    select(0, NULL, NULL, NULL, {60, 0}) = 0 (Timeout)
    select(0, NULL, NULL, NULL, {60, 0}) = 0 (Timeout)
    select(0, NULL, NULL, NULL, {60, 0}^C
    Process 2806 detached”

    I deactivated selinux, restarted server, changed the loglevel in odoo-server.conf from warning to debug and again there is nothing there:

    2015-06-04 11:45:21,753 1257 DEBUG ? openerp.netsvc: logger level set: “openerp.workflow.workitem:WARNING”
    2015-06-04 11:45:21,754 1257 DEBUG ? openerp.netsvc: logger level set: “openerp.http.rpc.request:INFO”
    2015-06-04 11:45:21,754 1257 DEBUG ? openerp.netsvc: logger level set: “openerp.http.rpc.response:INFO”
    2015-06-04 11:45:21,755 1257 DEBUG ? openerp.netsvc: logger level set: “openerp.addons.web.http:INFO”
    2015-06-04 11:45:21,755 1257 DEBUG ? openerp.netsvc: logger level set: “openerp.sql_db:INFO”
    2015-06-04 11:45:21,755 1257 DEBUG ? openerp.netsvc: logger level set: “:INFO”
    2015-06-04 11:45:21,755 1257 DEBUG ? openerp.netsvc: logger level set: “openerp:DEBUG”
    2015-06-04 11:45:21,755 1257 DEBUG ? openerp.netsvc: logger level set: “werkzeug:DEBUG”
    2015-06-04 11:45:21,756 1257 INFO ? openerp: OpenERP version 8.0
    2015-06-04 11:45:21,756 1257 INFO ? openerp: addons paths: [‘/home/odoo/.local/share/Odoo/addons/8.0′, u’/opt/odoo/openerp/addons’, u’/opt/odoo/addons’]
    2015-06-04 11:45:21,756 1257 INFO ? openerp: database hostname: localhost
    2015-06-04 11:45:21,756 1257 INFO ? openerp: database port: 5432
    2015-06-04 11:45:21,757 1257 INFO ? openerp: database user: odoo
    2015-06-04 11:45:22,195 1257 DEBUG ? openerp.service.server: Setting signal handlers
    2015-06-04 11:45:22,196 1257 INFO ? openerp.service.server: HTTP service (werkzeug) running on 0.0.0.0:8069
    2015-06-04 11:45:22,203 1257 DEBUG ? openerp.service.server: cron0 started!
    2015-06-04 11:45:22,204 1257 DEBUG ? openerp.service.server: cron1 started!”

    output of ps:

    odoo 1257 4.0 2.4 145648 94812 ? Sl 14:45 0:04 /home/odoo/odoo/bin/python /opt/odoo/openerp-server -c /etc/odoo-server.conf –pidfile=/var/run/odoo/odoo-server.pid –logfile=/var/log/odoo/odoo-server.log

    server config file:

    [options]
    ; This is the password that allows database operations:
    admin_passwd = 7fje_zpo5jodWOraxW8r
    ; DATABASE OPTIONS
    db_host = localhost
    db_port = 5432
    db_user = odoo
    db_password = mVn33eveTXa9ZCIT7pXh
    ; MISC SETTINGS
    ; LOG SETTINGS
    logfile = /var/log/odoo/odoo-server.log
    log_handler = werkzeug:DEBUG
    log_level = debug
    no-logrotate = True

    Like

  31. Mohammed Arif Mazumder May 24, 2015 at 5:26 pm

    Works like a charm for Centos 6.6. Thanks heaps.

    Like

  32. gemchand sahu May 23, 2015 at 10:23 am

    When I try edit anything on odoo and tried to access from browser but received “This webpage is not available”

    Like

  33. gemchand sahu May 23, 2015 at 7:38 am

    Install seemed to go well, no errors. Odoo started fine [ok], then tried to access from browser but received “This webpage is not available” . There are no entries in odoo-server.log
    self._cnx = pool.borrow(dsn)
    File “/opt/odoo/openerp/sql_db.py”, line 464, in _locked
    return fun(self, *args, **kwargs)
    File “/opt/odoo/openerp/sql_db.py”, line 526, in borrow
    result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
    File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
    OperationalError: could not connect to server: Connection refused
    Is the server running on host “localhost” (::1) and accepting
    TCP/IP connections on port 5432?
    could not connect to server: Connection refused
    Is the server running on host “localhost” (127.0.0.1) and accepting
    TCP/IP connections on port 5432?

    2015-05-22 09:35:46,491 23109 ERROR ? openerp.sql_db: Connection to the database failed
    Traceback (most recent call last):
    File “/opt/odoo/openerp/sql_db.py”, line 526, in borrow
    result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
    File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
    OperationalError: could not connect to server: Connection refused
    Is the server running on host “localhost” (::1) and accepting
    TCP/IP connections on port 5432?
    could not connect to server: Connection refused
    Is the server running on host “localhost” (127.0.0.1) and accepting
    TCP/IP connections on port 5432?

    2015-05-22 09:35:46,491 23109 ERROR ? openerp.addons.bus.bus: Bus.loop error, sleep and retry
    Traceback (most recent call last):
    File “/opt/odoo/addons/bus/bus.py”, line 136, in run
    self.loop()
    File “/opt/odoo/addons/bus/bus.py”, line 114, in loop
    with openerp.sql_db.db_connect(‘postgres’).cursor() as cr:
    File “/opt/odoo/openerp/sql_db.py”, line 575, in cursor
    return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
    File “/opt/odoo/openerp/sql_db.py”, line 181, in __init__
    self._cnx = pool.borrow(dsn)
    File “/opt/odoo/openerp/sql_db.py”, line 464, in _locked
    return fun(self, *args, **kwargs)
    File “/opt/odoo/openerp/sql_db.py”, line 526, in borrow
    result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
    File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
    OperationalError: could not connect to server: Connection refused
    Is the server running on host “localhost” (::1) and accepting
    TCP/IP connections on port 5432?
    could not connect to server: Connection refused
    Is the server running on host “localhost” (127.0.0.1) and accepting
    TCP/IP connections on port 5432?

    How to fix this error

    Like

  34. bytesun May 22, 2015 at 5:19 pm

    i followed steps and it works like a charm

    Thanks

    Like

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: