Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0] website_require_login - Error psycopg2.OperationalError: Unable to use a closed cursor in odoo.sh #1061

Open
SodexisTeam opened this issue Oct 3, 2024 · 0 comments
Labels

Comments

@SodexisTeam
Copy link
Member

SodexisTeam commented Oct 3, 2024

Module:
website_require_login

Describe the bug:
After installing the module on Odoo.sh, we are encountering an error in the
website = request.env["website"].sudo().get_current_website() line inside
the _dispatch function in ir_http.py file.

This below error appears in the logs. Is this normal?

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 306, in run_wsgi
execute(self.server.app)
File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 294, in execute
application_iter = app(environ, start_response)
File "/home/odoo/src/odoo/odoo/service/server.py", line 441, in app
return self.app(e, s)
File "/home/odoo/.local/lib/python3.8/site-packages/raven/middleware.py", line 100, in call
iterable = self.application(environ, start_response)
File "/home/odoo/src/odoo/odoo/service/wsgi_server.py", line 111, in application
return ProxyFix(application_unproxied)(environ, start_response)
File "/usr/lib/python3/dist-packages/werkzeug/middleware/proxy_fix.py", line 232, in call
return self.app(environ, start_response)
File "/home/odoo/src/odoo/odoo/service/wsgi_server.py", line 88, in application_unproxied
result = odoo.http.root(environ, start_response)
File "/home/odoo/src/odoo/odoo/http.py", line 1341, in call
return self.dispatch(environ, start_response)
File "/home/odoo/src/odoo/odoo/http.py", line 1307, in call
return self.app(environ, start_wrapped)
File "/usr/lib/python3/dist-packages/werkzeug/middleware/shared_data.py", line 220, in call
return self.app(environ, start_response)
File "/home/odoo/src/odoo/odoo/http.py", line 1530, in dispatch
result = ir_http._dispatch()
File "/home/odoo/src/user/website/website_require_login/models/ir_http.py", line 18, in _dispatch
website = request.env["website"].sudo().get_current_website()
File "/home/odoo/src/odoo/addons/website/models/website.py", line 593, in get_current_website
country_id = self.env['res.country'].search([('code', '=', country)], limit=1).id
File "/home/odoo/src/odoo/odoo/models.py", line 1720, in search
return res if count else self.browse(res)
File "/home/odoo/src/odoo/odoo/models.py", line 5013, in browse
if not ids:
File "/home/odoo/src/odoo/odoo/osv/query.py", line 172, in bool
return bool(self._result)
File "/home/odoo/src/odoo/odoo/tools/func.py", line 26, in get
value = self.fget(obj)
File "/home/odoo/src/odoo/odoo/osv/query.py", line 165, in _result
self._cr.execute(query_str, params)
File "", line 2, in execute

File "/home/odoo/src/odoo/odoo/sql_db.py", line 100, in check
raise psycopg2.OperationalError('Unable to use a closed cursor.')
psycopg2.OperationalError: Unable to use a closed cursor. - - -

To Reproduce
Affected versions:
14

@SodexisTeam SodexisTeam added the bug label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant