0
votes

ive been having issues with setup for odoo v13 on an ubunu 18.04 (apache2)

ive been able to test/develop via odoo-bin but trying to put it live from my local machine (we have a proxy on our network but for now i wanna get it running so i can get it ) ive setup the odoo.conf to spit out errors odoo-error.log well it does spit some errors. but only aftersystemctl restart apache2 then it stops

Truncated or oversized response headers received from daemon process 'admin': /opt/odoo13/E-Forms/odoo/setup/odoo-wsgi.py

ive done all the permission access for the directories but what i find weird with apache is that in the default error file i get this

Fatal Python error: Py_Initialize: Unable to get the locale encoding ModuleNotFoundError: No module named 'encodings

and its continuous which has me confused if i am telling virtualhost hey put all my errors at odoo-error.log why is error.log still getting filled continuously but i expect that isnt related to my problem

here is my conf

    ServerName test.eforms.com
    ServerAlias test.eforms.com 127.0.0.1

    ErrorLog ${APACHE_LOG_DIR}/odoo-error.log
    CustomLog ${APACHE_LOG_DIR}/odoo-access.log combined
    LogLevel info

    <Directory /opt/odoo13/E-Forms>
        Require all granted
    </Directory>
    <Directory /opt/odoo13/E-Forms/odoo/setup>
        <Files odoo-wsgi.py>
            Require all granted
        </Files>
    </Directory>

    WSGIDaemonProcess admin user=admin group=admin processes=1 python-home=/opt/odoo13/Venv/odoovenv/bin/ python-path=/opt/odoo13/E-Forms/odoo
    WSGIProcessGroup admin
    WSGIScriptAlias / /opt/odoo13/E-Forms/odoo/setup/odoo-wsgi.py
    WSGIApplicationGroup %{GLOBAL}

</VirtualHost>

here is my odoo-wsgi.py ( this is a copy from cloning )

import odoo

#----------------------------------------------------------
# Common
#----------------------------------------------------------
odoo.multi_process = True # Nah!
# Equivalent of --load command-line option
odoo.conf.server_wide_modules = ['base','web']
conf = odoo.tools.config
# Path to the OpenERP Addons repository (comma-separated for
# multiple locations)
conf['addons_path'] = '/opt/odoo13/E-Forms/odoo/addons,/opt/odoo13/E-Forms/odoo/custom'
# Optional database config if not using local socket
conf['db_name'] = 'EForm'
conf['db_host'] = 'localhost'
conf['db_user'] = 'odoo'
conf['db_port'] = 5432
conf['db_password'] = 'password'
#----------------------------------------------------------
# Generic WSGI handlers application
#----------------------------------------------------------
application = odoo.service.wsgi_server.application

odoo.service.server.load_server_wide_modules()
#----------------------------------------------------------
# Gunicorn
#----------------------------------------------------------
# Standard OpenERP XML-RPC port is 8069
bind = '127.0.0.1:80'
pidfile = '.gunicorn.pid'
workers = 1
timeout = 1200

and my apache2.conf here

ServerName test.eforms.com


DefaultRuntimeDir ${APACHE_RUN_DIR}


PidFile ${APACHE_PID_FILE}

Timeout 900


KeepAlive On


MaxKeepAliveRequests 100


KeepAliveTimeout 5

User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}


HostnameLookups On

ErrorLog ${APACHE_LOG_DIR}/error.log


#LogLevel info

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# Include list of ports to listen on
Include ports.conf



<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

AccessFileName .htaccess


<FilesMatch "^\.ht">
    Require all denied
</FilesMatch>

LoadModule wsgi_module modules/mod_wsgi.so

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent


# see README.Debian for details.


IncludeOptional conf-enabled/*.conf


IncludeOptional sites-enabled/*.conf

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

i downloaded mod_wsgi.so from source and installed it below is a list of all installed apt packages for just apache2

apache2/bionic-updates,bionic-security,now 2.4.29-1ubuntu4.11 amd64 [installed] apache2-bin/bionic-updates,bionic-security,now 2.4.29-1ubuntu4.11 amd64 [installed,automatic] apache2-data/bionic-updates,bionic-updates,bionic-security,bionic-security,now 2.4.29-1ubuntu4.11 all [installed,automatic] apache2-dev/bionic-updates,bionic-security,now 2.4.29-1ubuntu4.11 amd64 [installed] apache2-utils/bionic-updates,bionic-security,now 2.4.29-1ubuntu4.11 amd64 [installed,automatic] libapache2-mod-wsgi-py3/bionic,now 4.5.17-1 amd64 [installed]

and my pip freeze

Babel==2.3.4 certifi==2019.9.11 chardet==3.0.4 decorator==4.0.10 Django==2.2.6 docopt==0.6.2 docutils==0.12 h11==0.8.1 h2==3.1.1 hpack==3.0.0 html2text==2019.9.26 hyperframe==5.2.0 idna==2.8 image==1.5.27 Jinja2==2.10.3 libsass==0.19.3 lxml==4.4.1 MarkupSafe==1.1.1 num2words==0.5.10 passlib==1.7.1 Pillow==6.2.0 pkg-resources==0.0.0 polib==1.1.0 psutil==5.6.3 psycogreen==1.0.1 psycopg2==2.8.4 psycopg2-binary==2.8.4 pyasn1==0.4.7 pyasn1-modules==0.2.7 pyldap==3.0.0.post1 PyPDF2==1.26.0 python-dateutil==2.8.0 python-ldap==3.2.0 python-openid==2.2.5 python-stdnum==1.11 pytz==2016.7 reportlab==3.5.28 requests==2.22.0 rfc3986==1.3.2 six==1.12.0 sqlparse==0.3.0 urllib3==1.25.6 Werkzeug==0.16.0 xlwt==1.3.0

1

1 Answers

0
votes

after three days of head scratching i finally found out the issue and it was this line

python-home=/opt/odoo13/Venv/odoovenv/bin/

which should be this

python-home=/opt/odoo13/Venv/odoovenv/

so anybody getting issues like this in the future here some advice

  • double check your mod_wsgi is using the same version of python as your virtualenv
  • ensure you update all your software packages ( i use ubuntu so that will be apt)
  • make sure the wsgiprocessgroup has all rwx for the directory and SUB DIRECTORIES where you host your application (maybe not write )