Troubleshooting Odoo Installation on CentOS 6.6
When installing and configuring Odoo (formerly OpenERP) on CentOS 6.6, various issues might arise due to the older nature of the operating system and dependencies. Below is a guide to address common errors and ensure a smooth installation and configuration process.
Common Errors and Their Solutions
- Python Version Issues:
Odoo requires Python 2.7 or higher, but CentOS 6.6 ships with Python 2.6 by default. Solution:
- Install Python 2.7 alongside the default Python version.
# Install the IUS repository to get newer versions of Python
sudo yum install -y https://repo.ius.io/ius-release-el6.rpm
# Install Python 2.7
sudo yum install -y python27
# Verify the installation
/usr/bin/python2.7 --version
- You may need to create a symbolic link for
python2.7
:
sudo ln -s /usr/bin/python2.7 /usr/local/bin/python2.7
- Dependency Errors:
Odoo has several dependencies that may not be available in the default CentOS 6 repositories. Solution:
- Enable EPEL repository and install dependencies.
# Enable EPEL repository
sudo yum install -y epel-release
# Install essential build tools and dependencies
sudo yum install -y gcc libxslt-devel libxml2-devel libjpeg-devel openldap-devel libpng-devel nodejs npm
# Install additional Python dependencies
sudo yum install -y python27-pip python27-devel
- Use
pip
to install Python packages required by Odoo:
sudo pip2.7 install -r requirements.txt
The requirements.txt
file should include Odoo’s Python dependencies. If you don’t have this file, you can manually install packages like psycopg2
, babel
, pillow
, etc.
- PostgreSQL Issues:
Odoo requires PostgreSQL. CentOS 6.6 may have an outdated PostgreSQL version, while Odoo requires version 9.4 or higher. Solution:
- Install a newer version of PostgreSQL.
# Install the PostgreSQL 9.4 repository
sudo yum install -y https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-6.6-x86_64/pgdg-centos94-9.4-3.noarch.rpm
# Install PostgreSQL 9.4
sudo yum install -y postgresql94-server postgresql94-contrib
# Initialize PostgreSQL
sudo service postgresql-9.4 initdb
# Start PostgreSQL
sudo service postgresql-9.4 start
# Enable PostgreSQL to start on boot
sudo chkconfig postgresql-9.4 on
- Create a PostgreSQL user and database for Odoo.
sudo -u postgres createuser -s odoo
sudo -u postgres createdb -O odoo odoo_db
- Missing Libraries or Modules:
During Odoo startup, you might encounter missing library errors. Solution:
- Identify and install the missing libraries. For example, if the error mentions
libxml2
, install it via:
sudo yum install -y libxml2 libxml2-devel
- Similarly, for other libraries, find the appropriate packages and install them.
5. Configuration File Issues:
The Odoo configuration file (odoo.conf
) might be misconfigured, leading to startup issues. Solution:
- Ensure your
odoo.conf
file has correct settings:
[options]
; This is the password that allows database operations:
admin_passwd = your_admin_password
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /path/to/your/addons
logfile = /var/log/odoo/odoo.log
- Make sure the directories mentioned (like
addons_path
andlogfile
) exist and have the correct permissions.
6. Port Conflicts:
Odoo runs on a default port (8069), which might be in use by another service. Solution:
- Check if the port is in use:
sudo netstat -tuln | grep 8069
- If it’s in use, you can change Odoo’s port in the
odoo.conf
file:
[options]
xmlrpc_port = 8070 # Change to a different port number
- Restart the Odoo service after making changes:
sudo service odoo restart
- File Permissions:
Odoo might not start if it lacks permissions to read its files or directories. Solution:
- Ensure Odoo has the necessary permissions for its files and directories.
sudo chown -R odoo:odoo /path/to/odoo/directory
sudo chmod -R 755 /path/to/odoo/directory
General Troubleshooting Tips
- Check Logs:
- Always check the logs in
/var/log/odoo/odoo.log
for detailed error messages. - Use
tail -f /var/log/odoo/odoo.log
to follow the log in real-time.
2. Verify Services:
- Ensure that all required services (like PostgreSQL) are running.
- Use commands like
service postgresql-9.4 status
andservice odoo status
to check their statuses.
3. Dependency Verification:
- Make sure all dependencies are installed and compatible with your Odoo version. Use tools like
pip2.7 list
to list installed Python packages and their versions.
4. Environment Variables:
- Verify that environment variables, such as the PATH, are correctly set to include directories for Python 2.7 and other required binaries.
Conclusion
When installing Odoo on CentOS 6.6, various issues might arise due to the older nature of the operating system and dependencies. There are various key functions for ensuring the correct Python version, satisfying dependencies, configuring PostgreSQL, resolving port conflicts, and verifying file permissions. After following all the troubleshooting steps, you can effectively diagnose and fix configuration errors, ensuring a stable Odoo server solution that supports your business operations reliably.