muk_base
muk_base copied to clipboard
[11.0] session_store with worker > 0
Hi,
I am trying to use muk_session_store
module with config worker = 10
on Odoo 11.
I have this error : AttributeError: 'PostgresSessionStore' object has no attribute 'cursor'
Can it be related to multithreading issues with SessionStore objects ?
Some log parts :
2019-11-04 05:45:39,143 24 INFO ? odoo.http: HTTP Configuring static files
2019-11-04 05:45:39,159 24 INFO ? odoo.sql_db: Connection to the database failed
2019-11-04 05:45:39,409 24 INFO ? werkzeug: 172.28.0.1 - - [04/Nov/2019 05:45:39] "GET / HTTP/1.1" 500 -
2019-11-04 05:45:39,417 24 ERROR ? werkzeug: Error on request:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 205, in run_wsgi
execute(self.server.app)
File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 193, in execute
application_iter = app(environ, start_response)
File "/usr/lib/python3/dist-packages/odoo/service/wsgi_server.py", line 166, in application
return application_unproxied(environ, start_response)
File "/usr/lib/python3/dist-packages/odoo/service/wsgi_server.py", line 154, in application_unproxied
result = handler(environ, start_response)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1321, in __call__
return self.dispatch(environ, start_response)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1295, in __call__
return self.app(environ, start_wrapped)
File "/usr/lib/python3/dist-packages/werkzeug/wsgi.py", line 599, in __call__
return self.app(environ, start_response)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1457, in dispatch
explicit_session = self.setup_session(httprequest)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1364, in setup_session
session_gc(self.session_store)
File "/usr/lib/python3/dist-packages/odoo/tools/func.py", line 23, in __get__
value = self.fget(obj)
File "/var/lib/isi-addons/muk_session_store/patch/http.py", line 82, in session_store
return postgres.PostgresSessionStore(session_class=http.OpenERPSession)
File "/var/lib/isi-addons/muk_session_store/store/postgres.py", line 53, in __init__
self._open_connection()
File "/var/lib/isi-addons/muk_session_store/store/postgres.py", line 74, in _open_connection
self._create_database()
File "/var/lib/isi-addons/muk_session_store/store/postgres.py", line 64, in _create_database
self._setup_db()
File "/var/lib/isi-addons/muk_session_store/store/postgres.py", line 39, in wrapper
return func(self, *args, **kwargs)
File "/var/lib/isi-addons/muk_session_store/store/postgres.py", line 79, in _setup_db
self.cursor.execute("""
AttributeError: 'PostgresSessionStore' object has no attribute 'cursor'
2019-11-04 05:45:39,649 31 INFO ? odoo: Odoo version 11.0-20191104
2019-11-04 05:45:39,649 31 INFO ? odoo: Using configuration file at /etc/odoo/odoo.conf
I am running a customized docker container (based on official script, adding your modules and some others). The odoo.conf
contains workers = 10
. I encountered this error when trying to run unit tests with this image. It creates an empty database, and it fails at first authentication.
If I remove the worker
parameter (leave it to default), it works fine.
Has someone of something I can try to make it work ? So I can try to improve my Odoo instance concurrent workload... Thanks :)