ajepe / odoo-addons

Odoo addons
24 stars 40 forks source link

Error 500 getting token #27

Open halie412 opened 1 year ago

halie412 commented 1 year ago

Hi, i get error 500 when i try to get token according to instruction

Some testing maked: 1) When i put bad username/password get error "Login, password or db invalid"

2) When i put bad db name get error "invalid_database"

3) I try connecting directly to IP address and no work, trougth nginx with SSL but everytime get error 500

4) I test with published version (https://apps.odoo.com/apps/modules/14.0/restful/) and also dowloading branch 15 and happen exactly same

This are some details: My server runs odoo 14 (new) VPS: Debian 11 (Google Cloud Platform)

Others apps run perfectly

This is the error 500:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>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.</p>

I´m testing with Postman: Captura de Pantalla 2022-12-12 a la(s) 1 17 47 p m

ERROR LOG: 2022-12-12 18:35:12,359 2274606 INFO odoo14 odoo.addons.base.models.res_users: Login successful for db:odoo14 login:MY_USER from MY_IP 2022-12-12 18:35:12,369 2274606 INFO odoo14 werkzeug: MY_IP - - [12/Dec/2022 18:35:12] "GET /api/auth/token HTTP/1.1" 500 - 13 0.004 0.043 2022-12-12 18:35:12,374 2274606 ERROR odoo14 werkzeug: Error on request: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 237, in _dispatch result = request.dispatch() File "/usr/lib/python3/dist-packages/odoo/http.py", line 808, in dispatch r = self._call_function(self.params) File "/usr/lib/python3/dist-packages/odoo/http.py", line 361, in _call_function return checked_call(self.db, *args, *kwargs) File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 94, in wrapper return f(dbname, args, kwargs) File "/usr/lib/python3/dist-packages/odoo/http.py", line 349, in checked_call result = self.endpoint(*a, kw) File "/usr/lib/python3/dist-packages/odoo/http.py", line 914, in call return self.method(*args, *kw) File "/usr/lib/python3/dist-packages/odoo/http.py", line 533, in response_wrap response = f(args, kw) File "/usr/lib/python3/dist-packages/odoo/addons/restful/controllers/token.py", line 102, in token "currency": request.env.user.currency_id.name, Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 323, in run_wsgi execute(self.server.app) File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 312, in execute application_iter = app(environ, start_response) File "/usr/lib/python3/dist-packages/odoo/service/server.py", line 441, in app return self.app(e, s) File "/usr/lib/python3/dist-packages/odoo/service/wsgi_server.py", line 113, in application return application_unproxied(environ, start_response) File "/usr/lib/python3/dist-packages/odoo/service/wsgi_server.py", line 88, in application_unproxied result = odoo.http.root(environ, start_response) File "/usr/lib/python3/dist-packages/odoo/http.py", line 1334, in call return self.dispatch(environ, start_response) File "/usr/lib/python3/dist-packages/odoo/http.py", line 1300, in call return self.app(environ, start_wrapped) File "/usr/lib/python3/dist-packages/werkzeug/middleware/shared_data.py", line 260, in call return self.app(environ, start_response) File "/usr/lib/python3/dist-packages/odoo/http.py", line 1525, in dispatch result = ir_http._dispatch() File "/usr/lib/python3/dist-packages/odoo/addons/auth_signup/models/ir_http.py", line 19, in _dispatch return super(Http, cls)._dispatch() File "/usr/lib/python3/dist-packages/odoo/addons/web_editor/models/ir_http.py", line 21, in _dispatch return super(IrHttp, cls)._dispatch() File "/usr/lib/python3/dist-packages/odoo/addons/utm/models/ir_http.py", line 29, in _dispatch response = super(IrHttp, cls)._dispatch() File "/usr/lib/python3/dist-packages/odoo/addons/http_routing/models/ir_http.py", line 512, in _dispatch result = super(IrHttp, cls)._dispatch() File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 241, in _dispatch return cls._handle_exception(e) File "/usr/lib/python3/dist-packages/odoo/addons/utm/models/ir_http.py", line 34, in _handle_exception response = super(IrHttp, cls)._handle_exception(exc) File "/usr/lib/python3/dist-packages/odoo/addons/http_routing/models/ir_http.py", line 607, in _handle_exception return super(IrHttp, cls)._handle_exception(exception) File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 209, in _handle_exception return request._handle_exception(exception) File "/usr/lib/python3/dist-packages/odoo/http.py", line 746, in _handle_exception return super(HttpRequest, self)._handle_exception(exception) File "/usr/lib/python3/dist-packages/odoo/http.py", line 317, in _handle_exception raise exception.with_traceback(None) from new_cause AttributeError: 'res.users' object has no attribute 'currency_id' - - -

aqeebimtiaz commented 1 year ago

It's clearly showing that you have currency_id field is missing in res.users.

Check the field, it's missing somehow in your DB.

halie412 commented 1 year ago

Very thanks, i resolved that commenting the problematic lines on code