odoo-rest-api icon indicating copy to clipboard operation
odoo-rest-api copied to clipboard

Odoo server error

Open mauryasoftware opened this issue 5 years ago • 5 comments

I am getting this issue

{ "jsonrpc": "2.0", "id": null, "error": { "code": 200, "message": "Odoo Server Error", "data": { "name": "odoo.exceptions.AccessDenied", "debug": "Traceback (most recent call last):\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/http.py", line 656, in _handle_exception\n return super(JsonRequest, self)._handle_exception(exception)\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/http.py", line 314, in _handle_exception\n raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/tools/pycompat.py", line 87, in reraise\n raise value\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/http.py", line 698, in dispatch\n result = self._call_function(**self.params)\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/http.py", line 346, in _call_function\n return checked_call(self.db, *args, **kwargs)\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/service/model.py", line 97, in wrapper\n return f(dbname, *args, **kwargs)\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/http.py", line 339, in checked_call\n result = self.endpoint(*a, **kw)\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/http.py", line 941, in call\n return self.method(*args, **kw)\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/http.py", line 519, in response_wrap\n response = f(*args, **kw)\n File "/home/om/odoo-dev/odoo-12/community/odoo-rest-api-master/controllers/controllers.py", line 44, in authenticate\n try:\nodoo.exceptions.AccessDenied: login is required.\n", "message": "login is required.", "arguments": [ "login is required." ], "exception_type": "access_denied" } } }

mauryasoftware avatar Aug 03 '20 08:08 mauryasoftware

It looks like you are not passing login parameter when authenticating your user, you should pass login, password and db.

yezyilomo avatar Aug 08 '20 11:08 yezyilomo

Your request body should look like

{
    "params": {
         "login": "[email protected]",
         "password": "yor_password",
         "db": "your_db_name"
    }
}

yezyilomo avatar Aug 08 '20 11:08 yezyilomo

I am getting wrong status, its always given me 200 Ok. whenever i need to get different status for wrong value passing see attachment file status and error message. Screenshot-from-2020-09-23-14-44-50

mauryasoftware avatar Sep 23 '20 09:09 mauryasoftware

I am getting this issue. Please help me. I using odoo 14 { "jsonrpc": "2.0", "id": null, "error": { "code": 200, "message": "Odoo Server Error", "data": { "name": "werkzeug.exceptions.BadRequest", "debug": "Traceback (most recent call last):\n File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 237, in _dispatch\n result = request.dispatch()\n File "/usr/lib/python3/dist-packages/odoo/http.py", line 683, in dispatch\n result = self._call_function(**self.params)\n File "/usr/lib/python3/dist-packages/odoo/http.py", line 326, in _call_function\n raise werkzeug.exceptions.BadRequest(msg % params)\nException\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File "/usr/lib/python3/dist-packages/odoo/http.py", line 639, in _handle_exception\n return super(JsonRequest, self)._handle_exception(exception)\n File "/usr/lib/python3/dist-packages/odoo/http.py", line 315, in _handle_exception\n raise exception.with_traceback(None) from new_cause\nwerkzeug.exceptions.BadRequest: 400 Bad Request: <function Home.index at 0x7fbe7a992a60>, /: Function declared as capable of handling request of type 'http' but called with a request of type 'json'\n", "message": "400 Bad Request: <function Home.index at 0x7fbe7a992a60>, /: Function declared as capable of handling request of type 'http' but called with a request of type 'json'", "arguments": [], "context": {} } } }

daolvcntt avatar Dec 01 '20 16:12 daolvcntt

I had the same problem but I realized that I had inserted an / more ... so check the URI

cicciob95 avatar Dec 17 '20 12:12 cicciob95